Skip to content

fix(a11y): add VoiceOver labels to menu bar icon, menu rows, and chart views#860

Open
WadydX wants to merge 1 commit intosteipete:mainfrom
WadydX:fix/voiceover-a11y
Open

fix(a11y): add VoiceOver labels to menu bar icon, menu rows, and chart views#860
WadydX wants to merge 1 commit intosteipete:mainfrom
WadydX:fix/voiceover-a11y

Conversation

@WadydX
Copy link
Copy Markdown

@WadydX WadydX commented May 7, 2026

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)
    • Text rows: .accessibilityLabel(text) on headline, primary, and secondary text
    • Action buttons: .accessibilityElement(children: .combine) + .accessibilityLabel(title)
    • Submenu headers and items: .accessibilityElement(children: .combine) + .accessibilityLabel(title)
  • ProviderSwitcherButtons.swift:

    • InlineIconToggleButton: setAccessibilityRole(.button) + sync accessibilityLabel from titleField
    • StackedToggleButton: same accessibility role and label sync
  • Chart views (CostHistoryChartMenuView, CreditsHistoryChartMenuView, UsageBreakdownChartMenuView, PlanUtilizationHistoryChartMenuView):

    • Empty state text: .accessibilityLabel with descriptive message
    • Chart containers: .accessibilityLabel (chart type) + .accessibilityValue (data point count)

Test Plan

  • Build passes (swift build)
  • Existing tests pass (swift test)
  • SwiftFormat and SwiftLint pass (swiftformat Sources Tests && swiftlint --strict)
  • VoiceOver on macOS reads the menu bar icon with provider name and percentage
  • VoiceOver reads menu rows as grouped elements (not fragmented text)
  • VoiceOver announces provider switcher buttons by name

Related Issues

Fixes #859

…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
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +153 to +157
override var title: String {
didSet {
self.setAccessibilityLabel(self.titleField.stringValue)
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +290 to +294
override var title: String {
didSet {
self.setAccessibilityLabel(self.titleField.stringValue)
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the duplicate title override

This class also already overrides title earlier in the type, so the newly added second override var title is an invalid redeclaration and blocks any Swift build. Put the accessibility label synchronization in the existing setter instead.

Useful? React with 👍 / 👎.

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.

Menu bar icon and usage menus lack VoiceOver accessibility labels

1 participant