Skip to content

[codex] add weekly warning tray alerts#365

Draft
Emanuele-web04 wants to merge 1 commit intorobinebers:mainfrom
Emanuele-web04:codex/weekly-warning-threshold
Draft

[codex] add weekly warning tray alerts#365
Emanuele-web04 wants to merge 1 commit intorobinebers:mainfrom
Emanuele-web04:codex/weekly-warning-threshold

Conversation

@Emanuele-web04
Copy link
Copy Markdown

@Emanuele-web04 Emanuele-web04 commented Apr 8, 2026

What changed

  • adds a configurable weekly warning threshold setting to app preferences and the settings UI
  • persists that threshold and wires it through bootstrap, store state, and display actions
  • introduces tray alert logic that promotes the weekly metric when remaining weekly budget drops below the configured threshold
  • updates tray icon rendering, title/template behavior, and tooltip formatting to reflect warning and critical states
  • adds tests covering persistence, settings actions, tray metric selection, and alert rendering behavior

Why

The tray previously kept showing the normal primary metric even when weekly budget was running low. That made it easy to miss depletion until the user opened the app. This change surfaces weekly budget pressure directly in the menubar and lets users choose how early the warning should appear.

User impact

  • users can pick a weekly warning threshold from Settings
  • the menubar can switch to weekly remaining progress automatically when weekly budget gets low
  • warning and critical states are visually emphasized in the tray icon and tooltip

Validation

  • reviewed the local diff and committed the feature on codex/weekly-warning-threshold
  • automated tests were not run in this environment because project dependencies are not installed locally yet

Summary by cubic

Adds weekly warning tray alerts that promote the Weekly metric when remaining budget is low, with a user-configurable threshold in Settings. Updates the tray icon and tooltip to highlight warning and critical states.

  • New Features
    • Settings: Adds a Weekly Warning threshold (10–50%, default 30%), persisted and bootstrapped into the app store.
    • Tray behavior: When Weekly remaining ≤ threshold, the tray switches to Weekly as the primary metric and applies severity (warning ≤ threshold, critical ≤ threshold/2).
    • Rendering: Tray icons (provider/bars/donut) support alert tones with colored strokes, “!” marker, and percent overlay; template mode is disabled when colored. Tooltip prefixes alerted providers with “!”.
    • Actions: use-settings-display-actions handles saving the new threshold and tracks changes; tray updates are scheduled on change.
    • Core logic: New tray-alert selects the tray’s primary metric and computes alert severity.
    • Tests: Cover settings persistence, display actions, primary metric selection, icon rendering tones, tooltip formatting, and app wiring.

Written for commit e9fb42d. Summary will update on new commits.

@github-actions github-actions Bot added the core label Apr 8, 2026
@validatedev
Copy link
Copy Markdown
Collaborator

I would appreciate it if you could provide any screenshots once you have completed the implementation. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants