Skip to content

feat: in-app browser for viewing local agent work #225

@khaliqgant

Description

@khaliqgant

Summary

Add an in-app browser panel so users can view locally-running web servers started by agents (e.g. npm run dev output on localhost) without leaving Pear.

Approach

Use an Electron <webview> tag (renderer-side, no main-process plumbing needed). Key behaviors:

  • Auto-detect port from PTY output — parse localhost:\d+ / Local: http://... patterns from broker terminal stream and auto-navigate the webview
  • URL bar with manual override for cases where the agent doesn't print a URL
  • Nav controls — back, forward, reload
  • Tab or side-panel layout (tab is simpler v1)

Implementation plan

  • Enable webviewTag: true in BrowserWindow webPreferences
  • LocalBrowser React component wrapping <webview> with URL bar + nav buttons
  • Port-detection regex on PTY stream in broker.ts → IPC event to renderer
  • Wire detected URL → webview loadURL
  • Add browser tab/panel entry point in UI

Scope

localhost only — no external browsing needed. Estimated ~half a day for a solid v1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions