Skip to content

test: walk the command reference's Tab loop to its Close button before Escape - #5791

Merged
leaf-agent merged 1 commit into
mainfrom
fix/keyboard-reference-escape
Nov 10, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/keyboard-reference-escape

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_the_keyboard_reference_is_a_modal_tab_loop_and_returns_to_its_door has failed on every push run on main since #5746, starting with 42618688222. It fails with Locator expected to be hidden after the Escape.

The test pressed Tab a fixed number of times, the stop count plus two, then pressed Escape once. #5746 added K (preview.show), so the reference gained one row and one stop. That shifted where the fixed walk ends: on the commit before #5746 it ended on the page body, which has no preview, and now it ends on the Close button. Tab reads Close's preview, and under #5746's rule a standing preview takes the first Escape (browser/runtime/keyboard/AGENTS.md, "Escape"). So the reference stayed open. A probe confirmed that a second Escape closes it and returns focus to the door.

The test now walks until Tab comes back to Close a second time. That still proves the loop wraps inside the dialog, and the walk ends at the same stop however many command rows there are. Before the Escape under test, it puts the preview away with put_preview_away, which fails unless a preview was showing. The product is unchanged, and both #5746's intent and the behavior the test protects still hold. The test fails on main at d2fb80d4c and passes with this change.

Refs #3985 — automated triage

…e Escape

The modal Tab-loop test pressed Tab a fixed number of times (the stop count
plus two) and expected one Escape to close the reference. #5746 added the K
command, one more row and stop, so the walk now ends on Close instead of the
page body. Tab reads Close's preview, and a standing preview takes the first
Escape (keyboard/AGENTS.md, "Escape"), so the reference stayed open.

The walk now stops when Tab has come round to Close a second time, which still
proves the loop wraps inside the dialog, and puts the preview away before the
Escape under test. The protected behavior is unchanged: Tab stays inside the
modal reference, and Escape closes it and returns focus to its door.

Refs #3985
@leaf-agent
leaf-agent merged commit e0bbfcd into main Nov 10, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/keyboard-reference-escape branch November 10, 2026 08:46
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.

1 participant