fix(a11y): add VoiceOver labels to menu bar icon, menu rows, and chart views#860
fix(a11y): add VoiceOver labels to menu bar icon, menu rows, and chart views#860WadydX wants to merge 1 commit intosteipete:mainfrom
Conversation
…t views - StatusIconView: expose provider name and usage percentage to VoiceOver - MenuContent: add accessibilityLabel to text rows, action buttons, and submenu items - ProviderSwitcherButtons: set accessibilityRole(.button) and sync accessibilityLabel from titleField - Chart views: add accessibilityLabel and accessibilityValue to CostHistory, CreditsHistory, UsageBreakdown, and PlanUtilization charts Fixes steipete#859
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c39c7325fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| override var title: String { | ||
| didSet { | ||
| self.setAccessibilityLabel(self.titleField.stringValue) | ||
| } | ||
| } |
There was a problem hiding this comment.
Remove the duplicate title override
This class already overrides title above to drive titleField, so adding a second override var title in the same type makes any Swift build fail with an invalid redeclaration before the app can run. Move the accessibility label update into the existing setter instead of declaring the property again.
Useful? React with 👍 / 👎.
| override var title: String { | ||
| didSet { | ||
| self.setAccessibilityLabel(self.titleField.stringValue) | ||
| } | ||
| } |
There was a problem hiding this comment.
Summary
Add VoiceOver accessibility labels across the menu bar icon, menu content rows, provider switcher buttons, and chart views so screen reader users can navigate and understand CodexBar's UI.
Changes
MenuContent.swift:StatusIconView: adds.accessibilityLabel(provider display name) and.accessibilityValue(usage percentage + stale status).accessibilityLabel(text)on headline, primary, and secondary text.accessibilityElement(children: .combine)+.accessibilityLabel(title).accessibilityElement(children: .combine)+.accessibilityLabel(title)ProviderSwitcherButtons.swift:InlineIconToggleButton:setAccessibilityRole(.button)+ syncaccessibilityLabelfromtitleFieldStackedToggleButton: same accessibility role and label syncChart views (
CostHistoryChartMenuView,CreditsHistoryChartMenuView,UsageBreakdownChartMenuView,PlanUtilizationHistoryChartMenuView):.accessibilityLabelwith descriptive message.accessibilityLabel(chart type) +.accessibilityValue(data point count)Test Plan
swift build)swift test)swiftformat Sources Tests && swiftlint --strict)Related Issues
Fixes #859