Skip to content

fix(status-bar): align usage density modes - #11376

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
hyein-cbio:hyein-cbio/shipworm
Jul 30, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
hyein-cbio:hyein-cbio/shipworm

Conversation

@hyein-cbio

@hyein-cbio hyein-cbio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Align the Detailed/Compact usage display modes across the Usage popover and the bottom status bar.

Changes

  • Detailed mode shows usage bars and all available usage windows.
  • Compact mode hides the bars and shows only the tightest window summary.
  • Applies the same behavior to Claude subscription windows, including Fable usage.
  • Updates component tests for both popover rows and the status-bar provider segment.

Screenshots

Verified manually in the Electron GUI:

  • Detailed: usage bars and all available windows are visible in the popover and bottom status bar.
  • Compact: usage bars are hidden and only the tightest window summary remains.
  • The popover becomes shorter in Compact mode as expected for a density setting.

Testing

  • Focused Vitest tests: 17 tests passed
  • pnpm run typecheck:web
  • Focused oxlint checks
  • git diff --check
  • Electron GUI verification of Detailed/Compact behavior
  • Added regression tests for Codex and Claude subscription windows, including Fable usage
  • Full pnpm lint — not run; focused lint passed
  • Full pnpm typecheck — not run; typecheck:web passed
  • Full pnpm test — not run; focused tests passed
  • Full pnpm build — not run

AI Review Report

An AI-assisted code review was performed against the changed status-bar components and their adjacent state/rendering paths.

The review checked:

  • Detailed/Compact state propagation from the UI control through the store to the Usage popover and bottom status bar.
  • Tightest-window selection for Codex and Claude subscription windows, including Claude Fable usage.
  • Empty, fetching, stale, unavailable, and partial provider-window states.
  • Regression coverage for bar visibility and window selection.
  • Cross-platform compatibility for macOS, Linux, and Windows. This change does not modify keyboard shortcuts, labels containing platform-specific modifiers, paths, shell behavior, or Electron platform-specific APIs.

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.

  • No command execution, shell invocation, path handling, authentication, secret, dependency, or IPC behavior was added.
  • The existing persisted UI mode update remains constrained to the existing StatusBarUsageMode values (verbose and compact).
  • No new user-provided input is parsed or forwarded to privileged code.
  • No security follow-up is required for this change.

Notes

  • The popover and bottom status bar intentionally change density when switching modes; the vertical height change is expected and provides visible feedback that the setting was applied.
  • The current environment uses Node 22 while the repository requests Node 24; focused validation completed successfully despite the existing engine warning.
  • Full-suite validation was not run locally because the change is isolated to the status-bar renderer and focused coverage is available.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Usage 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 UsageRosterPanel. ProviderSegment now conditionally renders the verbose MiniBar, and VerboseProviderUsage no longer receives or handles the compact prop. Tests cover both rendering modes and provider-specific window selection.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: aligning status-bar usage density modes.
Description check ✅ Passed The description follows the template and includes summary, screenshots, testing, AI review, security audit, and notes.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR aligns the Detailed/Compact density toggle across the Usage popover (UsageRow) and the bottom status bar chip (ProviderSegment). Previously, compact mode in ProviderSegment still rendered a MiniBar; now bars are consistently hidden everywhere in compact mode and all window labels are shown in verbose mode.

  • Moves MiniBar rendering out of VerboseProviderUsage into the parent ProviderSegment, gated on mode === 'verbose' && !compact, so the bar-visibility contract is clear at one call site.
  • Introduces a UsageMetric presentational component in the popover panel with a showBar prop, enabling compact mode to display the tightest-window percentage inline in the header without a bar.
  • Adds regression tests for Codex and Claude subscription windows (including Fable) in both modes, plus a focused ProviderSegment test confirming bar presence/absence by mode.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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]
Loading

Reviews (3): Last reviewed commit: "fix(status-bar): reuse cataloged usage m..." | Re-trigger Greptile

@Jinwoo-H
Jinwoo-H merged commit 9ec9233 into stablyai:main Jul 30, 2026
41 checks passed
@hyein-cbio
hyein-cbio deleted the hyein-cbio/shipworm branch July 31, 2026 00:05
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(status-bar): align usage density modes

* fix(status-bar): reuse cataloged usage mode label

---------

Co-authored-by: OrcaWin <[email protected]>
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.

4 participants