Skip to content

fix(a11y): name icon-only buttons that only had a tooltip - #1895

Merged
l0gicgate merged 2 commits into
lgse:mainfrom
pdwaldrop:fix/1860-name-icon-only-buttons
Oct 25, 2026
Merged

l0gicgate merged 2 commits into
lgse:mainfrom
pdwaldrop:fix/1860-name-icon-only-buttons

Conversation

@pdwaldrop

Copy link
Copy Markdown
Contributor

Description

#1860 lists icon-only buttons that only get a name from their tooltip. A tooltip is not an accessible name, so a screen reader announced these as unnamed buttons. The new accessibility::set_tooltip_and_label sets the tooltip and the accessible name together, and it is applied to every such button I found:

  • the path bar's copy button, which also changes between "Copy path" and "Path copied" and now keeps its name in step
  • Back, Forward and Parent folder in List and Icons, and the List view's Columns menu button
  • the folder color swatches in Customize (default and custom), and its Back to palette button
  • the install command copy button (also changing), the media Play/Pause and Mute buttons, the archive preview's up button, the chooser's cancel button, the theme search clear button, and the sidebar eject and lock buttons

I found them by walking the widget tree in Columns, List and Icons, the location editor, Customize and Settings, and by listing every tooltip_text call that had no name next to it. The media, archive, chooser and sidebar buttons need states I could not reach in the test window, so those are covered by reading the code only. The inner buttons of a SpinButton stay unnamed; they belong to GTK.

This is the buttons half of the accessible names item. The unnamed text fields and sliders from the same list are a separate change.

Visual evidence

N/A: no visual change.

How to test

  1. Open the widget tree (./scripts/qa-drive.sh send '{"query":"tree"}'), or a screen reader, in List or Icons view.
  2. Look at the buttons left of the folder name and the one at the end of the path.

Expected result: they are named Back (Alt+←), Forward (Alt+→), Parent folder (Alt+↑) and Copy path. Before this change they had no name.

Covered by the QA scenario icon-only-buttons-named, which fails in every mode on the old code. The other accessibility scenarios and the affected Rust suites pass.

Related issue

Part of #1860

A tooltip is not an accessible name, so the path bar's copy button, the
Back, Forward and Parent folder buttons, the List view's Columns menu,
the folder color swatches, the install command copy button, the media play
and mute buttons, the archive preview's up button, the chooser's cancel
button, the theme search clear button and the sidebar eject and lock
buttons were announced without one. Name each after its tooltip through a
shared helper that also keeps the name in step when the tooltip changes.
update_active already names the custom color swatch when the bar is built.
@l0gicgate

Copy link
Copy Markdown
Contributor

Review and cleanup

Merged main: the branch already sat on acb3a32f7 (current main), so the merge was a no-op.

Review against the description and #1860. The claims hold up. Every button listed now sets its tooltip and accessible name through accessibility::set_tooltip_and_label. The two copy buttons (path bar and install command) keep the name in step with the tooltip when it changes and when it resets. I checked every other tooltip_text call in production code. Each remaining icon-only button already gets a name from elsewhere:

  • describe_location_controls names the location confirm and cancel buttons.
  • bind_maximize_icon names Maximize.
  • label_control names "More icons".
  • The other buttons call set_label right after the tooltip.

So the buttons half of the #1860 item is complete. The fields and sliders half stays open, as the description says. There were no earlier review comments to reconcile.

Fixes pushed

  • d4610ba34 refactor(a11y): leave the custom swatch to its existing name refresh. The custom_btn change in build_folder_color_bar didn't change anything: update_active(initial_color) already sets the swatch's tooltip and name ("Custom color…" or "Custom (#hex)") when the bar is built, so the original line is back. The scenario's Custom color… assertion stays as a guard, but it was not one of the assertions that failed on the old code.

Tests: kept icon-only-buttons-named. Each of its assertions checks a recorded accessible name, and the QA accessible_name never falls back to the tooltip, so the scenario can fail.

Comments: the one new doc comment, on set_tooltip_and_label, gives the reason the helper exists. It stays.

Validation

  • ./scripts/qa.sh icon-only-buttons-named toolbar-controls-named customize-takes-focus-single-escape: 6 runs passed.
  • ./scripts/test-headless.py ui::controls::tests: 8 tests passed.
  • ./scripts/quality.sh fmt and ./scripts/quality.sh clippy: clean.
  • Not run: the full Rust and QA suites. The change only sets accessible names on individual buttons, and CI runs the full Rust suite.

Follow-ups outside this PR

  • About a dozen older sites still pair set_tooltip_text with set_label by hand, for example in progress_dock.rs, chooser/download.rs, preview/find.rs and the customization.rs icon grid. They could switch to the new helper later.

CI: all required checks green on d4610ba34. The QA scenarios job was skipped by CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants