Remote browser viewer receives full-resolution stills that ignore its maxWidth/maxHeight after every scroll
What happened
The browser panel feels laggy when viewed and controlled from the iOS app, most of all right after a scroll stops.
Diagnosis
In apps/server/src/preview/ServerBrowser.ts, attachViewer caps live frames with the viewer's maxWidth/maxHeight. pushStill calls ServerBrowserPage.captureViewport, which sends Page.captureScreenshot with no size limit. The still therefore arrives at the tab's full device resolution. It is sent when a viewer attaches and 200 ms after each scroll burst. Only one frame is on the wire at a time, so the large still holds back the next frame for its whole transfer.
Steps to reproduce
- On a display with scale factor 2, open a desktop browser tab on a long page (1536×960 CSS px here).
- Connect to
/api/preview-stream/wswithmaxWidth=804&maxHeight=1400. - Send
wheelinputs for 4 seconds, then stop. - Read the JPEG dimensions of each binary frame.
Version
0.1.9-nightly.20261110.4478 (source read at main 1a2a4a5e)
Environment
macOS 26.6.2, Apple Silicon MacBook Pro, official desktop app, viewer on iOS through T3 Connect
Evidence
en.wikipedia.org/wiki/Dallas, viewer cap 804x1400, 4 s of wheel input
804x503 live frames 15-77 KB
402x251 motion frames 14-17 KB
3072x1920 settle stills 402-630 KB (1-2 per scroll burst)
Simple test page: 3072x1920 stills 222-229 KB vs 31-33 KB live frames
Frame rate while scrolling: 62/s on loopback, 21/s through T3 Connect on the same Wi-Fi, 6/s with 150 ms added before each ack
Related issues
#26523 (server browser launch flags) and #28587 (Simulator preview full-resolution) are different surfaces. #24852 concerns the first still never answering, not its size.
Fix applied or workaround
None.
Filed by
claude (claude-fable-5-2) via Claude Code