Repository navigation
feat: add an Extra Usage Limit widget - #33
Closed
eric-engberg wants to merge 2 commits into
Closed
eric-engberg wants to merge 2 commits into
eric-engberg wants to merge 2 commits into
Conversation
eric-engberg
force-pushed
the
feat/extra-usage-limit-widget
branch
from
October 5, 2026 06:27
fe80ba3 to
dba85d2
Compare
eric-engberg
force-pushed
the
feat/extra-usage-limit-widget
branch
from
October 6, 2026 16:47
cc8f523 to
62b6055
Compare
The Extra Usage widgets show the amount spent, what's left and the
percentage used, but never the monthly limit itself, so a line could
read "Spend Used: $123.45" with no way to show "of $500". Remaining
and Utilization only imply it.
Extra Usage Limit shows the monthly limit from the usage API, in the
reported currency and the cost number format, labeled like the other
Extra Usage widgets ("Overage Limit", or "Spend Limit" on accounts
without plan limits). When extra usage is on without a monthly limit
it shows "none", and when it's off "n/a", with the same hide options as
its siblings. It needs only the extra usage state and the limit, which
come from the fetch the other Extra Usage widgets already make.
eric-engberg
force-pushed
the
feat/extra-usage-limit-widget
branch
from
October 27, 2026 16:28
455096d to
89ba686
Compare
eric-engberg
marked this pull request as ready for review
October 27, 2026 16:29
|
Owner
Author
|
Merged upstream as sirmalloc#756. |
eric-engberg
added a commit
that referenced
this pull request
Oct 30, 2026
Brings in upstream main through #41, which now holds #33 as upstream sirmalloc#756. Main adds Extra Usage Limit at the same places the #33 branch merged here did, so the widget manifest, the usage prefetch's widget list and requirements, and its prefetch test keep main's single entry. Daily Cost Rate's billed-spend test stubs getUsageFetchedAtMs, which #36 now reads in place of its own getUsageFetchedAt. # Conflicts: # docs/USAGE.md # src/ccstatusline.ts # src/types/RenderContext.ts
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.



Standalone, cut from
main(rebuilt 2026-10-27 as one commit after #32 merged upstream as sirmalloc#670). Upstream: sirmalloc#756.What
A new Extra Usage Limit widget shows the monthly extra usage limit itself:
Overage Limit: $50.00. It sits with the other Extra Usage widgets in the picker's Usage category.Why
The Extra Usage widgets show the amount spent, what's left and the percentage used, but never the limit. A line could read
Overage Used: $123.45with no way to add "of $500"; Remaining and Utilization only imply it. The limit is already in the usage API response (extra_usage.monthly_limit, in cents) and in the usage cache, so showing it costs nothing extra.How
Overage Limit:label like the other Extra Usage widgets (the label editor can change it), and the samedisabledandno-datahide options.n/a. Extra usage on with no monthly limit showsnone(once the API has reported extra usage as on, a missing limit means none is set; it's already treated as conclusive, Extra usage widgets show permanent [Timeout] when account has no monthly limit set sirmalloc/ccstatusline#413). An unknown state with an error shows the usage error, like its siblings.$4,000.00, consistent with the Used ($106) and Remaining ($3,894) samples.Demo
Rendered from a fake usage cache (no login, no API call): an Enterprise account ($123.45 of a $500 limit), a Max account ($12.50 of $50), and a Max account with no monthly limit.
Powerline
Plain
Testing
nonewithout a limit,n/aand the hidden disabled state, errors and theno-datastate, the preview, and the hideable states. A prefetch test checks the widget triggers a fetch for exactly the extra usage state and the limit.bun test: 2378 pass, 0 fail.bun run lintpasses.mainonly by the new widget. The TUI opens and exits cleanly under both.Overage Used: $12.50 | Overage Limit: $50.00,Overage Limit: none(no monthly limit),n/awith extra usage off.main, after the Enterprise Spend wording it built on merged as fix(widgets): describe the Extra Usage widgets for Enterprise accounts too sirmalloc/ccstatusline#670:bun test3258 pass, 0 fail;bun run lintclean. Built CLI under Bun 1.4.2 and Node 26.10.0: all runtimes agree in plain and Powerline modes, and the TUI opens and exits cleanly under both.