Skip to content

Give thread views complete presentation ownership - #1887

Merged
max-sixty merged 3 commits into
mainfrom
codex/complete-component-owners
Oct 6, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/complete-component-owners

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

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.

This was written by Codex on behalf of max-sixty

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
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.
@max-sixty
max-sixty merged commit 23c4249 into main Oct 6, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/complete-component-owners branch October 6, 2026 07:55
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]>
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.

2 participants