You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Snapshot of a hidden preview tab larger than the window is cut off at the bottom #26964
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Run the desktop app (vp run dev:desktop on main) with a window shorter than about 1300 px. I used 1400 × 1000.
Open a thread and keep its Browser panel collapsed.
In that thread, have an agent run, in order:
preview_open with open: false on a page taller than 1700 px
preview_resize with { mode: "freeform", width: 1440, height: 1700 }
preview_snapshot with save: true
My test page stacks seventeen 100 px bands, each labelled with its y range.
Expected behavior
A 1280 × 1511 screenshot of the whole 1440 × 1700 viewport.
Actual behavior
The screenshot is 1280 × 1156 and shows only page y 0–1300. The bottom 400 CSS px are missing, and the result does not say the capture was cut.
Since #25184, a hidden guest moves inside the window, behind the app, while a capture is pending. HostedBrowserWebview sizes it to the full fixed viewport (viewport.height * layoutZoomFactor), without limiting it to the window size. Chromium paints a guest only within about 1.3 times the window in each direction (1000 × 1.3 = 1300 here), so the capture gets only that part.
A fork build that keeps agent tabs behind the app showed the same cut (1440 × 1700 in a shorter window captured only its top 1064 CSS px). In that build, Page.captureScreenshot with a clip or captureBeyondViewport returned the full size, but the part outside the painted area repeated the top of the page. So a capture option does not fix this. Capping the hidden viewport at the window size and letting the existing fit-to-container layout scale it does.
The desktop host tests added in #25184 check that a hidden guest paints while a capture is pending. They do not check how much of the guest gets painted, and a guest taller than the window is not covered.
Activity