Problem
Current Options.web_panes receives only the model (src/runtime/ui_app.zig:753), while panes are reconciled for every window. An app cannot state which window owns a pane, so secondary-window rebuilds can resolve a pane anchor against the wrong tree. Chrome has the same limitation: there is no per-window build hook for chrome-generated terminal content.
Scope
Introduce a shared ChromeContext naming canvas label, window id, size, tokens, and whether it is the main window. Add an opt-in build_window hook and pass the same context to web_panes; preserve current hooks for existing apps.
Acceptance
- A secondary window can render window-specific chrome.
- Web-pane hooks return only the panes owned by the requested window.
- Existing single-window apps retain their behavior.
Upstream candidate
Medium-sized port from the Cockpit fork. Split from the terminal work; it is independently useful for multi-window apps.
Problem
Current
Options.web_panesreceives only the model (src/runtime/ui_app.zig:753), while panes are reconciled for every window. An app cannot state which window owns a pane, so secondary-window rebuilds can resolve a pane anchor against the wrong tree. Chrome has the same limitation: there is no per-window build hook for chrome-generated terminal content.Scope
Introduce a shared
ChromeContextnaming canvas label, window id, size, tokens, and whether it is the main window. Add an opt-inbuild_windowhook and pass the same context toweb_panes; preserve current hooks for existing apps.Acceptance
Upstream candidate
Medium-sized port from the Cockpit fork. Split from the terminal work; it is independently useful for multi-window apps.