usage: a table's provider with several accounts is one folded row; an empty Account column is left out (#6740, jay68xu on X)

jay68xu on X: the Usage page gets hard to scan with many providers and
accounts. This change covers the table view only, as the issue's comment asks.

In the Allowances table (Usage > Overview, Table), a provider with
several accounts is now one row. The row shows the chevron, the
provider's icon and name, "N accounts" (a string every language already
has), and each window column's mean share over the accounts. A failed
read counts for nothing in the mean. The provider's accounts sit under
it, folded until the row (or its button, with Enter or Space) is
clicked. Each provider's open state is kept in localStorage
magpie.quotaTableOpen, the way the cards' folds are kept. A provider
with one account is one row, as before. Sorting orders accounts within
a provider, then providers by their mean (window columns) or by their
first row. The Account column is left out when no row names an account.
Window columns and Other already appear only when some row has one.
There is no motion: a toggle redraws the table, and the chevron turns.
app.js is untouched (quotatable.js loads lazily), and there are no new
strings.

Run at this tree (base origin/main d99762075):
- usage-table-groups.test.cjs (new, 40 tests: both engines x en, zh,
  zh-TW, ja, de x 1100px and 420px): all 20 chromium cases are red on
  the old quotatable.js and app.css (0 pass, 20 fail).
- The 4 table files (usage-table-groups, usage-quota-table,
  usage-table-acct-lines, usage-account-subcards), both engines, on
  mote: 102 pass, 0 fail.
- Every usage-*.test.cjs plus i18n-keys and i18n-en-no-cjk, both
  engines, on mote: 1597 pass, 106 fail. All of the reds are in 11
  files that don't touch the table. Run alone, those 11 files give the
  same not-ok list on this tree and on origin/main d99762075 (diffed).
  Their issues are #3414, #6003, #6294, #3415, #2163, #6295, #4263,
  #5048, #6499 and #5834. The three files with no issue were filed as
  #6743 (usage-chart-line, usage-upload, usage-quiet-refresh).
- go test ./internal/gui/ on mica: ok (153.8s), which includes
  TestCoreScriptBudget. The budget was not raised.
- gofmt -l: clean (no Go changed).

Not tried: the real app, WebKitGTK on Linux, Windows, real accounts.
The issue's 代理出口 and 管理页 columns aren't magpie's. No GUI table
or i18n string has them.
This commit is contained in:
yetone
2026-11-15 15:54:29 +08:00
parent d997620752
commit 5bccfb4ef2
7 changed files with 304 additions and 54 deletions
+10 -2
View File
@@ -394,9 +394,17 @@ beside an empty Gemini one). A pooled window goes to its pool's column
(`poolWord`, "Claude & GPT" under Claude), naming its window in the cell;
any other window goes by its span (`spanOf`: "Weekly", "7 days" and "7d"
share one column, headed by the name most rows use, a number on a tie),
and a window with no span by its name. It
and a window with no span by its name. A provider with several accounts
(grouped as its card groups them) is one row (jay68xu on X, #6740): its
name, how many accounts, and each column's share averaged over the accounts
that have one; its accounts are rows under it, without the provider's name
again, folded until the row is clicked. What is open is kept by provider in
localStorage `magpie.quotaTableOpen`. Sorting orders providers by that mean
(a name or account by its first account) and accounts within each. A column
no row fills is left out (Account when no account is named; the window
columns and Other only exist when some row has one). It
scrolls in its own box at a narrow width, the subscription held at the left.
See `usage-quota-table.test.cjs`.
See `usage-quota-table.test.cjs` and `usage-table-groups.test.cjs`.
### The Sessions page's folders