Repository navigation
fix(web): expanded tool lists no longer crash the thread at fractional zoom - #47145
Conversation
…lientHeight Repro for #47121: under 105% page zoom Chromium reports a content-sized tool group 1px taller in scrollHeight than clientHeight, and ExpandedWorkGroupEntries flips its height allowance on every layout pass until React throws Maximum update depth exceeded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l zoom Under fractional zoom Chromium can report a list that fits its content with scrollHeight 1px above clientHeight. ExpandedWorkGroupEntries then dropped its height allowance, re-added it on the next pass, and looped until React threw Maximum update depth exceeded. Allow 1px of rounding on both sides of the check so the allowance settles. Fixes #47121 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds one-pixel tolerance to expanded tool-list measurements to prevent layout oscillation at fractional zoom. The change is limited to local display sizing, with no product-default or data-handling changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Surgically ports 62 upstream Web UI fixes from pingdotgg/t3code (772e3d4..1e6e7d7) into apps/web and scripts/scenarios while preserving all 31 locked T4 customizations, T4 branding, and t4-overrides.css. Also restores React Compiler compilation for Sidebar by moving the default new Set(...) parameter inside settleLaunchGroup into the function body so switching threads produces 0 unaffected row re-renders. Ported (62 commits): - 1a08049 (pingdotgg#46481): right-panel launcher keys blocked while context menu open - 6bdd718 (pingdotgg#46489): Enter restores highlighted stashed prompt (scenario e2e; web code already absorbed) - 347f551 (pingdotgg#46490): Escape closes open context menu before layer beneath it - afa3003 (pingdotgg#46487): workflows page uses width of wide window - a2ba869 (pingdotgg#46485): keep joined emoji whole in screen-reader announcements - a8ee725 (pingdotgg#46493): holding stash shortcut keeps prompt saved (scenario e2e; web code already absorbed) - 5048c80 (pingdotgg#46499): Mod+S moves edited queued reply to prompt stash - 179e6c3 (pingdotgg#46506): holding stash delete shortcut removes one prompt (scenario e2e; web code already absorbed) - c101437 (pingdotgg#44079): fold PR diff whose header was clicked - 9b27e5a (pingdotgg#46562): second Mod+T keeps right-panel Add menu shortcuts working - 62cf1fe (pingdotgg#46592): wait for dialog focus before opening context menu over it - fda1c30 (pingdotgg#46579): resting on issue row prefetches detail - 28f0c93 (pingdotgg#46593): slash-command description tooltip closes when modal opens - 789784b (pingdotgg#46603): keep selected tab in Workflows links - 2bc37d9 (pingdotgg#46597): / and Mod+F in Settings ignore open context menu - b21923b (pingdotgg#46640): effort shortcut closes nested Permissions menu in model picker - a5a39fa (pingdotgg#46641): inline thread details card grows with interface font size - 36983d6 (pingdotgg#46644): workflow runs open in resizable right panel - 2ad902f (pingdotgg#46691): Mod+F on PRs page ignores open menu - 97d727c (pingdotgg#46699): Link pull request dialog closes when leaving thread - 7a9d213 (pingdotgg#46729): refuse saving edit to deleted project script action - bdda9ce (pingdotgg#46745): settling open delegated task opens next thread - 3763606 (pingdotgg#46760): command menu description tooltip closes on composer focus loss - 00eae4b (pingdotgg#46764): reopen workflow run on first click - 19094fd (pingdotgg#46765): boring sidebar folder rows offer snooze again - dec756c (pingdotgg#46766): reopen last workflow run after hiding panel - 33ce571 (pingdotgg#46777): keep workflow runs open behind tab menus - a989ee8 (pingdotgg#46779): restore focus after closing workflow run - 5c42b2e (pingdotgg#46786): reopen closed workflow run tabs - caec30f (pingdotgg#46792): cancel tab drags when switching threads - 27cf2cf (pingdotgg#46794): disable empty panel shortcuts as it closes - d65936e (pingdotgg#46791): reveal all side panel tabs when they fit - a9daa0b (pingdotgg#46781): right-panel shortcuts ignore presses while menu/dialog open - 35b6c5f (pingdotgg#46801): dismissing PR checkout toast cancels handoff - e9da1b0 (pingdotgg#46818): boring sidebar folder row actions keep height and clicks - 9feac49 (pingdotgg#46855): long PR search preserves grapheme clusters - acef160 (pingdotgg#46849): find shared voice dictionary by Japanese label - 19da14d (pingdotgg#46796): scrolled right panel tabs no longer block chat titlebar drag - 506bc36 (pingdotgg#46853): close guest share and handoff dialogs when leaving thread - b4fd7ba (pingdotgg#46879): let Escape and app shortcuts pass through terminal font preview - f5689ae (pingdotgg#46835): long history load errors wrap without timeline horizontal overflow - 6b64b0c (pingdotgg#46890): focus command dialog popup when search input disabled - 70c9da7 (pingdotgg#46900): focus PR Author/Labels filter search inputs on keyboard open - 891bf1a (pingdotgg#46924): late slash results no longer open tooltip after focus leaves - 80f0f8a (pingdotgg#46930): copying failed message keeps its images - e9ca942 (pingdotgg#46659): show workflow question kinds only in filter - aa8c7c7 (pingdotgg#46941): queued message moves to stash only once removed - 3ea13b6 (pingdotgg#46940): editing answer while image prepares cancels held submit - a143526 (pingdotgg#46970): pasting copied file over reattach marker no longer reports failure - b33c330 (pingdotgg#47011): stub addComposerFilesToDraft with new return shape in test - a0fb9d1 (pingdotgg#46974): Issues Labels/Assignee filters focus search on keyboard open - cb525f4 (pingdotgg#47029): clicking anywhere on terminal or panel tab activates it - 498a3b6 (pingdotgg#47022): syncing messages line no longer shifts whole chat - e903c85 (pingdotgg#47046): pasted messages with thread link keep picture - 6a13142 (pingdotgg#47013): limit style invalidation during right-panel resize - cd8961e (pingdotgg#47078): pasting copied file no longer takes preparing screenshot slot - 8d0fb4b (pingdotgg#47100): stop showing previous Usage period as loading after failure - 515b8c9 (pingdotgg#47114): Tab from Permissions menu keeps focus inside model picker - a681dd5 (pingdotgg#47125): middle-clicking file link no longer opens broken tab - bbde8dc (pingdotgg#44842): use plus icon for project new-thread buttons - 59af88f (pingdotgg#47105): switching threads no longer re-renders unaffected sidebar rows - 1e6e7d7 (pingdotgg#47080): Reopen Closed Tab skips workflow runs removed from history Already absorbed in HEAD (3 commits): - 20a0e5f (pingdotgg#46927), a684090 (pingdotgg#47026), c557dab (pingdotgg#47076) Skipped cleanly (3 commits): - 70224ca (pingdotgg#46712): depends on unported ui/open-popups.tsx (pingdotgg#45341) - cf475c4 (pingdotgg#47034): depends on unported ui/open-popups.tsx (pingdotgg#45341) - be3cc6c (pingdotgg#47145): depends on unported fitsWithAllowance/workGroupOverflowAllowance in TimelineWorkGroupRows.tsx
At some browser or desktop zoom levels (for example 105%), expanding a tool-call list in the timeline crashed the thread view with React error #185 ('Maximum update depth exceeded'). Chromium rounds a list that fits to 1px taller than its viewport. The list's height-allowance check had no tolerance, so it switched the allowance on and off forever. The check now allows 1px of rounding, so the list settles at a stable height.
Fixes #47121
Reproduction on main
Commit 63f7006 (origin/main). Ran
T3CODE_DEV_SEED=0 vp run dev(web) in a fresh worktree with a fresh database. Added a scratch git project witht3 project add, then started a thread on the freeReplay (dev)provider with thebench-heavyscenario. That gives one work group of 13 tool calls. In headless Chromium through Playwright (1280x800): paired, opened the thread, clicked 'Worked for 1.7s', then 'Changed 4 files, ran 3 commands, and performed 6 other actions' to expand the tool-call list. At 100% the list settles with scrollHeight 312 and clientHeight 312. I then setdocument.documentElement.style.zoom = '1.05', which stands in for 105% browser or Electron zoom. The app crashed straight away into the 'Something went wrong' screen: 'Maximum update depth exceeded', stackdispatchSetState <- updateLayout (TimelineWorkGroupRows.tsx) <- commitHookLayoutEffects, error in . This happened every time at viewport height 800 and at 440. With a temporary debug log in updateLayout (removed afterwards), the values alternated forever: allowance on gives sh=313, ch=312, overflow 1 > 0, so it turns off. Allowance off gives sh=313, ch=288, overflow 25 <= 48, so it turns back on. The content box measured 327.59px at 1.05 zoom. The reporter's exact setup (Playwright deviceScaleFactor 1.1/0.9 swept over viewport heights 500-640) did not trigger it for me. Root zoom 1.1, 0.9, 1.25, 0.8, 1.5, 0.75, 0.67, 1.75 and 2 at heights 440-640 did not either. Root zoom 1.05 did. A 1px tolerance (overflow <= (fitsWithAllowance ? 1 : workGroupOverflowAllowance - 1)) made the new test and the existing height-cap tests pass. That change was reverted and is not on the branch. Failing test on branch factory/repro-47121 (0570999), in apps/web/src/components/chat/MessagesTimeline.browser.test.tsx: 'settles an expanded group whose scrollHeight rounds 1px above its clientHeight'. It renders 13 tool rows, expands them, and makes the group's scrollHeight 1px larger, the rounding seen in the real run. On main it fails with 'Maximum update depth exceeded'.Evidence
On each commit, start the real web dev stack with a fresh isolated database and no copied user state. Seed a scratch git project and a Replay (dev) bench-heavy thread; open it, click “Worked for 1.7s”, then “Changed 4 files, ran 3 commands, and performed 6 other actions” to show all 13 tool calls. Capture at 100%, set document.documentElement.style.zoom = "1.05", and capture again. Check that the expanded group remains visible.
Environment: Linux, headless Chromium, 1280×800 viewport, light theme, identical recorded replay and fresh databases.
Scenario: Expanded tool calls remain visible at 105% zoom
Proven: the scenario fails on base 63f7006a05 and passes on head 8d8a04e58e.
ASSERTION_FAILED: expect.toBeVisible failed
locator: getByRole("button", name: /Changed 4 files, ran 3 commands, and performed 6 other actions/)
expected: visible
observed: no node (match count 0)
Scenario driver · Before recording · After recording
Not shown:
Tests
vp test run src/components/chat/MessagesTimeline.browser.test.tsx -t "rounds 1px above"before the fix: failed with Maximum update depth exceeded, which reproduces the bugvp test run src/components/chat/MessagesTimeline.browser.test.tsxafter the fix: 108/108 passedvp run check:changed: format, lint, knip, typecheck, test and react compiler all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.