Skip to content

feat(rate-limits): add optional progress bars for 5h/7d usage#37

Open
marciogranzotto wants to merge 1 commit into
pstuart:mainfrom
marciogranzotto:feat/rate-limits-progress-bar
Open

feat(rate-limits): add optional progress bars for 5h/7d usage#37
marciogranzotto wants to merge 1 commit into
pstuart:mainfrom
marciogranzotto:feat/rate-limits-progress-bar

Conversation

@marciogranzotto

@marciogranzotto marciogranzotto commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional visual progress bar to the rate-limits module, matching the style the context module already uses:

5h:█░░░░░░░ 24% 🟢 (2h 15m) 7d:█████░░░ 71% 🟡 (3d 4h)

Note: GitHub's code font renders the / block glyphs poorly — in a terminal the bars display correctly, identical to the context module's bar.

New options

  • RATE_SHOW_PROGRESS_BAR (default: false) — render a bar between the label and the percentage. Off by default, so existing installs see no change.
  • RATE_PROGRESS_BAR_WIDTH (default: empty) — per-module width override; falls back to the global PROGRESS_BAR_WIDTH.

Implementation notes

  • Reuses the shared progress_bar helper from utils.sh (already covered by tests/test_utils.sh), so the bar respects PROGRESS_BAR_FILLED/PROGRESS_BAR_EMPTY and theme settings.
  • Width input goes through progress_bar's existing safe_int clamping, so an untrusted project .barista.conf value can't break the arithmetic.
  • Both options documented in barista.conf.

Testing

  • bash tests/test_utils.sh and bash tests/test_sandbox.sh pass (27/27).
  • Verified rendered output with the option on and off; with it off, output is byte-identical to current main.

🤖 Generated with Claude Code

Adds RATE_SHOW_PROGRESS_BAR (default: false) to render a visual bar
between the label and percentage, e.g. "5h:███░░░░░ 45%", matching the
context module's bar style. RATE_PROGRESS_BAR_WIDTH overrides the
global PROGRESS_BAR_WIDTH for this module only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant