Skip to content

fix: re-place a thread card when the pane holding its pointed row scrolls - #5206

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5161
Nov 3, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A thread card on a row ⌥-clicked deep in a scrolling pane stood above the pane once the row scrolled away (card top 24.9 px, pane top 370 px), instead of stopping at the pane's top. test_a_row_pointed_in_a_scrolling_pane_keeps_its_card_in_the_pane has failed on every ci run on main since #4873.

Cause. #4873 changed threadCardPlace to return the thread's target as the element its placement watches. Floating UI's autoUpdate re-places on scrolls of that element's ancestors. When a pane's rows have no ids, the target is the whole lf-pane, and its rows box sits inside the pane rather than above it. So scrolling the rows never re-ran placement, and the card's CSS anchor carried it out of the pane with the row: after the scroll, --lf-cut-top and the anchor offset kept their pre-scroll values. Before #4873, the watch used the attachment's element (point ?? target in commentAttachment), whose ancestors include the rows box. This PR goes back to that element and falls back to the target when the target isn't drawn, as the code before #4873 did. #4873's own intent, strict type checking, is unaffected.

Verification. git bisect over the test traced the failure to e698b75 (#4873). The test fails on main and passes with this change, and so do its neighbours on panes, logs and non-scrolling regions in test_render_send_placement.py. pnpm run check passes, and the rebuilt kernel matches pnpm run build:browser.

Closes #5161 — automated triage

A thread card on a row ⌥-clicked deep in a scrolling pane stood above the
pane once the row scrolled away, instead of stopping at the pane's top.

#4873 had `threadCardPlace` return the thread's target as the element its
placement watches. Floating UI's `autoUpdate` re-places on scrolls of that
element's ancestors, and a pane's rows box sits inside the pane, not above
it, so scrolling the rows never re-ran placement and the CSS anchor carried
the card with the row out of the pane. Before #4873 the watch used the
attachment's element, the pointed row when there is one, whose ancestors
include that rows box. The watch reads it again, falling back to the target
when the target is not drawn.

Behavior restored: a card on a pointed row in a scrolling pane re-places on
the pane's scroll and stays in the pane.
`test_a_row_pointed_in_a_scrolling_pane_keeps_its_card_in_the_pane` fails
before and passes after.

Closes #5161
@leaf-agent
leaf-agent merged commit 60a0768 into main Nov 3, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5161 branch November 3, 2026 11:08
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.

Pointed reply card appears above its scrolling pane

1 participant