Skip to content

Host browser panes in the shared pane canvas with explicit lifecycle ownership - #17

Merged
yansfil merged 1 commit into
mainfrom
integrate/browser-panes
Sep 6, 2026
Merged

yansfil merged 1 commit into
mainfrom
integrate/browser-panes

Conversation

@yansfil

@yansfil yansfil commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What changed, in one paragraph a new contributor can follow

A pane can now carry a browser instead of a terminal. The plugins/browser Herdr plugin owns a Chromium target backed by a named profile and reports its identity (binding, profile, target, CDP port, ownership) through pane tokens; the core reads those tokens through the typed wire boundary into a PaneContent model that is independent of pane layout, so a shell that later occupies the same layout leaf never inherits a stale browser; and the Swift shell draws the frame through a native transport (BrowserCDPSession, BrowserCanvas, BrowserPaneController) inside the same canvas terminals use, forwarding native editing keys and fitting the viewport the pane owns. Closing a browser pane or its tab states what ownership is released before it happens. A remote projection marks browser content unavailable rather than attaching to a host it cannot reach. docs/BROWSER_PANES.md explains the plugin, the tokens and the lifecycle. Third of four integration pull requests, after #15 and #16.

Review boundary

  • Runtime mutex: nothing new is held under it; pane content is derived from tokens the replica already carries, inside the existing projection pass.
  • Snapshot wire: adds tokens to the projected pane and a content value on each pane in the revisioned rest. Tokens change only when the plugin reports, so an idle session does not restamp rest. The token map crosses the boundary through the generated PaneInfo type in wire.rs; the replica keeps no wire struct (check-typed-contract-structure.py and both structure lanes pass).
  • Ownership: the browser target is plugin-owned; the pane it lives in is Herdr-owned as before. The core owns the content projection and moves ahead of Herdr only for the content label, never for pane geometry.
  • Herdr contract: no new method, parameter or field. Pane tokens are the contract's existing PaneInfo.tokens map (string values, 32 keys max).
  • Failure path: a token set the shell cannot host renders as an unavailable pane with the reason in the frame; a CDP session that drops falls back to the same state and is logged as a browser component JSON line; a remote host's browser pane is unavailable by construction.

Evidence

  • Verified by: cargo test --locked (351 core tests pass), swift test (260 tests pass), the plugin's node --test suite (6 pass), all seven structural checks, check-typed-contract-structure.py, check-typed-contract.sh structure and check-typed-live-remote.sh structure, run locally on this branch.
  • Not verified (and why): no fresh screenshot of a live browser pane on this branch; the feature was exercised on the line it comes from and the visual pass is repeated once the four integration pull requests are on main. The full check-herdr-contract.sh against a running server is a local step and was not run here.

Screenshots

Not captured for this integration pass; see Evidence.

AI tooling

The move of the pane token read onto the typed wire boundary (a tokens field on ProjectedPane, filled in wire.rs) and this description were produced with AI tooling. Every lane above was run locally afterwards.

…ownership

A pane can carry browser content: the browser plugin owns a Chromium
profile-backed target and reports it through pane tokens, the core reads
those tokens through the typed wire boundary into a pane content model that
is independent of pane layout, and the shell draws the frame through a native
transport in the same canvas terminals use, forwarding native editing keys and
fitting owned viewports. Closing a browser pane or its tab explains what
ownership is released. A remote projection marks browser content unavailable
rather than attaching to a host it cannot reach.
@yansfil
yansfil merged commit 6728c14 into main Sep 6, 2026
4 checks passed
@yansfil
yansfil deleted the integrate/browser-panes branch September 6, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant