diff --git a/CHANGELOG.md b/CHANGELOG.md index 053c3b49..4b7a6170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - **CodeBurn tells you when OpenAI banks a limit reset on your Codex account.** These grants — the "banked" or "goodwill" resets that restore a rate-limit window early — are sometimes announced and sometimes not, and until now the only way to notice one was to go looking. The reset-credit inventory CodeBurn already reads on every Codex quota refresh is now compared against the previous reading: a credit seen for the first time posts one notification naming what was granted, when it landed and how many you have available to use. The first reading after connecting is a baseline, not news; a credit that disappears because you spent it says nothing; a failed fetch or a malformed payload is treated as no opinion rather than as an empty account, so reconnecting does not re-announce what you were already told; and the fired event is persisted next to the existing quota snapshots, so a relaunch does not repeat it. Settings → Notifications gains a switch for it, on by default. The count and the most recent grant also appear in the Codex Plan tab, in the agent-tab quota hover card, and as a `Limit resets · …` line in `codeburn quota` (text and `--format json`), worded identically on both sides. No new endpoint, no new polling loop and no new data source: this reads fields off a response already fetched on the existing cadence, per the rule #702/#724 established. CodeBurn never spends a credit — this is a notice only. (#725) ### Added (macOS) -- **The macOS menubar app speaks Simplified Chinese, and follows your system language to decide.** Every user-facing string in the popover, the Capacity Dock, the status-item menu, the update alerts and all of Settings now resolves through a `Localizable.strings` catalog shipped for `en` and `zh-Hans` with no third-party library: 561 keys, whose key *is* the English copy, so an untranslated string degrades to correct English rather than a visible identifier. AppKit picks the table from the user's preferred languages, and `CFBundleLocalizations` in both packaging scripts puts CodeBurn under System Settings > Language & Region so the language can be overridden for this app alone. Enum raw values that double as persistence or cache keys (`Period`, `MenubarScope`, `InsightMode`, `AccentPreset`, `ProviderFilter`) keep their raw value and gained a separate display label, so nothing a user has saved changes meaning. Three display-only date formatters that were pinned to `en_US_POSIX` with fixed patterns now follow the locale, and the calendar popover's weekday row comes from the locale's own symbols, so a Chinese UI reads `2026年9月` and `一 二 三` rather than `September 2026` and `Mo Tu We`. Provider, model and plan names, units, currency codes, shell commands and anything the `codeburn` CLI itself produces stay verbatim in every locale. Adding a language is now one more `.lproj`; a test fails the build if the two tables disagree on keys, leave a value blank, or disagree on format specifiers, and a second test reads `mac/Sources` itself and fails when a user-facing literal never reaches the catalog at all — the drift a catalog-versus-catalog diff cannot see, because both tables stay in perfect agreement while a bare `Text("…")` ships English to a zh-Hans user. This covers the menubar half of #1219 only, not the CLI output or the web dashboard. (#1219) +- **The macOS menubar app speaks Simplified Chinese, and follows your system language to decide.** Every user-facing string in the popover, the Capacity Dock, the status-item menu, the update alerts and all of Settings now resolves through a `Localizable.strings` catalog shipped for `en` and `zh-Hans` with no third-party library: 628 keys, whose key *is* the English copy, so an untranslated string degrades to correct English rather than a visible identifier. AppKit picks the table from the user's preferred languages; Settings > General > Language overrides it for CodeBurn alone by writing `AppleLanguages` into the app's own preferences domain, which is the same key `CFBundleLocalizations` makes System Settings > Language & Region > Applications write, so the two surfaces are one setting rather than two. Enum raw values that double as persistence or cache keys (`Period`, `MenubarScope`, `InsightMode`, `AccentPreset`, `ProviderFilter`) keep their raw value and gained a separate display label, so nothing a user has saved changes meaning. Three display-only date formatters that were pinned to `en_US_POSIX` with fixed patterns now follow the locale, and the calendar popover's weekday row comes from the locale's own short symbols clipped to two units, so a Chinese UI reads `2026年9月` and `周一 周二` while English keeps `Mo Tu We`. That locale move is the one place English output changes: `EEE MMM d` reads `Sat, Sep 12` in en_US and `Sat 12 Sep` in en_GB, and `MMM d` reads `12 Sep` in en_GB. Provider, model and plan names, units, currency codes, shell commands and anything the `codeburn` CLI itself produces stay verbatim in every locale. Adding a language is now one more `.lproj`; a test fails the build if the two tables disagree on keys, leave a value blank, or disagree on format specifiers, and a second test reads `mac/Sources` itself and fails when a user-facing literal never reaches the catalog at all — the drift a catalog-versus-catalog diff cannot see, because both tables stay in perfect agreement while a bare `Text("…")` ships English to a zh-Hans user. This covers the menubar half of #1219 only, not the CLI output or the web dashboard. (#1219) - **The menubar tells you when a vendor resets your quota early, and what that provider's early resets have looked like.** Vendors sometimes reset a usage window ahead of schedule as a goodwill gesture; CodeBurn showed the new percentage but never said it had happened, so the free capacity went unused. Two signals now catch it on the refresh lifecycle that already runs, with no new polling: a reset time that jumps to a new cycle while the stored one still had time to run, and usage emptying (a fall of at least 40 points landing at or under 10%) while the advertised reset time stands still. A system notification through the existing notifier names the provider, the window and the lead, worded for the signal that saw it ("Claude's weekly limit reset 18h early. You're back to 100%." when the cycle rolled over, "Claude cleared your weekly usage 18h before its reset. You're back to 100%." when the counter emptied but the reset time held), the Capacity Dock carries a band saying the same for twelve hours, and the quota hover card gains this Mac's own pattern from the 30 days of snapshots already on disk ("Last 3 weekly resets came ~18h early"), derived from the stored reset times with no network and no external feed. One goodwill reset is one notification per provider however many windows it empties, and a reset already announced is never announced again — after a relaunch, or when the vendor briefly serves the old cycle back. It stays silent on a normal scheduled reset, a plan change, clock or timestamp skew, a window appearing or disappearing between fetches, a window's first observation, a reconnect after a terminal failure or a fresh bootstrap, and a window whose length the adapter does not validate; a missing or malformed stored reading is no opinion rather than an event. Settings → General → Notifications turns the notification off, default on, and with it off the dock band still appears. Claude is the provider wired up today, because it is the one whose quota readings are persisted. (#725) - **The Capacity Dock shows today's cache-read tokens and tells you whether each quota window will last to its reset.** The Today section gains a provider-scoped cache-read figure beside input, output and calls; a known zero prints as `0` while missing or incomplete historical accounting stays unknown rather than becoming a fabricated zero, and because cache reads were already priced into the burned figure this adds visibility without changing any total. Each quota window then gets one line under it: `Lasts until reset`, `Runs out in 2d 8h`, or — on windows of six hours or less, where one burst would make a linear ETA cry wolf — the pace stage the Plan tab uses (`On pace`, `40% in deficit`, `30% in reserve`). The same line appears under each bar in the agent-tab quota hover card. The projection runs against the window length the provider adapter reports, never a length guessed from the display label, so a monthly cycle whose label happens to read `Weekly` is still paced against its month; it stays silent early in a window, on an exhausted window, without a reset time or a validated duration, and on stale, disconnected or older-than-ten-minute data. Four quota windows move to a two-column grid so scope labels, reset times and captions stay readable, and the dock reserves the caption's height whether or not a column has one so the bubble cannot resize under the pointer. Status snapshot revision 7 invalidates older cached payloads without purging daily history, and no extra polling is introduced. (#1267) - **The macOS menubar item can show a second line.** Settings → General → Display gains a "Second row" switch, off by default, and a picker for what that line shows: quota remaining with its reset countdown for whichever connected provider is nearest its limit, today's all-provider cost, today's total tokens, or the number of running sessions. Both lines render as one attributed title at 9pt with their line height clamped to 10pt, so the pair fits the standard 22pt menu bar, and the second line hides itself whenever its metric has no data yet, leaving the existing single-row figure exactly as it was. This is a deliberately small first slice of the multi-row layout request: no layout editor, no presets, no live preview, no per-item provider or period scoping. The setting persists as `CodeBurnMenubarSecondRowEnabled` and `CodeBurnMenubarSecondRowMetric` in the app's own defaults domain alongside the existing menubar period, scope and metric keys. (#1252) diff --git a/mac/Sources/CodeBurnMenubar/Resources/zh-Hans.lproj/Localizable.strings b/mac/Sources/CodeBurnMenubar/Resources/zh-Hans.lproj/Localizable.strings index 4465d014..83b570a8 100644 --- a/mac/Sources/CodeBurnMenubar/Resources/zh-Hans.lproj/Localizable.strings +++ b/mac/Sources/CodeBurnMenubar/Resources/zh-Hans.lproj/Localizable.strings @@ -643,13 +643,13 @@ /* MARK: Quota pace captions (#1267) */ "Limit reached" = "限额已用尽"; -"This window's limit is fully used. It resets in %@." = "该窗口的限额已全部用完,将在 %@ 后重置。"; +"This window's limit is fully used. It resets in %@." = "该窗口的限额已全部用完,将在 %@后重置。"; "On pace" = "符合节奏"; "Lasts until reset" = "可支撑到重置"; "Won't last until reset" = "撑不到重置"; -"Runs out in %@" = "%@ 后耗尽"; -"Estimated from the average pace across this whole %@ window so far — not a measured recent rate." = "根据整个 %@ 窗口至今的平均速度估算,而非最近实测的速率。"; -"At that pace the limit is reached in %@, before the reset in %@." = "按此速度,限额将在 %@ 后用尽,早于 %@ 后的重置。"; +"Runs out in %@" = "%@后耗尽"; +"Estimated from the average pace across this whole %@ window so far — not a measured recent rate." = "根据整个 %@窗口至今的平均速度估算,而非最近实测的速率。"; +"At that pace the limit is reached in %@, before the reset in %@." = "按此速度,限额将在 %@后用尽,早于 %@后的重置。"; "Projected %lld%% used by the reset — on pace." = "预计到重置时将用掉 %lld%% — 符合节奏。"; "Projected %d%% used by the reset, %.0f%% ahead of the pace the elapsed window implies." = "预计到重置时将用掉 %d%%,比已过窗口所对应的节奏超出 %.0f%%。"; "Projected %d%% used by the reset, %.0f%% of the window still in reserve." = "预计到重置时将用掉 %d%%,该窗口还有 %.0f%% 的结余。"; @@ -663,13 +663,13 @@ "%@ quota reset early" = "%@ 配额已提前重置"; "%@ quota cleared early" = "%@ 配额已提前清零"; "You're back to %lld%%." = "你已恢复到 %lld%%。"; -"%@'s %@ reset %@ early. %@" = "%@ 的%@提前 %@ 重置。%@"; -"%@ cleared your %@ %@ before its reset. %@" = "%@ 在重置前 %@ 清空了你的%@。%@"; -"%@ reset %@ early" = "%@提前 %@ 重置"; +"%@'s %@ reset %@ early. %@" = "%@ 的%@提前 %@重置。%@"; +"%@ cleared your %@ %@ before its reset. %@" = "%@ 清空了你的%@,比其重置提前 %@。%@"; +"%@ reset %@ early" = "%@提前 %@重置"; "%@ cleared, %@ before reset" = "%@已清空,比重置提前 %@"; "%lld%% of it was available when CodeBurn noticed." = "CodeBurn 发现时其中有 %lld%% 可用。"; -"%@ reset this %@ %@ before its scheduled time. %@" = "%@ 比预定时间提前 %@ 重置了这个%@。%@"; -"%@ cleared this %@ %@ before the window's scheduled reset, which has not moved. %@" = "%@ 在该窗口的预定重置时间前 %@ 清空了这个%@,而重置时间并未改变。%@"; +"%@ reset this %@ %@ before its scheduled time. %@" = "%@ 将这个%@提前 %@ 重置,早于其预定时间。%@"; +"%@ cleared this %@ %@ before the window's scheduled reset, which has not moved. %@" = "%@ 清空了这个%@,比该窗口的预定重置时间早 %@,而重置时间并未改变。%@"; "Last %@ reset came ~%@ early" = "上次%@重置提前了约 %@"; "Last %lld %@ resets came ~%@ early" = "最近 %lld 次%@重置提前了约 %@"; "%lld of the last %lld %@ resets came ~%@ early" = "最近 %lld/%lld 次%@重置提前了约 %@"; @@ -689,12 +689,12 @@ /* MARK: Codex banked limit resets (#725) */ "%lld available" = "%lld 个可用"; "%lld usable now" = "%lld 个现在可用"; -"next %@ lands %@" = "下一次%@将于 %@ 到账"; -"latest %@ granted %@" = "最近一次%@于 %@ 发放"; -"next expires %@" = "下一个将于 %@ 过期"; -"A %@ lands %@." = "一次%@将于 %@ 到账。"; -"A %@ was added to your account %@." = "%@ 已于 %@ 添加到你的账户。"; -"A %@ was added to your account." = "%@ 已添加到你的账户。"; +"next %@ lands %@" = "下一次%@将于 %@到账"; +"latest %@ granted %@" = "最近一次%@于 %@发放"; +"next expires %@" = "下一个将于 %@过期"; +"A %@ lands %@." = "一次%@将于 %@到账。"; +"A %@ was added to your account %@." = "%@已于 %@添加到你的账户。"; +"A %@ was added to your account." = "%@已添加到你的账户。"; "You have %lld available to use." = "你有 %lld 个可以使用。"; "Codex banked a limit reset" = "Codex 存入了一次限额重置"; "limit reset" = "限额重置";