Skip to content

fix: write a margin card's transcript-focus mark once per script, as focus paint does - #5923

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5919
Nov 13, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Four thread tests fail on main's write watch since #5868, and a fifth fails on a stale rule assertion. This fixes both.

Unchanged write of data-lf-transcript-focus. #5868 removed the :has() that lifted a margin card's transcript fade (.lf-page-thread:has(> .lf-thread-transcript[data-lf-focus-within])::after). In its place, thread-preview.js writes data-lf-transcript-focus from the onCurrentLocation reader. That reader runs synchronously on every arrival, including intermediate ones. So when one script moved focus out of the transcript and back, the mark came off and went back on, and tests/write_watch.js reports that as an unchanged write. The old rule read focus paint, which focus.js deliberately applies only after the script ends, once focus has reached its final place. The reader now records the location and writes the mark once through afterScript, so it changes only when the script's final location does. #5868's intent, no :has() reading where focus is, still holds.

Margin card ring assertion. test_a_margin_card_is_one_frame_that_rings_for_its_thread checked that the card's ring rule names .lf-page-thread. Since #5868 the focused thread names the card as its --lf-focus-box, and the card rings through .lf-margin-preview-card[data-lf-control-focus-visible]. The assertion now checks that rule. What it protects is unchanged: the card is the only element wearing a ring.

Verification: all five fail in main's ci runs, and I reproduced the four write-watch failures locally on the base. With this change all five pass locally, run by node id. pnpm run test:runtime (965 pass), pnpm run check:browser and pre-commit over the changed files also pass.

  • tests/browser/threads/test_rewrites.py::test_a_rewrite_of_a_comment_just_sent_is_the_reply_box
  • tests/browser/threads/test_rewrites.py::test_a_cards_message_controls_cover_its_head
  • tests/browser/threads/test_rewrites.py::test_a_rewrite_is_the_reply_box_where_the_words_stood[card]
  • tests/browser/test_render_floating_panel.py::test_a_thread_s_messages_read_alike_in_its_card_and_the_panel
  • tests/browser/margin/test_card_reply.py::test_a_margin_card_is_one_frame_that_rings_for_its_thread

Closes #5919 — automated triage

#5868 moved the transcript fade's lift from a `:has()` over the
transcript's `data-lf-focus-within` to `data-lf-transcript-focus`,
written from the synchronous location reader. That reader hears every
arrival, so a script that moves focus out of the transcript and back
took the mark off and put it back, which the write watch fails as an
unchanged write. The mark now follows where the script leaves the user,
as focus paint does, so it changes only when the final location does.

The margin card's ring test asserted the ring rule names
`.lf-page-thread`; since #5868 the thread names the card as its
`--lf-focus-box`, so the card rings through
`[data-lf-control-focus-visible]`. The assertion now reads that rule;
the behavior it protects (the card, alone, wears the ring) is unchanged.

Closes #5919
@leaf-agent
leaf-agent merged commit f32ace4 into main Nov 13, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5919 branch November 13, 2026 08:32
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.

Rewrite and panel tests report an unchanged write of data-lf-transcript-focus since e5559a2b6

1 participant