Repository navigation
Add menu-bar pin for Claude usage shortcut - #1
Conversation
Claude has no third-party usage API, so reaching claude.ai/settings/usage required opening Settings and clicking "Check in browser" every time. Adds an opt-in "Show" toggle to the Claude row in Settings. When enabled, a Claude section appears in the menu-bar popover (styled like the other providers) with a one-click shortcut to the usage page. Off by default; nothing changes for users who leave it off.
cris7ian
left a comment
There was a problem hiding this comment.
Please preserve access to Settings in the Claude-only configuration. All 23 macOS tests and localization checks pass locally; no GitHub CI checks are reported for this PR.
| .padding(.bottom, 14) | ||
|
|
||
| if settings.visibleProviders.isEmpty { | ||
| if settings.visibleProviders.isEmpty && !settings.claudeUsagePinned { |
There was a problem hiding this comment.
When Claude is pinned with no providers configured, this condition hides the empty-state “Open Settings” button, while the footer Settings button remains hidden because visibleProviders is empty. After closing Settings, users have no visible route back to unpin Claude or connect a provider. Keep the footer Settings button visible for Claude-only configurations and cover this state with a regression test.
There was a problem hiding this comment.
I have not seen this sorry, fixing :)
Extract hasPopoverContent on UsageSettings so the popover's empty-state guard and footer Settings button share one condition. Previously, pinning Claude with no other providers hid both the empty-state Open Settings button and the footer Settings button, leaving the user with no route back. Adds a regression test covering the Claude-only configuration.
|
Good catch — fixed in 2345686. Extracted |
Previous fix suppressed the empty state in favor of showing only the Claude section. Instead, keep the empty state intact (its Open Settings button covers Settings access) and append the Claude section below it with a divider. Drops the now-unused hasPopoverContent helper and its test.
Summary
Claude has no third-party usage API, so Mana currently links out to
claude.ai/settings/usagefrom a Settings row. Reaching that link today takes two clicks every time: open the menu bar → open Settings → click "Check in browser".This PR adds an opt-in "Show" toggle next to the existing Claude row in Settings. When enabled, a Claude section appears at the bottom of the menu-bar popover (styled like the other providers) with a one-click "Check usage" shortcut that opens the browser directly. Off by default, so nothing changes for users who don't want it.
Changes
UsageSettings: newclaudeUsagePinnedpublished property, persisted toUserDefaultsunderclaudeUsagePinned. Mirrors the shape ofantigravityEnabled.SettingsView: adds aToggle("Show", …)to the Claude row, matching the Antigravity row's control pattern.UsagePopoverView: renders aclaudeUsageSectionafter the providerForEachwhen pinned, visually consistent with existing provider sections (icon + uppercased header + action on the right).CLAUDEandCheck usageentries to en/es/fr/de.stringsfiles.testClaudeUsagePinnedPersiststoManaTests, mirroring the existing antigravity persistence test.Deliberately did not introduce a
ProviderID.claudecase — Claude has no fetchable usage, so a full provider would be dead weight. If a real API ever lands, swapclaudeUsageSectionfor a proper provider and remove the toggle.Test plan
xcodebuild -scheme Mana -configuration Debug buildsucceedstestClaudeUsagePinnedPersistspassesclaude.ai/settings/usageand dismisses the popover