fix(claude): honor segmented account menu layout - #3498
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 4:21 AM ET / 08:21 UTC. ClawSweeper reviewWhat this changesMakes Claude-swap honor the existing segmented account layout, with stable account buttons, one account’s details, and unavailable-account inspection. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and v0.56.8 still omit segmented Claude-swap presentation. The earlier cache-invalidation finding is resolved, and no remaining blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherCodexBar’s Claude menu displays account usage supplied by the optional claude-swap executable. The layout preference controls presentation, while explicit account selections reuse the existing serialized switching path. flowchart TD
A[Claude account snapshots] --> C[Account menu presentation]
B[Saved layout preference] --> C
C --> D[Stacked account cards]
C --> E[Segmented buttons and details]
E --> F[Inspect unavailable account]
E --> G[Existing serialized account switch]
G --> A
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Honor the saved layout through this focused Claude presentation path while retaining source-owned identity, existing activation guards, and stacked and CLI behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: with multiple Claude-swap accounts, current main bypasses segmented presentation regardless of the saved layout preference. No live reproduction was executed in this review. Is this the best way to solve the issue? Yes. The branch fills the missing Claude presentation path while reusing stable identities, the existing switching backend, and established menu-rebuild mechanics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b1e27d266a8e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Verified head 8cbffc5. CI is green: https://github.com/steipete/CodexBar/actions/runs/34202240112. make check passed. The final make test run passed all 1,036 selections in 87 groups, on the first pass with no retries or timeouts. Independent branch review is clean through P2, and the current ClawSweeper review has no remaining findings. The Developer ID-signed native harness used the production controller/menu and a fake cswap executable. It proved exactly one source-owned switch command per activation request, retained usage on failure, inspect-only expired accounts, privacy-safe slot labels, merged-menu behavior and two-row wrapping. Reopening the same persistent menu restored the active card with no provider-revision change and zero additional adapter calls. A populated ambient snapshot did not create an account card when the adapter reported no active account and none was explicitly inspected. The real built CLI retained full per-account card output, including the expired slot. The persistent-menu regression failed before repair for both provider and merged menus, then passed. The no-active rendering regression protects against the shared empty-card fallback. Four existing architecture-test line offsets were refreshed without changing their anchor strings, fingerprints or enforcement. The PR body contains the inspected synthetic screenshots. Changelog notes are in #3499, to land last. |
Claude-swap ignored Menu → Multi-account layout and always rendered stacked/compact cards. Honor Segmented with stable account buttons and one source-owned detail card, reusing the existing serialized activation path.
Keep the active marker tied to adapter output. Unavailable accounts remain inspectable without activation; pending and failed switches retain the requested account’s usage and diagnostics. Use stable slot labels with Hide Personal Info. Closing inspection invalidates the cached menu so a fresh persistent menu returns to the active card on reopen without another fetch. With no active or explicitly selected account, show the no-active notice without falling back to ambient usage. Stacked/compact menus and CLI cards keep their existing behavior.
Fixes #3382. Thanks @thatlev for the report and acceptance criteria. Release notes are in #3499, to land after the code PRs.
Validation: make check passed; make test passed all 1,036 selections in 87 groups on the final head with no retries, failures, or timeouts. The persistent-menu regression failed before repair for both provider and merged menus, then passed. The architecture guard remains unchanged apart from four exact-line offsets. Independent branch review is clean through P2.
Developer ID-signed native proof exercised successful/failed switching, retained usage, privacy labels, sentinel inspection, merged menus, four-account wrapping, and no-active behavior. Reusing the same menu across inspection and reopen restored the active card with no change to provider revision or adapter invocation count. The built CLI continued to render every synthetic account, including the expired slot. All proof uses synthetic data and a fake cswap executable.
No active account: no ambient quota card.