Repository navigation
Offer page search's arrows as soon as a query matches - #3337
Merged
Merged
Conversation
Page search's Previous and Next match arrows (#3251) take their availability from the walk row's `when`, which reads `matches`. That is the target picker's own variable, which no signal tracks, so scopes.js read the arrows again only when some unrelated pass happened to mark every button. A query that arrived with no key press, such as a paste, a phone's suggestion or Playwright's `fill`, could leave both arrows `aria-disabled` and dimmed beside a "1 of 3" count. A press still worked, since the click handler reads availability live. Playwright refuses to tap an aria-disabled button, which is how the nightly `test_a_finger_reaches_the_page_commands_its_keys_reach` failed at 320px. The arrows' size, place and hit-testing were already correct at 320, 360 and 390px. `presentSearchStatus`, which paints the count whenever the matches change, now also marks the search box's buttons with `paintKeysWithin`, as other writers of untracked state do. The floating-panel search test now fills its first query instead of typing it and expects the arrows offered. It also aims the press on the match at the words rather than at the mark: the mark moves to them a frame after the count changes, and reading it in between pressed the previous match's place, which failed the test about half the time locally. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
…nts them (#3342) Key and button availability are tracked effects (`keyboard/scopes.js`): each reflection re-reads a row when a publication part or a signal it read moves. A row whose `when` reads a plain module variable is read once and then left as it was until something else marks it. #3337 met one such row: page search's arrows stayed `aria-disabled` beside "1 of 3" after a filled query, and it marked the search box's buttons by hand (`paintKeysWithin`) each time the count painted. An audit of the rows wired to buttons, plus a probe that compares each element's painted `aria-disabled` and `aria-keyshortcuts` with a forced full reflection after random presses and fills on the shipped examples, found three more owners: - The floating panel's open views (`trail`), whether its menu is open, and the list standing in the menu were plain variables. Opening Threads or On me by pointer left the field without its Escape and the Threads view without its `/` in `aria-keyshortcuts`, and putting a view away left them behind. - The comment box's anchor (`fabAnchor` in `composing/surface.js`) was one too. Taking the box down by pointer, as a press on a file's comment button does from a diff line, left its hidden input naming Tab for its other responses. - The diff filter's Escape (`diff.search.back` in `lf-diff.js`) asked `:focus-within` directly rather than through `standingIn`, so its reading never followed where the user stands. A press outside a filtered diff left the diff naming Escape. All four owners now read that state through signals, and page search no longer marks its buttons by hand. `scopes.js` states the rule: a module's own state that a row reads is a signal, and only document state is marked by its writer. The floating-panel Escape test now opens Threads by pointer and expects the field and view to name their keys, and the field to drop Escape once the view is put away. It fails on the previous panel. > _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.
The nightly run 39411015460 failed
test_a_finger_reaches_the_page_commands_its_keys_reachbecause page search's Next match arrow was stillaria-disabledbeside a "1 of 3" count, so Playwright refused to tap it. The arrows' size, place and hit-testing are correct at 320, 360 and 390px; only their availability was stale.The arrows (#3251) take their availability from the walk row's
when, which reads the target picker'smatches. No signal tracks that variable, soscopes.jsread the arrows again only when an unrelated pass happened to mark every button. A query that arrives with no key press, such as a paste, a phone's suggestion or Playwright'sfill, could leave both arrows dimmed andaria-disabledwhile they matched. A press still worked, because the click handler reads availability live.presentSearchStatus, which paints the count whenever the matches change, now also marks the search box's buttons withpaintKeysWithin.The floating-panel search test now fills its first query and expects the arrows offered. It also aims its press at the match's words instead of the mark, which moves to them a frame after the count changes; reading the mark in between failed the test about half the time locally.
Visible change: after a pasted or filled query, the arrows show at full strength instead of dimmed (
leaf-dev stillsstatespage-searchandpage-search-phone).