Repository navigation
fix(dashboard): keep a hidden remote pane's layout form instead of flashing the phone form - #34037
Conversation
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the fix sits in the one place that turned a 0x0 hidden-iframe viewport into a form change, and the resize morph and the Notes
[DESIGN-REVIEWED] ae8cf45 Description read[DESCRIPTION-READ] 6fd71e9ca26e15eaebbd24885a91359bfa09ec676ff9ef68c797e79446e5de39 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix is in the hook that turned the hidden pane's 0x0 viewport into a form change, and the PR's Not-a-goal section explicitly leaves the What this change shipsInventory (3 items) — 3 justifiedIntent: switching to a remote crew tab should show its desktop layout at once, without a full-page side-panel flash. This is a FIX (Closes #34029, and the tests fail on base).
[FIRST-PRINCIPLES-REVIEWED] ae8cf45 Description read[DESCRIPTION-READ] 972af38424dd8a65718362c5874a04ac24164384f94880ef4057c00a912495f9 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No control, label or string is added or changed. The diff only stops a hidden pane from re-forming; the remaining instant swap happens while the pane is off-screen, and the description explains why. Notes
[UX-REVIEWED] ae8cf45 Description read[DESCRIPTION-READ] 4af1cb7124df42f94b9cdbe2a4e227a15e2cab6ec7a9d38c4377303eb28e70d6 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
3456ca2 to
ad4a278
Compare
ad4a278 to
1edd1c3
Compare
|
Backend Tests shards 4-7 on head 1edd1c3 fail in the Slack code-channel tests ( |
…ashing the phone form
1edd1c3 to
ae8cf45
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Read the whole diff, tests included, and the surrounding useIsMobile.ts on main.
- A frame with a 0x0 viewport (a hidden remote pane) no longer decides the layout form.
readLivekeeps the committed form, or the touch-first form, or desktop, so a hidden pane does not redraw as a phone. - When the frame is shown again,
onSignalsees the earlier no-viewport state and commits the new form at once, so there is no view transition. A real resize across the breakpoint still morphs. committed,pendingand the attach and detach paths behave as before for a normal viewport. The update callback also goes throughreadLive, so a pane hidden while the update runs keeps its form.- The three new tests cover hidden then shown, first load hidden, and a real resize. No regex added.
I did not run the tests locally.
Problem / Motivation
Goal: Switching to a remote crew tab shows its normal desktop layout at once, with no full-page side panel that then animates back.
Every switch to a remote crew tab first shows that crew's side panel filling the whole page. A morph animation then shrinks it back to the normal layout.
Why it matters
Anyone with a remote crew sees this flash on every tab switch. It looks broken and delays the moment the chat is usable.
Not a goal
display:noneinInstancesViewport). Other gates rely on a hidden pane having no layout box, for example the terminal paste guard that drops a paste into a hidden shell.What changed (motivation → approach → change)
Root cause: an inactive remote pane is an iframe hidden with
display:none. Such a frame reports a 0x0 viewport and matches(max-width: 767px), souseIsMobileswitched the hidden pane to the phone form. When the tab was shown, the width jumped back, the pane gotresizeand the media-querychange, andrunLayoutFormChangeplayed the phone-to-desktop view transition. That transition is the animation users saw.The fix is in
useIsMobile: a 0x0 viewport never decides the form. The pane keeps the form it last drew, or desktop if it never had a real size. A form change noticed on the first signal after a 0x0 viewport applies instantly, because nobody watched a resize.Backwards compatibility
Compatible: only a document with a 0x0 viewport behaves differently, and no visible page has one.
Removes nothing: the phone form, the breakpoint and the resize morph all stay.
Tests
website/src/test/useIsMobile.test.tsadds three cases: a hidden pane keeps desktop and shows with no morph; a pane first loaded hidden starts on desktop and swaps instantly when shown narrow; a real resize across the breakpoint still morphs. With theuseIsMobile.tschange reverted, the first two fail and the third passes.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
A Chromium probe (Playwright) measured the cause: a
display:noneiframe reportsinnerWidth0 and matches the narrow query; once shown it firesresizeand the query'schangeat width 1400. Avisibility:hiddeniframe keeps 1400 and fires neither. End-to-end check with a connected remote crew is still needed: switch away and back, and the pane should appear at once with no side-panel flash.Screenshots / video
Not captured: reproducing needs a remote crew tab, and the isolated dev gateway cannot mint its own dashboard URL from an agent session. The rendered change is that the flash and its morph no longer play on a tab switch.
Related Issues
Closes #34029
Sibling sweep
Swept: git grep -n "max-width" -- website/src (live viewport-form readers outside the test tree)
Sibling: website/src/hooks/useKeyboardShortcuts.ts -- not affected -- read only at keypress, which needs a visible pane
Sibling: website/src/store/chatSlice.ts -- not affected -- a hidden pane only picks a smaller page size for older history
Pattern harvest
Not generalizable: the 0x0 viewport comes from one host choice,
display:nonewarm iframes, and the form store is the one place that turned it into a layout change.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)