Repository navigation
fix: write a margin card's transcript-focus mark once per script, as focus paint does - #5923
Merged
Merged
Conversation
#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
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.
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.jswritesdata-lf-transcript-focusfrom theonCurrentLocationreader. 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, andtests/write_watch.jsreports that as an unchanged write. The old rule read focus paint, whichfocus.jsdeliberately applies only after the script ends, once focus has reached its final place. The reader now records the location and writes the mark once throughafterScript, 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_threadchecked 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
ciruns, 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:browserand 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_boxtests/browser/threads/test_rewrites.py::test_a_cards_message_controls_cover_its_headtests/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_paneltests/browser/margin/test_card_reply.py::test_a_margin_card_is_one_frame_that_rings_for_its_threadCloses #5919 — automated triage