Add menubar quota notifications#313
Open
ozymandiashh wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Correction: this is build/test smoke evidence only, not complete quota-notification proof. What this actually proves:
What is proven visually in the later comment:
Limitation: I did not validate a live 80%/100% quota threshold notification because that requires connected quota runtime state. That should remain a limitation unless a deterministic fixture/debug path is added. |
b8ec302 to
20885e6
Compare
Contributor
Author
|
Visual validation for #313 after the latest rebase.
|
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 optional local quota notifications to the macOS menubar app. The scope stays narrow: connected live-quota providers only, currently Claude and Codex, with alerts at the two thresholds people actually need to act on.
Behavior
Quota alerts.Example notification:
Dedupe / Spam Control
Alerts are deduplicated in
UserDefaultsby:claude,codex)5-hour,Weekly, etc.)80,100)Reset tokens use the exact reset timestamp when a provider supplies one, so multiple same-day rolling windows can alert independently. Windows without a reset timestamp fall back to the local calendar day. The coordinator also keeps an in-memory pending-key set so rapid observation refreshes cannot schedule the same notification twice before
UserDefaultsis written.Old dedupe keys are pruned after 45 days, with pruning rate-limited to at most once per day.
Permission Handling
The app does not prompt from the background refresh path. Permission is requested only from Settings when the toggle is turned on. If notifications are later denied in System Settings, the toggle is disabled on the next settings sync and no hidden dedupe mark is written for undelivered alerts.
Validation
npm run build- passed.swift buildfrommac/- passed.npx vitest run tests/menubar-json.test.ts tests/day-aggregator.test.ts- 25/25 tests passed.git diff --check- passed.assess,check,semgrep- passed.Notes
swift test --filter QuotaNotificationDeciderTestsis still blocked before running the filtered tests by the existing Swift test-target/toolchain issue:no such module 'Testing'from unrelated existing test files.