feat: show time until usage window reset in notch usage bars#9
Merged
Merged
Conversation
The usage cache already stores resetsAt for both the five hour and seven day windows, and BuddyTabView already has a formatResetTime helper, but it was never wired into the UI. Append the countdown to the UsageBar detail label so the open notch shows e.g. "Session 3% · 4h 52m" and "Weekly 23% · Thu 8 PM". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- In
buddi/Buddi/Bridge/BuddyTabView.swift, the reset countdown text may stop updating because the view lacks a periodic refresh trigger, so users can see inaccurate time-remaining information after merging — add a timer-driven/state refresh (and a quick UI check) before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
The countdown string was computed at render time, so it only updated when UsageService published new data (5 min poll, up to 30 min with backoff). Drive the usage bars from a 60s TimelineView and compute the remaining time from context.date so the label stays current between polls. Extract the bars into a usageBars(now:) helper to keep layout identical (explicit VStack, spacing 3). Addresses cubic review feedback on the periodic refresh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
grayashh
approved these changes
Jun 12, 2026
grayashh
left a comment
Member
There was a problem hiding this comment.
Looks good. Thanks for your contribution.
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.
Description
The usage cache already stores
resetsAtfor both the five hour and seven day quota windows, andBuddyTabViewalready contains aformatResetTimehelper, but it was never wired into the UI, so the open notch only shows utilization percentages. This PR appends the reset countdown to theUsageBardetail label:Session 3% · 4h 52mWeekly 23% · Thu 8 PM(existing helper falls back to day + hour when more than 24h away)When
resetsAtis missing the label falls back to the current percent-only format.Type of change
Checklist
Testing notes, in the spirit of the AI tool policy: this change was written with AI assistance and human-reviewed. The data path (
usage-cache.jsonpopulated withresetsAtfor both windows, rendered throughformatResetTime) was verified against a live Buddi install on macOS 26.5 with an external display notch. I do not have a local Xcode release build of the full app, so I am relying on CI for build verification; happy to iterate if anything fails.Screenshots
Label change only: the usage bar detail goes from
3%to3% · 4h 52m.