Commit Graph
1 Commits
Author SHA1 Message Date
yetone 5b9bfe407c gui: the tray panel's Allowances tab folds what has nothing left behind "{n} at 0" (runking on Discord)
.runking on Discord: "额度面板那里能不能那些额度是 0 的可以隐藏掉啊 现在我一堆是 0 的".

What counts as at 0 (quotaAtZero): a fresh reading whose every window is used up (or held by another), and whose balance, if any, is 0 or below ("¥0.00", "-$1.20", "$-1.20", "0 credits"). A balance card folds on its own; a vendor's group folds only when every account in it is at 0. Never folded: a failed reading, an old one (asOf), a percent balance part, a text or unlimited window, a window used part way, a Codex account with credits on, reset credits, a check-in, and a card a menu bar cell opened.

Folded cards are not hidden silently: the foot gets "{n} at 0" (pq-more, beside Arrange); a click shows them and the button reads "Fold the ones at 0". The choice is kept in localStorage (magpie.panelZeroOpen). The click doesn't move the page and keeps the keyboard on the button. The Usage page and routing are unchanged. Strings in en, zh, zh-TW, ja, de. No new API call, no CSS.

Run on mote (mote-run):
- node --test internal/gui/tests/panel-zero-fold.test.cjs: 10/10 (chromium and webkit; en, zh, zh-TW, ja, de at 440px).
- The panel-*, quota-*, i18n-*, gui-zh-tw and click-scroll GUI files: 564 pass, 1 fail ("a plugin's words are its own": my first title said "Accounts and keys", the routing plugin's word; reworded). After that: i18n-keys, gui-zh-tw and panel-zero-fold 17/17.
- go test ./internal/gui -count=1: only TestMainWindowCorners/macOS_26_SDK is red, the macOS 27 red already filed as #3949 (AppKit, not touched here). TestCoreScriptBudget and TestAppScriptBudget pass; no budget raised.

Broken by hand:
- The test against origin/main's app.js and i18n.js: 10/10 red ("claude|a@b.c is folded").
- Dropping the asOf and creditsOn guards: chromium 5/5 red ("kimi stays in sight").

Not tried: the real tray panel on macOS, Windows or Linux with real accounts; the whole GUI suite (only the files above; no API call was added).
2026-11-05 12:13:57 +08:00