Repository navigation
feat(native): server-streamed preview browser in the right panel - #53
Merged
Merged
Conversation
…l bar over overlays, stale tabs
Owner
Author
|
Review fixes in 17f8d55, rebased onto Fixed (all four were real)
Dismissed: none. |
rynfar
force-pushed
the
nw/w17-preview
branch
from
November 2, 2026 17:42
076a268 to
17f8d55
Compare
Owner
Author
|
Added a test for fix 4 (d1705ca). The decision about what the shown thread's browser tabs need now lives in core as |
This was referenced Nov 2, 2026
Open
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports ledger row PN-PREVIEW (now
partial): the web's server-streamed browser as a right panel tab, against the unmodified server (capabilities.serverBrowser,preview.open/adjust/close/list,subscribePreviewEvents,subscribeDiscoveredLocalServers, and the/api/preview-stream/wssocket authenticated with amediaWebSocket ticket).What shipped
crates/core/src/preview.rs,preview/stream.rs,preview/address.rs, with tests): wire types; the per-thread session reducer frompreviewStateStore.ts(revision/epoch ordering, suppressed closes, newer-copy wins, reveal baselines); stream messages, input encoding, the controller gate, close codes, retry and refusal backoff, host setup; viewer geometry (pagePoint,placeAgentCursor, frame cap); keystroke to DOM key mapping;resolveAddressBarInput/normalizePreviewUrl; per-project recent history.right_panel.rsgainsSurfaceKind::Preview(browser:<tab>/browser:new, the web's persisted shape),openBrowserandreconcileBrowserSurfaces.crates/client/src/preview_stream.rs): mints a media ticket per connect, acks every JPEG frame, keeps only the newest frame in awatch, sends input only while this viewer controls the tab, and reconnects with the web's backoff until the tab is gone, the host needs setup, or the upgrade is refused 3 times.examples/preview_probe.rsruns the whole path headless.crates/app/src/preview/): "Browser" in the launcher and the add menu (disabled with the web's hint when the server has no browser or the device lackspreview:operate); the tab title follows the page; the chrome row (back, forward, refresh, address bar with search, open in system browser); the page drawn from frames decoded off the UI thread, repainting only the page view per frame; pointer, wheel (coalesced to ~16ms), key, paste and thumb-button input scaled to page px (HiDPI cap from the window scale); resize sync and frame cap growth; control bar with Take/Release control; agent cursor overlay and read-only watching when the agent drives; page dialogs; host setup and refused states; empty state with recently used addresses and discovered local servers; the unreachable page. Tabs follow the thread's sessions (agent-opened and popup tabs appear, forced reveals come to the front, server-closed sessions drop their tab); closing a tab closes its session. Keys:preview.toggle(mod+shift+j), and in thepreviewFocuscontext mod+r, mod+l, zoom in/out/reset (viapreview.adjust). Only the active browser tab streams.Evidence (offscreen snapshots against the smoke server, 1440x900 @2x)
/private/tmp/claude-501/-Volumes-DevSSD-t3code/31a183a0-8354-4d43-b031-d9f81d50685d/scratchpad/w17/w17-empty.png/private/tmp/claude-501/-Volumes-DevSSD-t3code/31a183a0-8354-4d43-b031-d9f81d50685d/scratchpad/w17/w17-live.png/private/tmp/claude-501/-Volumes-DevSSD-t3code/31a183a0-8354-4d43-b031-d9f81d50685d/scratchpad/w17/w17-unreachable.pngProbe transcript (smoke server; the session is closed at the end):
Gates:
cargo test --workspace,cargo clippy --workspace --all-targets -- -D warnings,gen-theme --check,parity/sync.test.ts,conformance --checkall pass.Unverified
Not ported yet
Floating mini player / picture in picture, device toolbar and viewport presets, annotations and screenshots, recording, file chooser uploads and downloads, color scheme/hard reload menu, IME composition into the page, real favicons, reopening a closed browser tab with cmd-shift-t, the confirm before closing an agent-driven tab, the configured URLs from project scripts in discovery, and a search engine setting (DuckDuckGo is used, as the web defaults).
Model and harness: Opus 5.5 (Claude Code agent W17).