Repository navigation
fix(status-bar): align usage density modes - #11376
Conversation
📝 WalkthroughWalkthroughUsage rows now accept compact or verbose display modes. Compact mode renders only the tightest usage window without a bar, while verbose mode renders all available windows with metrics and bars. The selected mode is passed from 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR aligns the Detailed/Compact density toggle across the Usage popover (
Confidence Score: 5/5Safe to merge — the change is confined to renderer presentation logic with no IPC, auth, or data-persistence paths touched. The restructuring is straightforward: bar visibility is now gated uniformly on mode === 'verbose' in both the popover and the status-bar chip. The compact boolean (physical narrowness) is correctly threaded through only where it still applies. Edge cases — buckets-only providers, monthly-only providers, null windows, Fable windows — are all handled and covered by the expanded test suite. No logic errors were found. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/status-bar/StatusBar.tsx | Removes the compact prop from VerboseProviderUsage, relocates MiniBar rendering to ProviderSegment gated on mode === 'verbose' && !compact, and restricts compact mode to a bare WindowLabel for the tightest window. Adds data-usage-bar attribute to MiniBar for test targeting. |
| src/renderer/src/components/status-bar/UsageRosterPanel.tsx | Extracts a UsageMetric component with a showBar flag, adds a mode prop to UsageRow (default 'verbose'), and wires compact mode to show only the tightest-window metric in the header (no bar) with all section rows suppressed. |
| src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx | Adds three focused tests: compact renders only the tightest window (weekly beats session), Claude subscription windows correctly pick Fable (75% > 60% > 25%), and verbose mode renders all windows with bars. |
| src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx | Adds one new test asserting that data-usage-bar appears only in mode=verbose and not in mode=compact for the Grok monthly-only provider; existing tests pass unchanged. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User toggles mode] --> B{mode?}
B -- verbose --> C[ProviderSegment]
B -- compact --> D[ProviderSegment]
C --> E[MiniBar tightest if !compact]
C --> F[VerboseProviderUsage all windows as labels]
D --> G[WindowLabel tightest only no bar]
B -- verbose --> H[UsageRow popover]
B -- compact --> I[UsageRow popover]
H --> J[Header: reset countdown]
H --> K[Section rows: UsageMetric x N showBar=true]
I --> L[Header: UsageMetric tightest showBar=false]
I --> M[No section rows]
Reviews (3): Last reviewed commit: "fix(status-bar): reuse cataloged usage m..." | Re-trigger Greptile
* fix(status-bar): align usage density modes * fix(status-bar): reuse cataloged usage mode label --------- Co-authored-by: OrcaWin <[email protected]>
Summary
Align the Detailed/Compact usage display modes across the Usage popover and the bottom status bar.
Changes
Screenshots
Verified manually in the Electron GUI:
Testing
pnpm run typecheck:weboxlintchecksgit diff --checkpnpm lint— not run; focused lint passedpnpm typecheck— not run;typecheck:webpassedpnpm test— not run; focused tests passedpnpm build— not runAI Review Report
An AI-assisted code review was performed against the changed status-bar components and their adjacent state/rendering paths.
The review checked:
The review found that the initial implementation did not make the bar visibility difference clear enough in Compact mode. The implementation was adjusted so Compact consistently hides the bars in both the popover and the bottom status bar. Focused tests and Electron GUI verification were then rerun successfully.
Security Audit
This is a renderer-only presentation change.
StatusBarUsageModevalues (verboseandcompact).Notes