Repository navigation
fork: a viewer of a hidden tab opens at once and says why it's blank - #60
Merged
Merged
Conversation
A server tab hosted in the desktop app paints only while T3's window there is
drawn. Opening one from another device while that window was minimized or
covered showed "Connecting..." on a blank canvas forever: attachViewer awaited
its opening still before the WebSocket upgraded, and a tab that can't paint
never answers the screenshot. The hung capture also held the tab's capture
lock, so agent snapshots and recordings of the tab queued behind it.
attachViewer now returns once it has asked the screencast to start, so the
stream opens and sends control at once. The opening still follows in the
background over its own CDP session, waits 5 s at most under the capture lock,
and that session is then detached so an unanswered capture ends with it. A
viewer with no frame 5 s after attaching gets one {"type":"unpainted"}
message, which the web viewer shows as a notice until a frame paints, the
stream disconnects or the viewer stops. Older clients ignore it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The notice covered the whole panel, hiding "Agent has control" and Take control, and showed over the empty state too. It now sits in the page area, so it hides with the page. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An opening still that finishes after a screencast frame is dropped, since it may be older than the frame. The unpainted notice no longer covers a PDF tab, which draws in its own embed. Only a frame the viewer's queue takes counts as painted. FORK.md and the comments now say what detaching the still's session does: it ends the server's wait and frees the capture lock, but doesn't cancel the desktop's own screenshot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
Landing on Alice's yes. At Nov 19, 10:08 AM ET she switched this task's row on her Task Priorities board to Agent with no comment, which accepts the suggested answer to its question. The question:
The suggested answer:
Before merging: all checks pass on this head, Written by Claude Opus 5.5 in Claude Code, running in T3 Code. |
3mdistal
added a commit
that referenced
this pull request
Nov 21, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 21, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 30, 2026
A desktop tab paints only while T3's window on its computer is drawn. Upstream v0.1.11 opens a viewer without waiting on the opening still (pingdotgg#25381) and, 10 s after a viewer connects with no frame, says the server's browser isn't drawing and to try reloading (pingdotgg#38865). A reload doesn't help a desktop tab, so a viewer of one with no frame 5 s after it attached gets one "unpainted" message, and the web viewer's notice then says the tab can't draw while T3's window is minimized or covered. An opening still that lands after a live frame is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Problem
A "server" preview tab can live inside the T3 desktop app on one computer (for example Alice's Windows PC) and be viewed from another device (her MacBook, over the LAN). Electron composites no offscreen guest, so such a tab paints only while T3's window on the host computer is drawn. When that window was minimized or covered and the tab was opened from the other device, the browser panel showed the title, the URL, a progress bar and "Connecting..." on a blank canvas, and stayed that way until someone brought T3 into view on the host.
Cause
ServerBrowserStreamupgrades the viewer's WebSocket only afterServerBrowser.attachViewerreturns.attachViewerended by awaiting the screencast's start and then an opening still: onePage.captureScreenshottaken under the tab's capture lock, with no time limit. A tab that can't paint never answers a screenshot, soattachViewernever returned, the upgrade never happened, and the client's socket stayedCONNECTING. The control message was already queued, but nothing was ever written, and "Connecting..." is the label a client shows until its first control message. The unanswered capture also held the tab's capture lock, so the agent's snapshots and recordings of that tab queued behind it.What changes
The stream opens at once.
attachViewerreturns as soon as it has asked the screencast to start. The stream upgrades and sends the queued control message straight away, so the panel's label shows the real control state ("Read-only", "Agent has control", and so on).The opening still can't block anything. It is taken in the background over a CDP session of its own, waits 5 seconds at most under the capture lock, and that session is detached afterwards. The Chrome DevTools Protocol (CDP) can't cancel a screenshot. Detaching ends the server's wait and gives the lock back, so the agent's snapshots and recordings go ahead and nothing is left pending on the viewer's own session. It doesn't stop the screenshot on the desktop (see below). This copies how fork PR fork: agent recordings keep a steady frame rate and fail fast on a hidden tab #55 bounded a recording's first frame.
A late still is dropped. A still that finishes after a screencast frame has arrived may be older than that frame, so the viewer never gets it and keeps the live frame.
The viewer learns why it's blank. If no frame (screencast or still) has been queued for a viewer 5 seconds after it attached, the server sends it one
{"type":"unpainted"}message. The web viewer then shows:The notice covers the page area below the control bar, so "Take control" and the other controls stay usable, and it hides with the page under the panel's empty state. A PDF tab draws in its own embed, so it never shows the notice. The notice clears on the first painted frame, when the stream disconnects, and when the surface stops.
What doesn't change
Does
Page.startScreencasthang too?Not by design. Chromium answers it without waiting for a frame: the browser side subscribes to frames and the renderer only records that a screencast is on. On the desktop relay it waits only for focus emulation, which also needs no frame. I couldn't watch this on a real hidden Electron window from this Linux host, so
attachViewerdoesn't await it either. If it ever did hang, the stream would still open and the notice would still appear; only the opening still would be skipped.The desktop side is #61
This PR doesn't touch
apps/desktop. #61 keeps a desktop tab drawing for its viewer while T3's window is hidden; the two can land in either order. The desktop's own queue still sends one screenshot at a time per tab, so on the PC an agent's screenshot can still wait behind a capture running there, even though the server's lock is freed after 5 seconds.Testing
Each new test below fails on
fork/mainand passes here.apps/server/src/preview/ServerBrowser.test.ts, newfork:tests using fake CDP sessions and Effect'sTestClock:fork/main,attachViewernever returns). The still goes over its own session, not the viewer's. An agentsnapshotqueued behind it finishes once the clock passes 5 s, the still's session has been detached, and the viewer has exactly oneunpaintedand no frame.unpainted. The screencast variant hangs onfork/main.attachViewerreturns. What it checks is unchanged.packages/client-runtime/src/preview/serverBrowserStream.fork.test.ts:{"type":"unpainted"}callsonUnpaintedonce, and frames still flow.apps/web/src/browser/ServerBrowserSurface.fork.browser.test.tsx: the notice appears ononUnpaintedand goes away on a painted frame, on disconnect, and when the surface stops and restarts. A PDF tab gets no notice.vp test runon the changed test files: 73 passed (ServerBrowser.test.ts,ServerBrowserStream.test.ts,ServerBrowserPage.fork.test.tsand both client-runtime stream tests). The twoServerBrowserSurfacebrowser test files: 7 passed.vp run check:changed origin/fork/main: format, lint, knip, graphql, typecheck (9 packages, including server, web, mobile and client-runtime), tests beside the changes and the React Compiler check all pass.No before/after capture. On this Linux host, headless Chromium always paints, so the hidden-window state can't happen here. The notice's appearance and clearing are covered by the browser test above, and it can be seen for real on the PC with #61.
Review focus
Written by Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code