Repository navigation
Give thread views complete presentation ownership - #1887
Merged
Merged
Conversation
Keep list selection and scroll ownership at the surface; move title policy, outgoing fold paint, draft repaint and descendant geometry into ThreadView. Retain stable message/editor identities and the existing publication and presentation coordinator. Secure shallow-frozen publication values and selected Map/Set contents recursively. Preserve ordinary root identity, normalize frozen collection ancestors only when necessary, and reject mutation through the published reading.
leaf-agent
previously approved these changes
Oct 6, 2026
The compositor-return contract begins once a wrapped draft exists. Use the existing closed-shadow editor helper rather than expand234 individual key events in setup, where CI timed out. Assert the exact draft before and after scrolling; keep every placement and native compositor frame assertion.
leaf-agent
approved these changes
Oct 6, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 6, 2026
Fixes the recurring PR-only failure of `test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame[content-selection]`. A comment box on words that stand directly in a box that scrolls them (a short `overflow:auto` paragraph) anchored to that box and followed its inner scroll through a ScrollTimeline motion layer. Chrome does not always paint that layer in the frame that paints the scrolled words. On CI's Linux runner the box was missing for one frame after the words scrolled back into view, and on macOS it drew a frame early. The code-row case, anchored to a row inside its scroller, stayed in step on every run. The surface now anchors to the nearest element beside the words inside that scroller (`anchorFor` in `floating.js`). The same scroll carries that element, so CSS anchor positioning moves the box with the words. Motion layers remain only where no anchor reaches the scroll: inside a shadow tree, or words with no element beside them. Evidence, from a temporary workflow running only this test on `ubuntu-24.04` (since deleted): | | content-selection runs | failed | |---|---|---| | main | 36 (12 quiet, 24 with three CPU burners) | 7 | | this branch | 48 (24 quiet, 24 loaded) | 0 | Every failure on main had the same painted reading: the passage back at its place with no box, then the box a frame later. The earlier `Locator.type` timeout in the same test was removed by #1887; both of the runs the flake was reported from predate it. Test changes: - `test_a_quote_surface_follows_scaled_inner_scroll_and_retains_native_editing` now samples attachment frames after the wheel settles, around the placement renewal the test checks. A `requestAnimationFrame` read straight after a scroll sees an anchor's scroll adjustment a frame late, which is not what is painted. - `test_a_comment_box_on_words_in_a_scroller_stands_without_scroll_timelines` drops its spans, so its words still have no element beside them and the test still covers the window-plane fallback. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Thread presentation was split across several owners: the panel list synthesized outgoing fold state, draft repaint crossed two frame queues, and surface controllers interpreted title, message, and reply descendants. This makes a change to one thread region depend on callers elsewhere in the tree.
Give ThreadView its complete title/message/reply boundary: it handles title gestures, outgoing paint, local draft repaint, and descendant geometry. Lists retain whole roots, selection, placement, and scrolling, consuming thread geometry readings rather than extracting child nodes. Keep the existing immutable thread selection, Lit keyed identities, presentation coordinator, and native editors.
Secure published roots and selections recursively even when an input is already shallow-frozen. Reuse secured subtrees and preserve ordinary candidate identity; normalize frozen Map/Set inputs only where their entries require a protected replacement. The regression fails against the original bundle.
Validation: 223 runtime tests and 77 browser framework/build tests; focused real-browser editor, title, mirror, held-news, streaming, settlement, rollback, and mid-fold journeys; 10 Mac appearance cases. A recorded held-send/refuse/retry/accept journey verifies first-frame pending paint and preserves the newer draft’s editor, focus, and caret. Served base/candidate startup comparisons retain the same code-request count.
The wheel-return compositor test prepares its long draft through the existing text-field input helper, then checks the exact words before and after scrolling. This preserves its first-visible-frame assertions and removes per-character typing from setup, where CI timed out before reaching the behavior under test.