Skip to content

fix: name each command reference row by the words it shows - #7491

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7393-command-reference-names
Nov 28, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7393-command-reference-names

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Each row of the command reference (?) now takes its accessible name from its own content, so test_the_chrome_a_key_opens_has_no_serious_violations passes 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, 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 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 in test_focus.py, test_key_scopes.py (inner/outer scope), test_render_code_reading.py and test_render_heading_links.py pass, and so does pnpm run check.

What this leaves of #7393. The file-tree and file-tree-input render-gate failures still reproduce on main. @pierre/trees 1.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 in lf-file-tree.js.

Part of #7393 — automated triage

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
@leaf-agent
leaf-agent merged commit e12a317 into main Nov 28, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7393-command-reference-names branch November 28, 2026 07:05
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]>
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