Repository navigation
fix: hide the toast icon from VoiceOver - #39
Conversation
The toast, nav bar and converter badge drew their icons from string names that conventions.sh could not see; they now use DashIcon cases. NavigationBarElement keeps its public raw values and draws through DashIcon.NavigationBar; a test keeps the two in step. conventions.sh flags a package-bundle lookup whose name is not one literal (outside the Icon_DashUI / Color+DashUI resolvers), a computed name in the host bundle, an empty name and a computed dashAsset() name. A unit test checks that every DashIcon case resolves in the package bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y are
Follow-up to the review of this PR:
- each call's literal names are read once, so a ternary in the host
bundle or a repeated missing name is reported once;
- a .custom(…) that passes a bundle is a lookup wherever it sits, and a
computed name in .main / nil / .none is reported;
- an empty name also gets its bundle checked;
- negative needles ("!text") are checked in pass cases too;
- CLAUDE.md, docs/foundation.md and the script header say what the scan
does and does not follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VoiceOver read the icon by its asset name ("toast-warning, image") before
the message. The icon is now hidden, and a new init takes an
accessibilityLabel that VoiceOver reads instead of the message, for hosts
that want the style spoken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and apply the Toast accessibility label Sources/DashUIKit/Components/Toast.swift, docs/feedback.md, README.md |
Toast stores and applies a custom accessibility label, and hides its leading icon from accessibility. The existing initializer defaults the label to the message. The preview and documentation describe custom labels and host responsibilities. The README adds noInternet to the Toast catalog. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- dashpay/DashUIKit#38 — The issue identifies the Toast icon accessibility behavior addressed by this change; its other listed components are not changed.
Possibly related PRs
- dashpay/DashUIKit#36 — It changes the Toast icon implementation and adds the
.noInternetstyle, which this PR documents and updates for accessibility.
Suggested reviewers: jeanpierreroma
Merge Risk: 
Minimal · up to cb295
-
No actionable merge-blocking issue is established for the toast accessibility changes. The PR appears mergeable subject to normal checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
romchornyi-pitcrew
left a comment
There was a problem hiding this comment.
✅ no blockers · no majors · 6 non-blocking recommendations — reviewed at 54f6fd6dc6
| Level | Verdict | |
|---|---|---|
| 1 · Idea | 🟡 interim fix | Real defect (VoiceOver reads "toast-warning, image"). The root cause is shared: Image(dash:) / DashIcon.*.image build .custom icons with Image(name, bundle:), so the asset name becomes the label. This PR fixes Toast only; #38 tracks the shared fix |
| 2 · Architecture | ✅ right layer | The component owns its accessibility. The opt-in Text label matches NavigationBarCircleButton / NavigationBarCircleMenu |
| 3 · Completeness | 🟡 gaps partly tracked | #38 exists but leaves out several components that draw icons the same way (list below) |
| 4 · Code | ✅ clean | Text(message) with a String is verbatim, so the default label is unchanged. The hidden wrapper also covers the .loading spinner. The only host (dashwallet-ios) keeps the old init |
Components to add to #38. These draw icons through Image(dash:) or DashIcon.*.image, with no accessibility modifier at this head:
DashButton(icon inside the button label);SearchBar;AddressFieldView;DashAmount;DashBalanceView;SwapAmountView;ConverterCardbeyondConverterArrowBadge;SuccessIllustration/ErrorIllustration.
6 non-blocking recommendations
- VoiceOver loses the only style cue for existing calls — — every host call uses the old init. dashwallet-ios maps
DashUIKit/Sources/DashUIKit/Components/Toast.swift
Lines 89 to 91 in 54f6fd6
.failed(let reason)to.errorwith the raw reason as the message (https://github.com/dashpay/dashwallet-ios/blob/develop/DashWallet/Sources/UI/Payments/InternalTransfer/Confirm/InternalTransferToastModifier.swift#L93-L123), so VoiceOver now reads only the reason. "Another transfer is still in progress" (.warning) sounds the same as a.successtoast. "toast-error, image" was a poor cue, but it was a cue. The PR's argument, that messages already name the style, holds for "Copied" and "No internet connection" but not for these. A companion dashwallet-ios change that passesaccessibilityLabel:for.error/.warningwould close it. (verified in dashwallet-iosdevelop) - The shared fix in one place —
—
Image(decorative: name, bundle:)for library-bundled.customicons, or a decorative flag onDashIconSource, would fix Toast and every component in #38 at once, and keep new components from repeating it. Worth naming in #38 as the preferred direction, since this PR adds a Toast-only.accessibilityHidden. - The docs example and the host's string tooling — — the example localizes with a SwiftUI literal key (
Lines 27 to 39 in 54f6fd6
Text("Error, \(x)")→"Error, %@"). dashwallet-ios runs BartyCrouch with[update.code] additive = false, which extractsNSLocalizedStringcalls, notText("…")keys. A key added by hand can then be removed on the next update and ship in English everywhere. ShowingText(String(format: NSLocalizedString("Error, %@", comment: …), message))as well would fit the only consumer. (theadditive = falsesetting is verified; how the tool treatsTextliterals is not) - Announce on appear —
— the label is read only when focus lands on the message. Toasts in dashwallet-ios last 3–3.5 s with no announcement, so a VoiceOver user rarely hears them. The docs give this job to the host. Posting
AccessibilityNotification.Announcementonce per message insideToastwould make the label reach users. (not verified at runtime) - Label and message can drift — — the label replaces the message for VoiceOver and UI tests, and only the doc comment asks the host to rebuild it with every message. A narrower
DashUIKit/Sources/DashUIKit/Components/Toast.swift
Lines 69 to 81 in 54f6fd6
spokenStyle: Text?that Toast combines withText(message)would rule out a stale label. - Default path adds a redundant override —
— the old init passes
Text(message)only so it can be applied as the label of an identicalText. AText?stored property, applied only when non-nil, keeps SwiftUI's own label on the default path and makes the override visibly opt-in.
Review details
Tier: normal (public component API plus accessibility behaviour), stacked on #36. Levels 1–3 inline, including #38's body. Level 4 used the general lane (/code-review high) and the UI/accessibility specialist lane (default-label parity, spinner, element structure, the localization claims in the docs, host call sites, API shape). The verifier checked:
- the host toast mapping and
.bartycrouch.tomlin dashwallet-ios; - #38's component list against the call sites.
Dropped: an empty-label edge case (Text("")), which is the host's input, and the README row wording.
At the time of review, Conventions, Lint CI config and Validate PR title were still pending. The builds, unit tests, API check and Before / After screenshots were green.
🤖 Reviewed with Claude Code
…eover # Conflicts: # .github/scripts/conventions.sh # .github/scripts/tests/conventions-test.sh # docs/feedback.md
romchornyi-pitcrew
left a comment
There was a problem hiding this comment.
✅ no blockers · no majors · 3 non-blocking recommendations — reviewed at cb29552799 (re-review)
| Level | Verdict | |
|---|---|---|
| 1 · Idea | 🟡 interim fix | Unchanged since the last review: Toast is fixed in place, and the shared cause in Image(dash:) is tracked in #38 |
| 2 · Architecture | ✅ right layer | Unchanged: the component owns its accessibility; the opt-in Text label matches the navigation bar buttons |
| 3 · Completeness | 🟡 untracked gaps | #38 still lists none of the components named in the last review (below) |
| 4 · Code | ✅ clean | The new head only merges master (#36, #37). The PR's own diff against master is identical to the one reviewed at 54f6fd6, and CI is green on it |
Since the last review
- Rebased onto
masterby a merge commit after #36 and #37 landed; the conflicts were in the CI scripts, which now matchmasterexactly.Toast.swift,README.mdanddocs/feedback.mdcarry the same change as before.
Untracked gaps (still). These draw icons through Image(dash:) or DashIcon.*.image with no accessibility modifier and are not in #38: DashButton, SearchBar, AddressFieldView, DashAmount, DashBalanceView, SwapAmountView, ConverterCard beyond ConverterArrowBadge, SuccessIllustration / ErrorIllustration. Please add them to #38, or say there why they are out of scope.
3 non-blocking recommendations
- The PR description is out of date — it still says the PR is stacked on #36 and that
api-check.shran against #36's head. The base ismasternow; thePublic APIcheck on this head is the current evidence. - Recommendations 1–6 of the last review are still open, with no reply. None blocks. The two worth an answer before merge: the companion dashwallet-ios change that passes
accessibilityLabel:for.error/.warning(VoiceOver no longer hears any style cue there —), and the shared decorative fix at as #38's preferred direction.DashUIKit/Sources/DashUIKit/Components/Toast.swift
Lines 89 to 91 in cb29552
- The docs example and BartyCrouch — — the
Lines 27 to 38 in cb29552
Text("Error, \(x)")literal key may not surviveadditive = falsein the host; unchanged from the last review. (not verified)
Review details
Re-review of the head after the merge of master. The PR's own diff (Sources, README.md, docs) was compared line by line with the diff reviewed at 54f6fd6: identical. Levels 1–3 re-checked inline, including #38's current body. Level 4: Toast.swift read at this head; the merge touches no PR-owned line. All 8 CI checks pass at this head.
🤖 Reviewed with Claude Code
Issue being fixed or feature implemented
VoiceOver reads the toast's icon by its asset name before the message: "toast-warning, image", "toast-no-wifi, image" and so on. This was measured in the accessibility tree on the iOS simulator.
Stacked on #36, which changed
ToastStyleto drawDashIcon.Toastcases. Once #36 merges, this PR's base becomesmaster.What was done?
Toast.init(style:message:accessibilityLabel:onDismiss:). A host that wants the style spoken passes aTextthat VoiceOver reads instead of the message, for example "Error, payment failed". It is aText, like the labels ofNavigationBarCircleButtonandNavigationBarCircleMenu, so the host localizes it. The existing init is unchanged.docs/feedback.mddescribes what VoiceOver reads and how to localize the label. TheREADME.mdrow lists.noInternetand the label.The other components that draw
.customicons throughImage(dash:)have the same problem. That is tracked in #38.How Has This Been Tested?
swift build(macOS), the iOS Release device build, andxcodebuild teston the iOS 27 simulator: 18 tests, 0 failures.conventions.shpasses, andapi-check.shagainst refactor: route asset names through DashIcon #36's head reports no breaking changes..warning, "Message"toast-warning(image),Message,Close(button)Message,Close(button).noInternet, "Message"toast-no-wifi(image),Message,CloseMessage,Close.loading, "Message"Message,CloseMessage,Close.error, "Message", label "Error, message"Error, message,CloseThe other styles match
.warning.Before / After
Only what VoiceOver reads changes; nothing is drawn differently. See the table in "How Has This Been Tested?".
Breaking Changes
None. The existing init keeps its signature, and the API check is clean. Hosts whose UI tests find a toast by its icon's accessibility label will no longer find it.
Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit