feat: ✨ Add context and quota gauges to the status bar. - #72
Conversation
feat: ✨ Add context and quota gauges to the status bar.
The `windows-latest` label rolled over to Windows Server 2025, whose image no longer ships the Visual Studio C++ toolchain node-gyp needs, so every Windows build failed in electron-builder's install-app-deps while rebuilding node-pty. Pinning to windows-2022 restores an image that still carries the toolchain. Same fix @Flaykz independently included in #72; split out so it lands on its own.
Only conflict was .github/workflows/build.yml: this branch pinned the Windows runner to windows-2022, and doctly#85 landed the same fix on main (credited to @Flaykz, who found it independently) with a fuller comment explaining the Windows Server 2025 toolchain removal. Took main's version, so the line is identical and no longer carried here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Merging this — thanks. Two notes on what happens next, so nothing is a surprise. I pushed a merge commit (a64d468) resolving the only conflict. Your The context gauge is coming out in a follow-up, for two reasons. Claude Code already renders the context window in its own statusline ( const { contextTokens } = result; // `model` is returned by the IPC handler, then dropped
const CTX_MAX = 200000;— and on a 1M-context model that reads about 500% and stays pinned red. The handler already returns The quota gauge is the good idea here, and I want to extend it. While reviewing this I went digging in the usage API and found the Stats tab was also missing data — The cause: That matters for your gauge: it reads Net: your quota gauge is the part that survives and gets better. Appreciate the contribution — the status bar was the right place for this. |
Follow-up to #72. Quota: the gauge showed only the 5-hour window, which is usually the emptiest and resets within the day — it reads "plenty left" while a weekly window is the one actually running out. It now renders a bar per row of the usage API's `limits` array (43ab0d0): a 5-hour session window, a weekly all-models window, and a weekly window per model. Rows are self-describing, so shortQuotaLabel only maps the two fixed kinds and otherwise uses the model's display name — a newly launched model gets a bar with no code change here, which is precisely the failure that had lost Sonnet and Opus. Each bar carries its own tooltip with the full label and reset time; the group still clicks through to Stats. Tracks narrowed 48px → 34px so several fit. Context gauge: removed. Claude Code already renders context usage in its own statusline (/statusline) and knows its real limit, where this had to guess — the guess was a hardcoded 200000, so on a 1M-context model it read ~500% and sat pinned red. Duplicating a native display isn't worth carrying, so this removes refreshCtxGauge, CTX_MAX, fmtTokens, both call sites (setActiveSession and the onCliBusyState handler — left in place they would have thrown ReferenceError on every session switch), the #status-bar-ctx markup and CSS, the get-session-tokens IPC handler, and its preload binding. Also replaces the five individually-enumerated /.idea/ entries #72 added to .gitignore with `.idea/` itself, so the whole JetBrains directory is covered rather than the handful of files that happened to exist at the time. Net -102/+68 while adding windows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
This PR adds two lightweight usage indicators to the status bar to make session monitoring easier without opening the stats view.
.jsonl.ideametadata filesWhy
The goal is to surface the most useful runtime limits directly in the main UI:
This reduces friction when deciding whether to continue in the same session or switch context.
Notes
Testing