Repository navigation
fix: re-place a thread card when the pane holding its pointed row scrolls - #5206
Merged
Merged
Conversation
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
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.
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_panehas failed on everycirun on main since #4873.Cause. #4873 changed
threadCardPlaceto return the thread's target as the element its placement watches. Floating UI'sautoUpdatere-places on scrolls of that element's ancestors. When a pane's rows have no ids, the target is the wholelf-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-topand the anchor offset kept their pre-scroll values. Before #4873, the watch used the attachment's element (point ?? targetincommentAttachment), 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 bisectover 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 intest_render_send_placement.py.pnpm run checkpasses, and the rebuilt kernel matchespnpm run build:browser.Closes #5161 — automated triage