Skip to content

test: set the Tab preview stand-in before the runtime reads focus - #6190

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6179
Nov 16, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_walk_s_landing_previews_nothing_and_tab_reads_it gives every element focus reaches a stand-in preview ("Placed here") from a focusin listener on document. The runtime's own document focusin capture listener (focus.js, registered at module load) runs first. preview.js reads the focused element in a microtask between the two listeners, so the Add reaction button that Tab reaches previewed its own name. The Tab stop is the same before and after #6097. The test used to pass only because a later redraw re-read the standing preview once the head's relative age ticked over, about 40 s into the 120 s expect. Since #6097 the head shows a clock time, which doesn't redraw within the minute, so the expectation timed out.

The stand-in now installs on window's capture, which runs before any document listener, so the runtime reads it the moment focus arrives. The test's intent is unchanged. Its landing assertions are now stronger, since the stand-in is already in place when m lands, so a landing preview would actually show.

Verified locally with --run-nightly:

Closes #6179 — automated triage

The walk-landing journey gives every focused element a stand-in preview
from a focusin listener on the document. focus.js registered its own
document focusin capture listener first, and preview.js reads the element
in a microtask between the two, so the Add reaction button Tab reaches
previewed its own name. The test passed only because a later redraw re-read
the preview: the head's relative age ticked over within the expect's
timeout. Since #6097 the head says a clock time, which doesn't redraw
within the minute, so the expectation timed out. The stand-in now
installs on the window's capture, which runs before any document listener.
No behavior changed; the landing assertions now see the stand-in too.

Closes #6179
@leaf-agent
leaf-agent merged commit 5e0fbe3 into main Nov 16, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6179 branch November 16, 2026 17:28
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.

test_a_walk_s_landing_previews_nothing_and_tab_reads_it: Tab from m's landing reaches Add reaction since #6097

1 participant