Skip to content

fix(icons): stop VoiceOver reading asset names of the remaining icons - #91

Merged
romchornyi merged 3 commits into
dashpay:masterfrom
romchornyi-pitcrew:fix/custom-icon-labels
Dec 4, 2026
Merged

romchornyi merged 3 commits into
dashpay:masterfrom
romchornyi-pitcrew:fix/custom-icon-labels

Conversation

@romchornyi-pitcrew

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Part of #38.

A measurement on master (a throwaway app with an XCUITest target dumping the accessibility tree) showed what VoiceOver still read by an asset's file name:

Component Read before
DashAmount (and every amount in TransactionView, balances, confirmations) "1,5", then "icon_dash_currency"
TransactionView.secondaryIcon "transaction-error"
MenuItemInfo.icon "menu-masternode-keys"
SuccessIllustration / ErrorIllustration "checkmark" / "illustration-xmark"
NavigationBarElement.icon / NavigationBarCircleIcon on their own "navigationbar-back" / the asset name

What was done?

Rule: an icon that only decorates is hidden; one that can carry meaning is named by the host, and hidden until it is.

  • DashAmount is one element whose label is the figure and its currency: "1,5 Dash", "-1,5 Dash".
  • SuccessIllustration and ErrorIllustration are hidden: the screen's title says what happened.
  • The glyph of NavigationBarCircleIcon and of NavigationBarElement.icon is hidden: the button around it (NavigationBarElement.button, NavigationBarCircleButton) carries the label.
  • TransactionView.secondaryIconAccessibilityLabel(_:) and MenuItem.infoAccessibilityLabel(_:) name the badge and the info icon; without a name they are hidden. Both are additive modifiers, so no signature changes.
  • docs/foundation.md describes what is hidden, what the host names, and what is still read.

Image(dash:) itself is unchanged.

For the release notes: VoiceOver no longer reads asset names for these icons; a host that shows a secondaryIcon or an info icon with meaning should pass a label.

How Has This Been Tested?

  • The same XCUITest dump on this branch: amounts read "1,5 Dash" / "-1,5 Dash", the illustrations and bare bar icons are gone from the tree, an unnamed badge and info icon are hidden, and named ones read "Failed" / "Has keys".
  • Whole suite, iPhone 17 simulator, iOS 26.5; conventions.sh.
  • Not covered here, left for a decision: TransactionView reads the amount before the title, in screen order.

Before / After

  • No visual change (refactor, tests, docs). Say why in "What was done?".

Only accessibility changes; nothing is drawn differently.

Breaking Changes

None in the API. What VoiceOver reads changes, as listed above.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

🤖 Generated with Claude Code

DashAmount reads as one element, the figure and its currency. The success and error illustrations and the bare navigation bar glyphs are hidden. TransactionView's secondary icon and MenuItem's info icon are hidden until the host names them with secondaryIconAccessibilityLabel(_:) / infoAccessibilityLabel(_:). Part of dashpay#38.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@romchornyi romchornyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No blockers, no major · 2 gaps · 1 host-side consequence · 1 nit — reviewed at b2f194d363

Level Verdict
1 · Idea ✅ valid #38: VoiceOver read asset file names ("icon_dash_currency", "transaction-error").
2 · Architecture ✅ right layer "Decoration is hidden, meaning is named by the host" lives in the components.
3 · Completeness 🟡 gaps Below.
4 · Code ✅ clean CI green.

Gaps

  1. infoAccessibilityLabel(_:) does nothing for info: .round — MenuItem.swift#L154 — only the .icon case applies the label, while the doc promises it for "an info icon". A host that names a round info icon loses the label silently; dashwallet-ios uses .round (its settings rows). Apply it to .round too, or narrow the doc and the API to .icon.
  2. The public icon views are now always silent — NavigationBarCircleIcon.swift#L52, NavigationBar.swift#L161 — a host Button built from NavigationBarCircleIcon or NavigationBarElement.icon without its own .accessibilityLabel now reads only "Button"; before, it read the SF Symbol's name or at least the asset's. Hide the glyph inside the library's own button and menu, or say in the docs that the host must label such a button. (No such use in dashwallet-ios today.)

For the host app — every TransactionView.secondaryIcon goes silent until the app adds secondaryIconAccessibilityLabel(_:): the swap error badge (read as "transaction-error" before) and the SF Symbol direction badges (read as "Down Arrow" before). Ship an app change with this release, or keep .system badges readable by default.

1 nit
  • " Dash" is spoken but not in the string table — DashAmount.swift#L118 — CLAUDE.md asks for NSLocalizedString(_, bundle: .module, comment:) for user-facing strings; a "%@ Dash" format would let a locale reorder it, brand name or not.
Review details

Levels 1–3 inline, including the host app's call sites and its Maestro flows (they look up the bar buttons by "Back" / "Close" or by id, which this PR does not change); level 4 /code-review high. A concern that NavigationBarCircleMenu becomes unreachable with all of its label hidden was dropped: the Menu carries its own .accessibilityLabel. Not checked with VoiceOver on a device.

🤖 Reviewed with Claude Code

- infoAccessibilityLabel(_:) now names MenuItem's .round info mark too, not only .icon.
- The glyph is hidden inside the library's own bar button, circle button and menu, which carry the label; NavigationBarElement.icon and NavigationBarCircleIcon on their own stay readable for host buttons built from them.
- DashAmount's spoken amount goes through a localizable "%@ Dash" format.
- Previews for a labeled badge and labeled info marks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@romchornyi-pitcrew

Copy link
Copy Markdown
Contributor Author

Addressed in ece52eb:

  • infoAccessibilityLabel(_:) and .round — the label now applies to the info mark whatever its kind: .round and .icon are one element, labeled when the host names it and hidden otherwise. Measured: a labeled .round reads "Estimated".
  • Public bar icons — the glyph is no longer hidden inside NavigationBarCircleIcon / NavigationBarElement.icon; it is hidden inside the library's own NavigationBarElement.button, NavigationBarCircleButton and NavigationBarCircleMenu, which carry the label. A host button built from the bare views reads as before. docs/foundation.md says so.
  • Host app — the companion is fix(a11y): name the error badge of a failed swap for VoiceOver dashwallet-ios#1575 (draft until this ships): it names the swap error badge "Failed", the only badge that is the sole sign of its state. The direction and route badges repeat the amount's sign or the details line, so they stay silent on purpose.
  • Nit — the spoken amount now goes through NSLocalizedString("%@ Dash", bundle: .module, …).

Also added previews for a labeled badge and labeled info marks. Unit tests and conventions.sh pass.

@romchornyi romchornyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gaps closed · no blockers, no major · 1 non-blocking recommendation — re-reviewed at ece52eb017

Level Verdict
1 · Idea ✅ valid Unchanged.
2 · Architecture ✅ right layer Unchanged.
3 · Completeness ✅ complete Both gaps closed.
4 · Code ✅ clean CI green.

Closed since the last review

  • infoAccessibilityLabel(_:) names the .round mark too: both cases share one Group with one label, hidden while unnamed.
  • NavigationBarElement.icon and NavigationBarCircleIcon on their own stay readable; the glyph is hidden only inside the library's bar button, circle button and menu, which carry the label. docs/foundation.md says a host button built from them labels itself.
  • DashAmount speaks through a localizable "%@ Dash" format.

For the host app (unchanged) — every TransactionView.secondaryIcon stays silent until the app adds secondaryIconAccessibilityLabel(_:) (the swap error badge, the direction badges). Ship that app change with this release.

1 non-blocking recommendation
  1. No test pins what VoiceOver reads — the XCUITest dump in the description is not in the repo. A unit test on DashAmount's spoken text ("-1.5 Dash") and on an unnamed badge / info mark staying hidden would keep this from regressing.
Review details

Re-review of the one commit since b2f194d363: each earlier point checked at this head by reading. Not checked with VoiceOver on a device.

🤖 Reviewed with Claude Code

The spoken amount with its sign and currency, and the badge and info labels whose absence keeps the icon hidden.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@romchornyi-pitcrew

Copy link
Copy Markdown
Contributor Author

On the recommendation, in 5d4574b: VoiceOverLabelTests pins the spoken amount ("-1.5 Dash", "+1.5 Dash", no sign with .none) and that a badge and both info marks carry no label until the host names them, which is what keeps them hidden. A unit test cannot read SwiftUI's accessibility tree (a hosted view walked without the accessibility runtime yields nothing), so these check the values the views read it from, as ToastAccessibilityTests does. Checked that the amount test fails without the currency.

@romchornyi romchornyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Recommendation closed · nothing open — re-reviewed at 5d4574b7ea

Closed since the last review

  • VoiceOverLabelTests pins the spoken amount with its sign and currency (-, + with .always, none with .none), and that the badge and both info marks carry no label until the host names one, which is what keeps them hidden. It checks the values the views build the tree from, as ToastAccessibilityTests does. The only library change is DashAmount.accessibilityText going from private to internal; the public API is unchanged.

The host-side note from the last review still applies: dashwallet-ios should label its secondaryIcon badges in the release that picks this up.

🤖 Reviewed with Claude Code

@romchornyi
romchornyi merged commit cc279ce into dashpay:master Dec 4, 2026
9 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.

2 participants