Skip to content

feat: add a pace indicator to the usage bars#25

Open
carlosresu wants to merge 2 commits into
CodeZeno:mainfrom
carlosresu:feat/pace-indicator
Open

feat: add a pace indicator to the usage bars#25
carlosresu wants to merge 2 commits into
CodeZeno:mainfrom
carlosresu:feat/pace-indicator

Conversation

@carlosresu
Copy link
Copy Markdown

Summary

Adds an opt-in pace indicator that marks where usage should be if it were spread evenly across the window, so each bar shows at a glance whether the current burn rate is ahead of or behind pace.

  • The expected position is derived from each section's resets_at timestamp and the fixed window length (5h or 7d).
  • Drawn red when actual usage is ahead of pace, green when behind.
  • Two styles, selectable in the menu:
    • Tick — a thin vertical bar at the expected-pace position.
    • Solid — a filled band spanning the gap between actual usage and the expected-pace position.

Settings controls

Two right-click Settings controls drive it:

  • Show pace indicator — checkbox, off by default.
  • Pace indicator style — submenu with Tick / Solid (Solid by default).

Both persist to settings.json via #[serde(default)] fields, so existing settings files migrate cleanly. The indicator is drawn inside the existing bar segments, so the widget width is unchanged.

Localization

All new menu strings (Show pace indicator, Pace indicator style, Tick, Solid) are translated across all eight supported locales.

Commits

  • feat: add pace indicator localization
  • feat: add a pace indicator to the usage bars

Test plan

  • Build the release binary and run it
  • Right-click → Settings → enable Show pace indicator; confirm the indicator appears on the 5h and 7d bars
  • Right-click → Settings → Pace indicator style → switch between Tick and Solid; confirm the bar updates live
  • Confirm the indicator is red when usage is ahead of pace and green when behind
  • Toggle the indicator off; confirm the bars render exactly as before
  • Restart the app; confirm the toggle and style choice persist
  • Verify the widget width is unchanged whether the indicator is on or off

Adds the pace indicator strings to the Strings struct and provides
translations for all eight supported locales: the show_pace_indicator
menu item, the pace_indicator_style submenu label, and the Tick and
Solid style names. The strings are wired into the renderer and the
right-click menu in the following commit.
Adds an opt-in pace indicator that marks where usage should be if it
were spread evenly across the window, so the bar shows whether the
current burn rate is ahead of or behind pace.

The expected position is derived from each section's resets_at
timestamp and the fixed window length (5h or 7d). It is drawn red when
actual usage is ahead of pace and green when behind, in one of two
styles:

  - Tick: a thin vertical bar at the expected-pace position.
  - Solid: a filled band spanning the gap between actual usage and the
    expected-pace position.

Two right-click Settings controls drive it: a 'Show pace indicator'
checkbox (off by default) and a 'Pace indicator style' submenu with
Tick and Solid options (Solid by default). Both persist to
settings.json via #[serde(default)] fields so existing files migrate
cleanly. The indicator is drawn inside the existing bar segments, so
the widget width is unchanged.
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