Repository navigation
fix: stop the file tree writing scrolls that move nothing when it reveals a focused row - #6149
Merged
Merged
Conversation
…eals a focused row @pierre/trees measures its viewport with getBoundingClientRect, so in a tree 791.84px tall the reveal target for a row at the bottom edge is fractional (138.16) while Chrome holds scrollTop at a device pixel (138). Its "already there" check compares exactly, so every focus change wrote scrollTop = 138.16, which moved nothing and stopped any scroll under way. #5806's unmoved-scroll watch reports that write, failing test_presses_and_fills_leave_no_element_naming_stale_keys[file-tree] on Linux in the Nov 12, 14 and 15 scheduled runs. A build seam in the trees bundle now treats a target within a pixel of the current scrollTop as reached, in all four of the library's scroll-target comparisons. @pierre/trees 1.0.0 has the same comparison, so upgrading would not fix it. Closes #5657
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2026
…change (#6595) The file tree's vendored `@pierre/trees` clamps its virtualized list's scroll against a maximum it computes from the viewport's fractional `getBoundingClientRect` height, while Chrome holds the box at whole pixels. So at the list's end each scroll event and model change wrote a `scrollTop` that moved nothing (1038.94 against the 1039 Chrome holds), which the write watch reports. This adds a seam in `build/vendor.mjs` beside the four #6149 added for the same mismatch: the clamp writes only when the box stands a pixel or more past the maximum. The rebuilt bundle changes one expression. Firefox keeps fractional offsets and never made the write. It surfaced in `test_presses_and_fills_leave_no_element_naming_stale_keys[file-tree]`, which fails whenever its random sweep leaves the tree at its end: 2 of 5 local runs on main, and every run on #6569, whose row change reshuffles the sweep. With the seam it passed 5 of 5 on each. Collapsing a folder at the list's end still clamps the box to the new end. Ref #6303, whose list of Nov 17 nightly failures includes this test. Found while checking #6569's full test run; nobody asked for it separately. Tests: that node 5 of 5 on main and on #6569 merged; the file-tree widget's tests by node id; `pnpm run check:browser`. > _This was written by Claude Code on behalf of max-sixty_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@pierre/treesmeasures its viewport withgetBoundingClientRect, so a reveal target can be fractional. In the file-tree example the tree is 791.84px tall, and the target for a focused row at the bottom edge comes out at 138.16 while Chrome holdsscrollTopat 138. The library's "already there" check compares exactly, so every focus change wrotescrollTop = 138.16, which moved nothing and stopped any scroll under way. #5806's unmoved-scroll watch reports that write, andtest_presses_and_fills_leave_no_element_naming_stale_keys[file-tree]has failed on Linux in the Nov 12, 14 and 15 scheduled runs, most recently 43706054091.The trees bundle's
adaptseams inbuild/vendor.mjsnow also make the library's four scroll-target comparisons treat a target within a pixel of the currentscrollTopas reached. The rebuilt bundle changes only those comparisons.@pierre/trees1.0.0 still compares exactly, so upgrading wouldn't fix this. A row at the edge can now stay clipped by less than a pixel instead of getting a write that moves nothing.Verification: the journey failed 3 of 3 runs locally on main with
uo (vendor/pierre-trees.esm.js…)as the writer and passed 2 of 2 with the change. The file-tree cases intests/browser/test_render_diff_controls.py(4) andtests/journeys/test_render_diff_controls.py(3) pass, and so doesbuild/browser/build.test.mjs.#5657's original 18 cases all pass in the Nov 15 scheduled run except three that now fail with different messages and have their own owners: card placement
[workspace-1000](#6047), the focus-ring sweep (#5832) and macOSthread-panel-gallery(#6048). The[file-tree]case is the one later diagnoses on #4225 filed under #5657.Closes #5657 — automated triage