Commit Graph
2 Commits
Author SHA1 Message Date
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone 29afe38797 gui: a Codex card's Auto-use resets and Use credits fold to one line in the menu bar panel (#2356, detail47)
detail47: "Codex占用过多界面空间,导致其他供应商被遮挡". In the panel's
Usage tab a named Codex account's card always drew both options in full:
the "Auto-use resets:" say with its two cases and switches, then the
"Use credits:" row, four lines under the rings that the window's Usage
page hides on a brief account but the panel had no way to.

panelQuotaCard now puts a chevron on the first options row, the same
chevron, size and turn as the Usage page's account fold. Clicked, the rows
fold to one line saying how each is set: "Auto-use resets: when its week
runs out · Use credits: On" (On / Off, or the one case on), with the
chevron to open them again. Open until the user folds it, so nothing
changes for anyone who doesn't; kept per card id in localStorage
(magpie.panelOptsFolded, read and written in try/catch). The click keeps
the focus on the chevron and doesn't move the panel. No new strings:
Fold, Unfold, On, Off and the options' own words are translated already.

Run:
- internal/gui/tests/panel-options-fold.test.cjs (new), Chromium and
  WebKit, en/zh/zh-TW/ja/de, 440 and 360px: 10/10. Open by default with
  both rows; folded, the line's words, aria-expanded/title, focus kept,
  card shorter, line fits the card, nothing scrolled; kept over a
  reload; unfolded, the credits switch still posts and the folded line
  then says Off; no left-border accent; every key translated.
- codex-credits, codex-auto-reset, codex-resets-used, panel-usage,
  panel-arrange (both engines, all their languages): all pass.
- Broke by hand: without the localStorage write the test fails at
  "kept over a reload"; with the line always saying On/Off it fails on
  the line's words. Both restored.
- Looked at the open and folded screenshots (WebKit, zh, 360px).

Not tried in the real tray panel on a Mac.

Full suite: SUITE_LINE
2026-10-15 23:08:02 +08:00