fix(client): put the settings footer links in the AccessKit tree (UI/UX v3 P4d) - #97
Merged
Conversation
…/UX v3 P4d) Measuring for P4c turned up that neither footer link had ever been in the accessibility tree: `accessibility.rs` did not mention `settings-open-config-file` or `settings-reset-category` anywhere, so a screen-reader user could not open `config.toml` or reset a category at all. The links were reachable by mouse and by nothing else. Both are now `Role::Button` nodes — `SETTINGS_FOOTER_OPEN_ID` (31) and `SETTINGS_FOOTER_RESET_ID` (32), from the id block the hand-written settings fields vacated in P1b/P1c — and children of the panel dialog beside the content group, which is where they sit on screen. Button rather than Link: both perform an action rather than navigate, and "Open config.toml" hands off to the OS editor. - The announced label is the link's text without its `↗` / `↺` glyph. `footer::open_text()` / `reset_text()` are the bare localised strings and the drawn labels are built from them, so a reworded link cannot say one thing on screen and another out loud. - The reset node exists only while `category_resettable()`. Announcing a control the renderer does not draw would be worse than the omission being fixed. The tree hash already covers it: it hashes `category.label()`, and resettability is a function of the category. - `Click` performs the same two actions the mouse arm does, guarded on the panel being open so a stale activation cannot open an editor or reset a category behind the user's back. Also corrects the node-id range table, which still described 28..30 as reserved after P6c took them for the InfoBar slots. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Coverage reportGenerated by |
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.
The defect
Measuring for #96 turned this up:
accessibility.rsdid not mentionsettings-open-config-fileorsettings-reset-categoryanywhere. The settings panel's two footer actions — openconfig.toml, reset the current category — were reachable by mouse and by nothing else. A screen-reader user could not perform either.It was kept out of #96 deliberately: that PR was typography and hit-region geometry, and this is a P6c-shaped accessibility gap.
The fix
Both links become
Role::Buttonnodes —SETTINGS_FOOTER_OPEN_ID(31) andSETTINGS_FOOTER_RESET_ID(32), taken from the id block the hand-written settings fields vacated in P1b/P1c — and children of the panel dialog beside the content group, which is where they sit on screen.Buttonrather thanLink: both perform an action rather than navigate, and "Open config.toml" hands off to the OS editor.Three things the fix pins:
footer::open_text()/reset_text()are the bare localised strings, and the drawn labels areformat!("↗ {}", open_text())— so a reworded link cannot say one thing on screen and another out loud.↗/↺are a visual affordance; reading them aloud before every activation is noise.category_resettable(). The renderer omits the link for the list-based categories (SSH / Keybindings / Profiles), where a reset would delete user data; announcing a control that is not drawn would be a worse defect than the omission being fixed. The tree hash already covers the transition — it hashescategory.label(), and resettability is a function of the category.Clickperforms the same two actions the mouse arm does (platform::open_config_file()/reset_category_to_defaults()+ redraw), guarded on the panel being open so a stale activation cannot open an editor or reset a category behind the user's back.Also corrects the node-id range table, which still described 28..30 as "reserved" after P6c took them for the InfoBar slots.
Verification
cargo fmt --check— cleancargo clippy --workspace --all-targets -- -D warnings— no warningscargo test --workspace— 28 suites pass; 3 new tests (both links present as panel children with aClickaction; no reset node for any of the three non-resettable categories; labels equalfooter::open_text()/reset_text()and carry no glyph) plus decode round-trips for the two new idsStacked on #96 (merged); the diff here is P4d only.
🤖 Generated with Claude Code