codeburn/mac/Sources/CodeBurnMenubar/Views
ozymandiashh 79d1482951 feat(codex): notify once when OpenAI banks a limit reset
A banked reset is the one capacity signal a user can act on before it is spent,
and it arrives silently. CodeBurn already sees it: the reset-credit inventory
rides every successful Codex quota refresh. Comparing that inventory against the
previous reading is all it takes to notice a grant, so there is no new endpoint,
no new cadence and no new data source here.

The detection is a pure function over an observation and the state it is judged
against, which is what makes the awkward cases testable rather than hopeful:

- The first-ever observation is a baseline. Everything the account already holds
  is history, not a burst of notifications.
- A credit that disappears was spent or expired, and is never an event. Its id
  is kept for the retention window so a payload that lists it again — a flicker,
  not a grant — cannot re-announce it.
- An absent or malformed credits payload is *no opinion*: no event, and no state
  change at all. Treating it as an empty account would re-baseline on every
  failed fetch and re-announce the whole inventory on reconnect.

Seen ids persist to `codex-banked-resets.json` in the CodeBurn cache directory,
written through SafeFile behind an actor exactly the way SubscriptionSnapshotStore
writes its snapshots — the same mechanism, not a second one — so a relaunch does
not repeat a notice. State is written before the post, not after: a notice we
drop is a smaller failure than one that repeats forever. Disconnecting clears the
file, so a reconnect under another account baselines again.

The notification goes out on the existing UpdateNotifier path, one per new
credit, naming what was granted, when, and how many are usable. Never the credit
id, never a token. Settings gains a toggle, default on; with it off the state is
still recorded, so turning it back on does not release a backlog.

Nothing here ever spends a credit. It is a notice.
2026-09-12 14:37:24 -07:00
..
ActivitySection.swift Fix per-provider data loss, history regression, and decode fragility (#362) 2026-05-20 04:16:48 -07:00
AgentTabStrip.swift feat(menubar): plain pace verdict, also on the agent-tab quota card 2026-09-12 20:32:14 +03:00
CapacityDockView.swift fix(menubar): stop the dock resizing and claiming a refresh it is not doing 2026-09-12 12:19:29 -07:00
FindingsSection.swift Fix timezone handling: menubar UTC bugs, --timezone flag, DST-safe dates 2026-04-30 17:33:02 -07:00
FlameWordmark.swift fix(menubar): keep the wordmark filled under the shimmer and slow the sweep 2026-09-02 10:34:11 -07:00
HeatmapSection.swift Merge pull request #1278 from avs-io/codex/copilot-disconnect-1273-20260909 2026-09-10 08:52:49 +03:00
HeroSection.swift fix(usage): preserve project identity and qualify incomplete session counts 2026-09-07 22:02:54 +05:30
MenuBarContent.swift fix(menubar): the selection fallback showed another provider's totals under the selected tab 2026-09-02 07:55:43 -07:00
ModelsSection.swift Only show the Saved column when local-model savings exist 2026-06-06 22:26:29 +02:00
PeriodSegmentedControl.swift Add multi-day calendar selection with custom popover UI (#393) 2026-05-24 09:49:59 -07:00
PullRequestsSection.swift feat(app,menubar): surface parity — Spend punchcard in the app, Pull requests strip in the menubar 2026-08-10 14:29:26 -07:00
SectionCaption.swift feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
SettingsView.swift feat(codex): notify once when OpenAI banks a limit reset 2026-09-12 14:37:24 -07:00
SparklineView.swift feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
ToolingSection.swift Add tooling breakdowns to CLI and menubar (#373) 2026-05-21 14:38:14 -07:00