[Bug]: preview_resize leaves fresh hidden desktop tabs at 1280×800 until the first snapshot #39254
Written by human: a small add-on to #22942 which was mostly fixed but seems to have not applied correctly to hidden previews.
Written by an agent:
Before submitting#
- 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#
- In T3 Code Desktop on Linux, open a fresh preview tab with
preview_open({ open: false, reuseExistingTab: false, profileId: "incognito" }). Keep the tab hidden and use its returnedtabIdfor each call. - Before taking a snapshot, call
preview_resize({ tabId, mode: "preset", preset: "iphone-12-pro", orientation: "portrait" }). - Compare the resize response with
preview_status({ tabId })andpreview_evaluate({ tabId, expression: "({ width: innerWidth, height: innerHeight })" }).
This reproduces on about:blank and requires no local web server.
Expected behavior#
The resize applies the 390×844 preset to the hidden tab. The resize response, status, and page dimensions all report 390×844 without first taking a snapshot or showing the tab.
Actual behavior#
The stored setting changes to 390×844, but the resize response, status measurement, and page dimensions all remain at 1280×800. The call returns successfully.
All six fixed-size resize requests made before the first snapshot stalled across four fresh hidden tabs. Both Default and Incognito profiles were affected. Waiting five seconds, retrying, and reloading the page did not clear the stall. The first successful snapshot applied the pending dimensions on all four tabs. On a fifth fresh tab, taking a snapshot before the first resize made both subsequent resizes work immediately.
Impact#
Minor bug or occasional failure
Version or commit#
Live reproduction on T3 Code 0.1.10. Source inspected at 9d2db4b23f.
Environment#
Linux x86_64, Electron 44.10.1, Chromium 152.0.7977.169, Codex through T3 Code.
Logs or stack traces#
preview_resize setting 390×844
preview_resize viewport 1280×800
preview_status viewport 1280×800
preview_evaluate page size 1280×800
After preview_snapshot 390×844
In a separate Electron/Xvfb test, the host `<webview>` element measured 390×844 while the guest page remained at 1280×800. Changing only the wrapper’s CSS `visibility` to `visible` applied the pending size while the wrapper stayed offscreen. T3 Code [hides inactive webview wrappers on Linux](https://github.com/pingdotgg/t3code/blob/9d2db4b23fe0449b0a652492ab734740e4aa08aa/apps/web/src/browser/hostedBrowserWebviewStyle.ts#L49-L72) and temporarily makes them visible during capture.
This follows up on the hidden-tab case in #22942. #32854 fixed reporting of the measured viewport. Here that measurement is accurate, and the guest page stays at the old size.
Screenshots, recordings, or supporting files#
No response
Workaround#
Take one successful preview_snapshot on the same tab, then verify the page dimensions with preview_evaluate. The tab can stay hidden.
Reproduced and drafted with GPT-6.2-Sol through Codex in T3 Code.
gregbartell(GitHub profile, opens in a new tab) added labelsbug
gregbartell(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge closed this
Sign in to join this conversation.