Repository navigation
Sweep the examples nightly for stale keys, and hold the open tab in a signal - #3456
Merged
Merged
Conversation
A new nightly test, `test_presses_and_fills_leave_no_element_naming_stale_keys` in `tests/journeys/test_render_navigation.py`, holds the rule `keyboard/scopes.js` states: a module's own state that a row's `when` reads must be a signal. Before this change nothing enforced it, and #3342 found four rows that read plain variables and left `aria-keyshortcuts` or `aria-disabled` stale. The test runs the probe #3342 used. For each public example and developer page, it makes 40 random presses and fills on visible controls, in an order seeded by the example's name. After each step it waits for the page's readiness and rendering, reads every element's `aria-keyshortcuts` and `aria-disabled`, forces a full key repaint (`paintKeys()`), and reads them again. It fails on any attribute the repaint changed, naming the step, the control pressed and the element. The keys themselves still work when a row is stale, since a press reads the rows afresh, so no other test catches this. It found no stale row on main. To check that it would catch one, I put #3342's diff-filter fix back (`lf-diff.js` asking `:focus-within` directly) and the test failed on `diff-thread-gallery`, naming the diff whose `aria-keyshortcuts` kept or lost `Escape`. The probe's own wait was a fixed 400 ms. The test waits for page readiness instead, which counts each live sample's arrival. Without that wait, a sample's Reset read as stale: `lf-sample` keeps it `aria-disabled` while the child loads, and the child often finished loading between the two readings. The sweep's random presses also met three write-watch findings, which this change fixes so the test passes: - **The merge film** (`examples/wt-merge.page/film.js`) removed every annotation note and drew it again on each paint. The painter dropped unseen parts before `#paintNotes` marked the notes as seen; it now drops them after every layer has painted. The corpus copy is regenerated. - **The playground's Copy button** wrote the same `data-copy-state` again when pressed twice within two seconds. It now writes through `keeps`. - **Sortable** sets a card's `draggable` to false on every release of its grip, whether or not the press became a drag. It is vendored, so `write_watch.js` lists that write in `EXPECTED`. Locally, under load from other sessions, the 28 cases take 250–306 worker-seconds in total (about 4–5 worker-minutes), and 72–78 s of wall time on 4 workers. The slowest are `pr-walkthrough` (27–41 s) and `wt-merge` (27–29 s). It runs one seed; the decision estimated about 6 worker-minutes per seed. This is Max's decision #31 (option C) on the overnight report. > _This was written by Claude Code on behalf of max-sixty_ Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # tests/journeys/test_render_navigation.py
leaf-agent
previously approved these changes
Oct 21, 2026
A new nightly test, `test_presses_and_fills_leave_no_element_naming_stale_keys` in `tests/journeys/test_render_navigation.py`, holds the rule `keyboard/scopes.js` states: a module's own state that a row's `when` reads must be a signal. Before this change nothing enforced it, and #3342 found four rows that read plain variables and left `aria-keyshortcuts` or `aria-disabled` stale. The test runs the probe #3342 used. For each public example and developer page, it makes 40 random presses and fills on visible controls, in an order seeded by the example's name. After each step it waits for the page's readiness, for every send to come back, and for rendering. It then reads every element's `aria-keyshortcuts` and `aria-disabled`, forces a full key repaint (`paintKeys()`), and reads them again. It fails on any attribute the repaint changed, naming the step, the control pressed and the element. The keys themselves still work when a row is stale, since a press reads the rows afresh, so no other test catches this. ## The stale row it found On this PR's first CI run the sweep failed on `code-comparison`. After a press on a closed tab, the tab strip still named Enter and Space. The strip's "open the tab" row read `aria-selected` on the focused tab, which no signal tracks. A person's press focuses the tab on mousedown and opens it on click, a few frames later. So the strip read the focused tab while it was still closed, and nothing told it to read again once the tab opened. `lf-tabs` now holds the open panel in a signal (`#active`), and the row compares the focused tab with the open one. A new browser-tier test, `test_a_pressed_tab_stops_naming_the_key_that_opens_it`, holds the mouse down for a frame before releasing. It fails on the previous `lf-tabs` and passes now. I also put #3342's diff-filter fix back (`lf-diff.js` asking `:focus-within` directly), and the sweep failed on `diff-thread-gallery`, naming the diff whose `aria-keyshortcuts` kept or lost `Escape`. ## Waits instead of the probe's fixed delay The probe waited a fixed 400 ms. Two of its findings were readings taken mid-operation rather than stale rows. A live sample's Reset is `aria-disabled` while its child loads, and the child finished loading between the two readings. A playground's Build query was `aria-disabled` until its send came back. The test waits for page readiness, which counts each sample's arrival, and for `round_trip`, so neither reads as stale. ## Write-watch findings on the sweep's path The random presses also met three findings from the write watch, which this change fixes so the test passes: - **The merge film** (`examples/wt-merge.page/film.js`) removed every annotation note and drew it again on each paint. The painter dropped unseen parts before `#paintNotes` marked the notes as seen; it now drops them after every layer has painted. The corpus copy is regenerated. - **The playground's Copy button** wrote the same `data-copy-state` again when pressed twice within two seconds. It now writes through `keeps`. - **Sortable** sets a card's `draggable` to false on every release of its grip, whether or not the press became a drag. It is vendored, so `write_watch.js` lists that write in `EXPECTED`. ## Cost Locally, under load from other sessions, the 28 cases take 202–306 worker-seconds in total over seven runs (about 3.5–5 worker-minutes), and 70–78 s of wall time on 4 workers. The slowest are `wt-merge` and `pr-walkthrough`, each up to about 40 s. It runs one seed; the decision estimated about 6 worker-minutes per seed. This is Max's decision #31 (option C) on the overnight report. > _This was written by Claude Code on behalf of max-sixty_ Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 21, 2026
# Conflicts: # skills/leaf/packages/default/widgets/lf-tabs.js
leaf-agent
approved these changes
Oct 21, 2026
This was referenced Oct 27, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 28, 2026
Page Map's search reads its shortcut availability from the rendered rows. Refresh its scoped keys after rendering, so filtering away every entry removes ArrowDown and Enter and clearing the query restores them. The phone and desktop regression assertions both fail before the refresh and pass afterward. The sweep introduced in #3456 also compared hidden controls. The reported step activates a Page Map contribution, which closes the native dialog before its deferred close handler refreshes the search field. Restrict the snapshot to visible elements: the sweep still checks the shortcuts a reader can use, including a reopened dialog, without demanding current metadata on a hidden field. No visible layout or styling changes. Validation: four focused browser cases passed (dynamic-widgets sweep, both filtering viewports, and Page Map keyboard navigation), 695 runtime tests passed, and `pnpm run check` passed. The kernel is rebuilt. <details><summary>CI evidence and reproduction limits</summary> The JUnit records from scheduled runs 40492069054 and 40675368197 both report the search field retaining `ArrowDown Enter` after a Page Map contribution closes the dialog; the later run calls the contribution “Open queued.” The action's close path is in `activateSheetControl` in `browser/runtime/page-map-dialog.js`, and the search scope's predicates inspect visible rows. Both the current sweep and the older handle-based input driver passed on current main before this change. An attempt to run the original revision could not start because its pinned Chromium headless shell (build 1243) is absent here. The deterministic before/after reproduction is the open dialog's empty-filter failure; the hidden-field diagnosis rests on the CI diagnostic and the close path, rather than a locally reproduced historical sweep failure. </details> Closes #4474 — automated triage Co-authored-by: leaf-agent <[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.
A new nightly test,
test_presses_and_fills_leave_no_element_naming_stale_keysintests/journeys/test_render_navigation.py, holds the rulekeyboard/scopes.jsstates: a module's own state that a row'swhenreads must be a signal. Before this change nothing enforced it, and #3342 found four rows that read plain variables and leftaria-keyshortcutsoraria-disabledstale.The test runs the probe #3342 used. For each public example and developer page, it makes 40 random presses and fills on visible controls, in an order seeded by the example's name. After each step it waits for the page's readiness, for every send to come back, and for rendering. It then reads every element's
aria-keyshortcutsandaria-disabled, forces a full key repaint (paintKeys()), and reads them again. It fails on any attribute the repaint changed, naming the step, the control pressed and the element. The keys themselves still work when a row is stale, since a press reads the rows afresh, so no other test catches this.The stale row it found
On this PR's first CI run the sweep failed on
code-comparison. After a press on a closed tab, the tab strip still named Enter and Space. The strip's "open the tab" row readaria-selectedon the focused tab, which no signal tracks. A person's press focuses the tab on mousedown and opens it on click, a few frames later. So the strip read the focused tab while it was still closed, and nothing told it to read again once the tab opened.lf-tabsnow holds the open panel in a signal (#active), and the row compares the focused tab with the open one. A new browser-tier test,test_a_pressed_tab_stops_naming_the_key_that_opens_it, holds the mouse down for a frame before releasing. It fails on the previouslf-tabsand passes now.I also put #3342's diff-filter fix back (
lf-diff.jsasking:focus-withindirectly), and the sweep failed ondiff-thread-gallery, naming the diff whosearia-keyshortcutskept or lostEscape.Waits instead of the probe's fixed delay
The probe waited a fixed 400 ms. Two of its findings were readings taken mid-operation rather than stale rows. A live sample's Reset is
aria-disabledwhile its child loads, and the child finished loading between the two readings. A playground's Build query wasaria-disableduntil its send came back. The test waits for page readiness, which counts each sample's arrival, and forround_trip, so neither reads as stale.Write-watch findings on the sweep's path
The random presses also met three findings from the write watch, which this change fixes so the test passes:
examples/wt-merge.page/film.js) removed every annotation note and drew it again on each paint. The painter dropped unseen parts before#paintNotesmarked the notes as seen; it now drops them after every layer has painted. The corpus copy is regenerated.data-copy-stateagain when pressed twice within two seconds. It now writes throughkeeps.draggableto false on every release of its grip, whether or not the press became a drag. It is vendored, sowrite_watch.jslists that write inEXPECTED.Cost
Locally, under load from other sessions, the 28 cases take 202–306 worker-seconds in total over eight runs (about 3.5–5 worker-minutes), and 66–78 s of wall time on 4 workers. The slowest are
wt-mergeandpr-walkthrough, each up to about 40 s. On this PR's CI run, the 23 cases among the job's 25 slowest tests took 510 worker-seconds,file-treethe longest at 85 s, so the sweep costs about 9 worker-minutes there. It runs one seed; the decision estimated about 6 worker-minutes per seed.This is Max's decision #31 (option C) on the overnight report.