Repository navigation
feat: add an Extra Usage Daily Budget widget - #672
Open
eric-engberg wants to merge 2 commits into
Open
eric-engberg wants to merge 2 commits into
eric-engberg wants to merge 2 commits into
Conversation
With a monthly extra usage limit, the useful number during a day is how much can still be spent per day without running out before the limit resets. Extra Usage Daily Budget shows what's left of the monthly limit divided by the days left in the month, today included, so it rises on light days and falls on heavy ones. Monthly limits reset at 00:00 UTC on the 1st, so days are UTC days. A `w` keybind switches to counting weekdays only (Saturday and Sunday in UTC); today always counts, even a weekend day, so the budget never divides by zero. Once the limit is used up it shows $0.00; without a monthly limit it shows nothing, like Extra Usage Remaining.
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.
What
A new Extra Usage Daily Budget widget shows how much of the monthly extra usage limit can be spent per day for the rest of the month: what's left of the limit divided by the days left, today included. With $376.55 left of a $500 limit on Monday 5 October 2026, it shows
Daily Budget: $13.95(27 days left), or$18.83with weekdays only (20 weekdays left).Why
With a monthly limit, the number that matters during the day is how much you can still spend per day without running out before the limit resets. The existing widgets give the pieces (spent, left, percent) but not the pace. It's especially useful on usage-based Enterprise plans, where the monthly limit is the only limit.
How
wkeybind in the line editor toggles counting weekdays only (Saturday and Sunday in UTC are skipped). The editor row shows(weekdays)when it's on. Today always counts, even a weekend day, so working on a weekend still shows a budget and nothing ever divides by zero.$0.00. Without a monthly limit it shows nothing, like Extra Usage Remaining. With extra usage off it showsn/a. Thedisabledandno-datahide options, raw value mode, the reported currency and the cost number format all work like the other Extra Usage widgets.countBudgetDaysLeft) that takes the time as a parameter.Demo
Rendered from a fake usage cache (no login, no API call) on Monday 5 October 2026: $123.45 spent of a $500 limit. The third widget counts every day left ($376.55 梅 27), the fourth weekdays only (梅 20).
Powerline
Plain
Toggling weekdays only with
win the line editor:Powerline
Plain
Testing
n/aand its hidden state, errors andno-data, the fixed preview, and thewtoggle (keybind label, editor modifier, metadata). A prefetch test checks the widget fetches exactly the extra usage state, limit and spend.main(with docs: explain an empty status line in one folder (workspace trust)聽#606 and feat(git-is-fork): render forks as an editable glyph聽#617 merged in locally):bun testgives 2798 pass, 0 fail (Bun 1.4.2), andbun run lintpasses.mainonly by the new widgets. The TUI opens and exits cleanly under both.