Add menubar quota notifications#313
Open
ozymandiashh wants to merge 1 commit into
Open
Conversation
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 first notification surface is intentionally narrow: connected live-quota providers only, currently Claude and Codex, with alerts at the two thresholds people actually need to act on.
Behavior
Quota alertsExample notification:
Dedupe / Spam Control
Alerts are deduplicated in
UserDefaultsby:claude,codex)5-hour,Weekly, etc.)80,100)The reset token is day-based rather than exact timestamp-based so rolling windows that adjust their reset time do not produce repeated alerts during the same 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.
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 buildnpx vitest run(48 files / 663 tests)swift buildgit diff --checkNotes
swift teststill fails on the existing test-target/toolchain issue:no such module 'Testing'inmac/Tests/CodeBurnMenubarTests/CapacityEstimatorTests.swift.npx tsc --noEmitstill fails on the existing unrelatedsrc/models-report.ts(151,13)TaskCategorytype error.swift buildby claiming@State/@Testwere replaced with file paths. The checked files and build output confirm that finding is not real.