Skip to content

fix: stop the file tree writing scrolls that move nothing when it reveals a focused row - #6149

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5657
Nov 16, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5657

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

@pierre/trees measures its viewport with getBoundingClientRect, 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 holds scrollTop at 138. The library's "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, and test_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 adapt seams in build/vendor.mjs now also make the library's four scroll-target comparisons treat a target within a pixel of the current scrollTop as reached. The rebuilt bundle changes only those comparisons. @pierre/trees 1.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 in tests/browser/test_render_diff_controls.py (4) and tests/journeys/test_render_diff_controls.py (3) pass, and so does build/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 macOS thread-panel-gallery (#6048). The [file-tree] case is the one later diagnoses on #4225 filed under #5657.

Closes #5657 — automated triage

…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
@leaf-agent
leaf-agent merged commit dfc6aba into main Nov 16, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5657 branch November 16, 2026 08:44
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_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eighteen nightly journey cases fail on main since before Nov 5, not yet bisected

1 participant