Skip to content

feat: add local budget alerts with projected overruns#28

Closed
EricGrill wants to merge 1 commit intomm7894215:mainfrom
EricGrill:codex/feature-budget-alerts
Closed

feat: add local budget alerts with projected overruns#28
EricGrill wants to merge 1 commit intomm7894215:mainfrom
EricGrill:codex/feature-budget-alerts

Conversation

@EricGrill
Copy link
Copy Markdown
Contributor

Why

Issue #21 asks for actionable budget alerts that warn before spend gets out of hand.

What changed

  • added local daily, weekly, and monthly budget preferences in Settings
  • added a dashboard alert when current spend is over budget or on pace to exceed it
  • added a jump from the alert into the project usage view

Verification

  • node --test test/budget-alerts.test.js
  • npm run validate:copy

Closes #21

@mm7894215
Copy link
Copy Markdown
Owner

Thanks for the contribution. This cannot be merged as-is because the branch conflicts with current main in dashboard/src/pages/SettingsPage.jsx.

After rebasing and resolving the conflict, please also add accessible labels for the new budget inputs. The current number fields only have a placeholder, which is not enough for screen readers.

This adds a local budget alert flow that lets users set daily, weekly,
and monthly budgets in Settings and see a dashboard warning when current
spend is over budget or on pace to exceed it. The alert also links
straight into the project usage view so the likely driver is easier to
inspect.

Constraint: Keep the first implementation local-only and avoid adding remote budget storage or notification delivery
Rejected: Add cloud-synced budget preferences first | extra account/settings surface for an MVP dashboard alert
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep budget alerts explainable and tied to visible range math; avoid hiding forecast logic behind opaque scoring
Tested: node --test test/budget-alerts.test.js
Tested: npm run validate:copy
Not-tested: Full npm test (workspace still lacks root dev modules such as esbuild and @sourcegraph/scip-typescript)
Not-tested: Browser rendering and interaction for the new settings and dashboard alert UI
Related: mm7894215#21
@EricGrill EricGrill force-pushed the codex/feature-budget-alerts branch from bbe50fc to 0d62d50 Compare April 25, 2026 00:19
@EricGrill
Copy link
Copy Markdown
Contributor Author

Addressed review feedback:

  • Rebased onto current main and resolved the SettingsPage.jsx conflict by adopting the new extracted-section pattern (moved BudgetAlertsSection into dashboard/src/components/settings/BudgetAlertsSection.jsx to match AccountSection/MenuBarSection/AppearanceSection).
  • Added accessible labels for the budget number inputs via aria-labelledby (associating the visible SettingsRow label) plus aria-describedby for the hint text. Each row uses useId() so the label/hint are programmatically linked instead of relying on the placeholder="0" alone.

Tests still pass (node --test test/budget-alerts.test.js); validate:copy and validate:ui-hardcode show no new warnings introduced by this branch.

@mm7894215
Copy link
Copy Markdown
Owner

Thanks for picking up #21. Going to close this one too.

Budget alerts are a feature where "correct" depends a lot on the user. Flat daily/weekly/monthly thresholds work for some people, but most users I talk to care about a specific plan ceiling (Claude Pro, Codex Plus, Cursor business) or per-project spend, not a rolling global number. The Limits page already covers plan-level rate limits and caps; adding a parallel rolling-budget UI alongside it would mean two competing "are you over?" surfaces.

The localStorage-only state also limits the value — alerts that don't follow a user across devices tend to lose trust quickly. If TokenTracker grows budget alerts properly, they'd probably want to live alongside the cloud sync layer rather than ahead of it.

Leaving #21 open for now. Appreciate the careful PR.

@mm7894215 mm7894215 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Add actionable budget alerts with forecasted overrun warnings

2 participants