Skip to content

Offer page search's arrows as soon as a query matches - #3337

Merged
max-sixty merged 2 commits into
mainfrom
fix-page-search-arrow-availability
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix-page-search-arrow-availability

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The nightly run 39411015460 failed test_a_finger_reaches_the_page_commands_its_keys_reach because page search's Next match arrow was still aria-disabled beside 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's matches. No signal tracks that variable, so scopes.js read 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's fill, could leave both arrows dimmed and aria-disabled while 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 with paintKeysWithin.

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 stills states page-search and page-search-phone).

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

max-sixty and others added 2 commits October 20, 2026 07:27
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]>
@max-sixty
max-sixty merged commit 15a40af into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix-page-search-arrow-availability branch October 20, 2026 14:42
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]>
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