Skip to content

Keep a thread's head controls off its first message's words - #3851

Merged
leaf-agent merged 3 commits into
mainfrom
grind/s-thread-controls
Oct 27, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
grind/s-thread-controls

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A page thread's head controls (Resolve, or Reopen in its place) and its held-news notice were children of one .lf-thread-controls box that spanned the first message's whole header line, from the header's left edge to the end of the action room: the notice was positioned inside that box from --lf-thread-news-start, so the box had to be that wide. The box painted nothing and passed pointer events through, but axe finds what covers words by geometry alone, so it read no contrast for the author, the time and the sending receipt under it, and the overlapped_words check reported them (#4028, "Reconsider thread navigation", last part).

Now each is a box of its own, anchored to the header (--lf-thread-headline):

  • .lf-thread-controls starts at anchor(right) + --sp-2 and is --lf-thread-action-room wide, the room the header's margin-inline-end already keeps. Its pointer-events rules go, since it covers nothing.
  • .lf-thread-news is a child of .lf-thread-content beside the controls, at anchor(left) + --lf-thread-news-start + --sp-2, with its width bounded by anchor-size(width) in place of the old box's 100%. #retainHeaderSlot (thread-card.js) writes its two readings onto the notice itself and measures the line's visible end from the header rather than the controls box; #releaseHeaderSlot clears them.

A notice inside an absolutely positioned controls box could not anchor to the header, since an anchor must be laid out in the positioned box's containing block, which is why the notice moves up to .lf-thread-content. The notice carries data-lf-reflow="text" in the head place, the credit the controls box gave it, so the shift watch still allows its words to change in place.

Geometry

Seated page thread (TASK_SEAT_PAGE, one user comment on #jobs, then one agent reply held behind the notice), 1200×900, Chromium. Numbers are getBoundingClientRect left→right in px.

box before after
header 257→920 257→920
author b 257→276 257→276
time 284→330 284→330
.lf-thread-controls 257→956 928→956
Resolve 928→956 928→956
news notice 380→454 380→454
overlapped_words b, time, .lf-msg-sending none

Playwright Firefox, after: controls 928→956, notice 380→454, no overlapped words; Firefox resolves both anchors.

Tests

  • tests/browser/navigation/test_threads.py::test_inline_thread_surface_has_room_without_focus_reflow asserts the controls box starts past the header's right edge and overlapped_words(page) == []; the held-news seat test in tests/browser/test_render_read_state.py (test_replies_held_in_a_page_seat_show_when_the_user_turns_to_them) asserts the latter with a notice standing.
  • The chrome axe sweep (test_the_chrome_a_key_opens_has_no_serious_violations) now runs overlapped_words on each surface. It passed before this change too: the panel's thread view is a primary reader without .lf-thread-controls, so Reconsider thread navigation #4028's claim that this sweep could not hold the check was stale; the check stays since it is cheap and covers the chrome's other surfaces.
  • Tests that located the notice through .lf-thread-controls now locate it through .lf-thread-content.

Ran: pnpm run test:runtime (545 pass), pnpm run check:browser, and -k selections over tests/browser/navigation/test_threads.py, tests/journeys/test_render_read_state.py, tests/browser/test_render_read_state.py, tests/browser/test_render_floating_panel.py, tests/browser/test_render_pages.py, tests/browser/test_render_reactions.py, tests/browser/margin/test_card_placement.py, tests/browser/threads/test_summaries.py and the chrome sweep in tests/journeys/test_render_controls.py (27 tests, all pass). test_a_reopening_in_a_folded_diff_thread_waits_in_its_summary fails at teardown on a startup layout shift of the diff page's tail paragraphs; it fails the same way with this branch's files swapped for main's, so it is not this change's.

After merging main (no source conflict; the kernel rebuilt), pnpm run test:runtime, pnpm run check and the changed browser tests pass again.

Not verified: WebKit; a checkpoint-headed thread (.lf-summary-header) with news standing, beyond test_a_root_summary_keeps_thread_actions_outside_its_fold passing; the thread appearance snapshots, whose gate is paused.

Calls Max may reverse: the empty .lf-thread-controls box is still rendered while news stands with no settlement, so the header's :has(> .lf-thread-controls) reservations keep applying; anchor(right)/anchor(left) stay physical, as the file's other anchors are.

Part of #4028: its last sentences, on the header controls' box, are what this fixes.

On landing, update #4028: drop "The redesign also gives a thread's header controls a box no wider than they are" (overlapped_words).

This was written by Claude Code on behalf of max-sixty

A page thread's Resolve control and its held-news notice shared one
`.lf-thread-controls` box spanning the first header's whole line, since the
notice was positioned inside it from `--lf-thread-news-start`. The box painted
nothing, but axe finds what covers words by geometry alone, so it read no
contrast for the author, time and receipt under it (`overlapped_words`).

Each is now its own box anchored to the header: the controls box is the action
room past `anchor(right)`, and the notice is a child of `.lf-thread-content` at
`anchor(left) + --lf-thread-news-start`, bounded by `anchor-size(width)`.
`#retainHeaderSlot` writes its readings onto the notice and measures the line's
visible end from the header. A notice inside the controls box could not anchor
to the header, whose box is outside the notice's containing block.

On a seated thread at 1200px the controls box went from 257→956 to 928→956
while Resolve (928→956) and the notice (380→454) kept their places, in Chromium
and Firefox, and `overlapped_words` went from three words to none. The inline
placement test and the held-news seat test assert both, and the chrome axe
sweep now runs the overlap check too; it passed before as well, since the
panel's thread view has no `.lf-thread-controls`, so the TODO sentence saying
it could not is dropped.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
max-sixty and others added 2 commits October 25, 2026 12:28
Takes main's TODO.md, whose backlog moved to GitHub issues in #4090.

Main moved three held-news tests from tests/journeys/test_render_read_state.py to tests/browser/test_render_read_state.py; the merge keeps them there and carries this branch's edits to them: the notice located under .lf-thread-content, and the page-seat case's overlapped_words check.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty marked this pull request as ready for review October 27, 2026 05:15
@leaf-agent
leaf-agent merged commit 39349f5 into main Oct 27, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the grind/s-thread-controls branch October 27, 2026 05:33
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