Repository navigation
fix: name each command reference row by the words it shows - #7491
Merged
Merged
Conversation
The command reference named each option by its title alone (aria-labelledby) and put its keys and description in its accessible description. axe-core 4.14 runs label-content-name-mismatch (WCAG 2.5.3, Label in Name) by default, and every row failed it, since the row shows key chips and a description outside its name. Each row now takes its name from its content: the title, the spoken keys and the description, the same words a screen reader heard before, now all in the name. Naming a row by its title and spoken key label alone still fails the rule, because a chip shows glyphs its spoken label doesn't contain. Tests that located a row by its exact title now match the title at the start of the name; the disabled-option test checks the whole name. Refs #7393
This was referenced Nov 28, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 28, 2026
…by a name that starts with their title (#7519) `test_slash_finds_page_text_without_a_target_kind` has failed on main since #7491 (`e12a31745`). That change made each command reference row take its accessible name from every word it shows (title, keys and description) so the rows pass axe-core's Label in Name rule, and the Search page row is now named `Search page /`. The test still expected the bare title, and #7491 updated the other tests that read row names but missed this one. The test now matches a name that starts with the title, `^Search page\b` and `^Select mode\b`, as #7491 did for the rows it renamed. It still checks the key (`/`, `s`) and the missing description separately. No product behavior changes. Verification: on current main (`afb9b9df1`) the test fails with `unexpected value "Search page /"`. With this change it passes (`uv run pytest tests/browser/test_render_semantic_selection.py::test_slash_finds_page_text_without_a_target_kind -n0`). Refs #7518 — 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.
Each row of the command reference (
?) now takes its accessible name from its own content, sotest_the_chrome_a_key_opens_has_no_serious_violationspasses again. Before, a row was named by its title alone (aria-labelledby), with its keys and description in its accessible description. axe-core 4.14, which #7289 brought in, runslabel-content-name-mismatch(WCAG 2.5.3, Label in Name) by default, and every row failed it, since the row shows key chips and a description that its name left out. A screen reader hears the same words as before, title then keys then description, but they are now all in the name. A voice-control user can say any of the words the row shows to reach it. The change also removes the row's id plumbing (keyId,descriptionId, the title id) and the description list that went with it.I tried one alternative: name = title plus the chips' spoken label, with the description kept as the description. It still fails the rule, because a chip shows glyphs (⌘, arrows) that its spoken label doesn't contain.
Tests changed. Tests that found a row by its exact title (Unwrap/Wrap lines, Copy code, Copy link to section, Comment on the control) now match a name that starts with that title. The disabled-option test (
test_an_option_that_runs_from_nowhere_still_says_its_keys_and_why) now checks that the whole name carries the keys and description, and no longer checks the description.Verification. The axe sweep failed on
main(cd2495ac7) at both[420-dark]and[1200-light], and both pass with this change.tests/browser/navigation/test_command_reference.py, the changed tests intest_focus.py,test_key_scopes.py(inner/outer scope),test_render_code_reading.pyandtest_render_heading_links.pypass, and so doespnpm run check.What this leaves of #7393. The
file-treeandfile-tree-inputrender-gate failures still reproduce onmain.@pierre/trees1.0.0 names each row by its path (getFileTreeRowAriaLabel) and draws the git-status letter (M, A) next to it, outside the name. That one needs either an upstream change or a different way of showing status inlf-file-tree.js.Part of #7393 — automated triage