claude-code-usage-bar icon indicating copy to clipboard operation
claude-code-usage-bar copied to clipboard

Narrow panes: stack quota bars instead of dropping the forecast

Open bpavlina opened this issue 1 month ago • 1 comments

With several Claude Code sessions side by side (~36–70 columns each), the narrow-width fallback removes forecast_5h/7d and projection_* before the reset timer. Then Claude Code still cuts off the end of line 1. In narrow panes the forecast is the part I most want to see, and it disappears first.

Proposal: when line 1 is wider than COLUMNS, put each quota segment (5h, 7d, per-model) on its own line with the labels right-aligned so the bars stack. The rest (model/context, cache, cost) goes on the lines after. At widths where line 1 fits, nothing changes.

5h[   41%    ]⏰3h54m →100%·1h40m
7d[   35%    ]⏰5d11h →100%·2d15h
Opus 5.5(583k/1M) | cache 5m

This costs one or two extra lines but keeps every segment. It could be opt-in (cs config set narrow_layout stack) if the current drop order should stay the default. I have it working in a wrapper and can send a PR if you want this.

bpavlina avatar Oct 20 '26 22:10 bpavlina

Thanks @bpavlina — agreed, dropping the forecast first is the wrong order for exactly the narrow-pane setup you describe. A PR would be very welcome.

A few notes so it lands smoothly:

  • Since 3.47.1 the default style is aurora (thin gradient bars, │ separators), and line 1 is a bit wider than classic, so narrow panes hit this more often now. Please make the stacked layout work for aurora as well as classic (styles.render_aurora / render_classic).
  • Opt-in to start, as you suggested: cs config set narrow_layout stack (default keeps today's drop order). If it works well we can flip the default later.
  • The width handling lives in styles.render() (the max_width degradation loop); stacking would fit there before the drop steps run.
  • Tests: PYTHONPATH=src pytest; a couple of render tests at ~40 and ~70 columns for both styles would be great.

Happy to review whenever it's ready.

leeguooooo avatar Oct 22 '26 06:10 leeguooooo