Claude: compact multi-account menu (active card + headroom-sorted rows + collapsed tail) - #2542
Conversation
|
Codex review: needs changes before merge. Reviewed August 1, 2026, 2:00 AM ET / 06:00 UTC. ClawSweeper reviewWhat this changesThe PR adds a compact Claude multi-account menu for four or more accounts, retaining the active account’s full usage card while rendering inactive accounts as headroom-ranked rows with a collapsible healthy tail. Merge readinessThis PR is still necessary as a compact Claude multi-account menu improvement, but the amended patch still omits transient failed-switch errors from unexpanded compact rows. That can make an inactive account with a failed switch look healthy or leave it folded into the healthy tail; the narrow error-propagation repair should land before merge. Priority: P2 Review scores
Verification
How this fits togetherCodexBar converts Claude account usage snapshots and account-switch state into its macOS menu-bar popover. The new layout planner selects full cards, compact rows, and a collapsed summary, while the menu controller supplies the display state and account-switch actions. flowchart TD
A[Claude account snapshots] --> B[Account layout planner]
C[Account switch state] --> D[Menu controller]
B --> D
D --> E[Full account cards]
D --> F[Compact account rows]
E --> G[Claude menu popover]
F --> G
G --> H[Switch account action]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Feed the existing effective per-account display error into compact-row classification and rendering, ensure errored rows cannot be treated as healthy-tail candidates, and cover the failed inactive-switch state with focused menu-model tests. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: populate at least four Claude account snapshots, set Is this the best way to solve the issue? No. The compact path should reuse the existing effective error projection before it decides row severity and healthy-tail eligibility; that is narrower and preserves the established full-card behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ef86077e70a. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
With four or more claude-swap accounts the Claude menu now pins the active account's full card, renders inactive accounts as one-line rows sorted by remaining headroom (red/amber below 10%/50% left, star on the healthiest activatable account), and folds the healthy tail behind a summary row. Clicking a compact row expands that account's full card; expansion state resets when the menu closes. Fewer than four accounts keep the stacked cards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
a21b65a to
6a57977
Compare
…ount-view-8b33ad Claude: compact multi-account menu (active card + headroom-sorted rows + collapsed tail)
Summary
With many claude-swap accounts the Claude tab stacked one full three-bar card per account — six accounts meant ~18 progress bars and a popover taller than the screen, where five of the six cards carried no information ("100% left" everywhere).
This adds a compact multi-account layout that engages at 4+ accounts (below that, nothing changes):
Accounts with errors (expired token, etc.) show a warning glyph and sort with the constrained rows instead of hiding in the healthy tail.
codexbar cardsCLI output is unchanged.Before / after
Screenshots are rendered from synthetic fixture data by a new env-gated dev tool (
MenuLayoutScreenshotRenderTests, skipped unlessCODEXBAR_SCREENSHOT_DIRis set).Implementation
AccountMenuLayoutPlanner(CodexBarCore): pure projection from[ProviderAccountUsageSnapshot]+ expansion state to an ordered row plan — fully unit-tested, no UI dependencies.MenuCardCompactAccountRowView/MenuCardCollapsedAccountsRowView: SwiftUI rows matching the existing card design language (MenuHighlightStyle,UsageMenuCardLayout), with height-cache fingerprints.StatusItemController+ClaudeSwapMenu: plan-driven rendering path; the <4-account stacked path is preserved verbatim. Expansion toggles reuseadvanceMenuInteraction+invalidateMenus(refreshOpenMenus:).Commands run
make check(SwiftFormat + SwiftLint clean)make test(full sharded suite)swift test --filter "AccountMenuLayoutPlannerTests|StatusMenuClaudeSwapCompactTests|MenuCardClaudeSwapAccountTests|ClaudeSwapMenuPrecedenceTests|ClaudeSwapAccountProjectionTests|CLICardsClaudeSwapTests"🤖 Generated with Claude Code