feat: add an estimated time to depletion (ETD) indicator#38
Open
carlosresu wants to merge 1 commit into
Open
Conversation
This was referenced Jun 27, 2026
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 Estimated Time to Depletion (ETD) indicator that tells you how long until a quota runs out at your current pace, so you can see at a glance whether you're about to hit the limit before the window resets. Rebased on v1.4.8 and extended to the Antigravity model. Inspired by issue #21.
When a usage bar is on pace to deplete before its window resets, the cell appends the estimate after the remaining time:
remlabel and the estimate follows as… ETD, e.g.90% · 1d rem · 13h ETD— about a day until the weekly window resets, but at the current burn rate you'd run out in ~13h.resets_atand the fixed window length (5h / 7d):etd = (100 − used%) / (used% / elapsed). Shown only when the projected depletion lands before the reset — i.e. exactly when you're over pace. Cells pacing safely show nothing extra.Off by default; persisted to
settings.jsonvia#[serde(default)] show_etd, so existing settings migrate cleanly.Dynamic column width
The usage-cell text column measures the actual rendered text (
GetTextExtentPoint32Win the widget's own font) and sizes to it, so the ETD suffix is never clipped and no empty space is reserved when ETD isn't showing. The widget grows only when content needs it and shrinks back when the suffix clears.Screenshots
Show ETDenabled — a cell over pace shows the estimate; cells pacing safely stay bare.Settings control
A single right-click Settings → Show ETD checkbox toggles it; the checkmark reflects state, toggling repaints live and persists immediately.
Localization
Show ETD, theETDlabel, and theremlabel are present in all 10 supported locales (a missing field is a compile error).Independence & compatibility
Branches directly off v1.4.8
main(single commit) and contains only the ETD feature — merge it alone, or alongside the detailed-remaining-time (#24) and pace-indicator (#25) PRs in any order: every combination merges with 0 conflicts (verified viagit merge-tree+ a triple-merge that builds and passes tests).Tests
7 ETD unit tests in
poller.rs:etd_secssafe/at-risk/boundary cases, a ~3,000-case property sweep of the at-risk invariant (used% > 100·elapsed/window), andetd_suffixpresent/absent/no-reset cases.cargo testgreen (12 total with v1.4.8's own poller tests).Test plan
cargo build+cargo testclean on v1.4.8· <rem> rem · <etd> ETD; safe cell stays bare; Antigravity cell behaves like Claude/Codex