Skip to content

Let accessibility press and name every button in the window - #18

Merged
sanjaydotpro merged 2 commits into
mainfrom
a11y/button-press
Nov 17, 2026
Merged

sanjaydotpro merged 2 commits into
mainfrom
a11y/button-press

Conversation

@sanjaydotpro

Copy link
Copy Markdown
Contributor

Fixes HIS-21. On macOS, VoiceOver, Voice Control and AXPress press a control through its semantics tap action and read its name from its semantics label. Several of the window's controls were missing one or the other.

What was wrong

  • Icon buttons (CompactIconButton). These are Show/Hide notes, Pin, More, the insert bar, Back to all notes and the drawing dock. Each one came out as two nodes: the outer node carried the tooltip and no action, and the inner one could be pressed but had no name. This gap dates from the old UI (2 Sep), not from the redesign.
  • Names on macOS. macOS doesn't expose a Flutter tooltip as a name, so every button named only by its tooltip reached VoiceOver as "button". That covers the icon buttons, the icon-only tonal New note, the drawing's colour swatches and its Colour and size button.
  • Missing press actions. The redesign's media filter, the List and Cards switch, and See all excluded their children's semantics without giving back a tap action, so nothing could press them. See all was also merged into the Pinned heading rather than being its own element.
  • Fine already: rail items, labelled tonal buttons and keycaps. Keycaps stay out of the tree and are read with their button.

Fix

  • Icon buttons: CompactIconButton merges into one node that carries the press, the tooltip and, on desktop, a label taken from the tooltip.
  • Icon-only tonal button and the colour controls: these get the same desktop label. iOS and Android keep reading the tooltip as before, so nothing is read twice there.
  • Media filter, List/Cards and See all: each now has its own tap action, and See all is its own node.

Tests

test/button_press_test.dart presses each control the way an assistive technology does, through the semantics tap and with no pointer. It covers a rail item, a tonal button, a keycap (read with its button and never on its own), the icon buttons, the list controls and See all.

The file also walks the whole window in several states and fails on any enabled button that can't be pressed, or any pressable element with no name. The states are: list open, list hidden, More open, media filter open, a drawing with the colour popover open, the archive, and Settings. The tests fail on main and pass here.

Checked on macOS

I ran a sync-off profile build of this branch as com.kapybara.kapynotes.kapy12, built with KAPYNOTES_SYNC=false and its own keychain. Its container had no sync.v1 or billing.v1, and the launch didn't take focus or register a login item; those were local, uncommitted changes for the check only. I drove it with the AX API.

  • AXPress on the Drawings rail item switched the space: the toolbar's section read "Drawings", and "My notes" after pressing Notes.
  • AXPress on New note took the store from 1 note to 2.
  • Every button in the AX tree now has a title. Before the fix, every icon button had an empty one.

That check ran before main (#17) was merged in. Merging main doesn't touch the rail item or New note, and the Drawings controls #17 brought in are covered by the widget tests above.

Flutter's macOS embedder doesn't publish the semantics tree until a client asks for the enhanced interface (AXEnhancedUserInterface). VoiceOver does that, but a plain AppleScript UI query doesn't. That's why the preview capture found no buttons to press.

flutter analyze is clean, and the full suite passes locally (2145 passed, 8 skipped) on Flutter 3.47.4 with pub get --enforce-lockfile, because the 3.47.2 install on this Mac is damaged. No goldens moved.

Open in Capy

@sanjaydotpro
sanjaydotpro merged commit 0129ae0 into main Nov 17, 2026
4 checks passed
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