feat: add a pace indicator to the usage bars#25
Open
carlosresu wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
resets_attimestamp and the fixed window length (5h or 7d).Settings controls
Two right-click Settings controls drive it:
Both persist to
settings.jsonvia#[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 localizationfeat: add a pace indicator to the usage barsTest plan