Commit Graph
3 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 c9c28aa586 gui: a gateway key list that can't be read keeps saying so in its card, and one read before stays
Found beside HarriesChen's report: when /api/caller-keys failed,
loadGatewayKeys put the error straight into #gatewayKeys, and the page's
next redraw (renderGatewayKeys from renderGatewayView, the providers'
poll) wiped it, since it returns early while no list was read. A failed
re-read also replaced a list already shown with the error.

gatewayKeysErr now holds why a never-read list failed, and
renderGatewayKeys says it in the list's card (styled like the empty line
by the previous commit). A list read before stays, and the error goes to
the status line. A read that works clears it.

Run:
- gateway-keys-empty.test.cjs: the unreadable case (past a
  renderGatewayView redraw) and the read-before case, both engines: green;
  with keys.js from main both red (".none" never visible; the 3 keys gone).
  All 22+2 of the file green with the change.
- The whole GUI suite was still running at push time (see the previous
  commit); not in this record.

Not tried: a real failing gateway (only the fixture's 500).
2026-10-25 13:04:41 +08:00
yetone 5046e4fc84 gui: no gateway key yet is said muted and inset in its card, as Recent calls says none (HarriesChen on Discord)
HarriesChen (#feedback, 10-25), magpie web on an iPhone: under Gateway
keys, "No gateway keys yet" was drawn in the body's own text (14px, the
foreground colour) flush against the edges of its white card. The
`.none` line inside `#gatewayKeys > .accts` had no rule: `.accts` gives
its rows padding through `.acc`, and the empty line isn't one.

`#gatewayKeys .none` now takes the look of the same page's Recent calls
empty line: muted colour, 11.5px, line-height 1.45, inset 13px 14px in
the card. The page's other empty lines (Recent calls, Models' "No models
match") already had rules and are unchanged.

Run:
- Reproduced at 390x844, magpie web (bootPrefs web), Chromium and WebKit,
  light and dark: before, colour rgb(28,28,33) / rgb(237,237,241), 14px,
  padding 0; after, rgb(133,133,141) / rgb(139,139,148), 11.5px, 13px 14px,
  equal to #activity .none in each. Screenshots looked at.
- New gateway-keys-empty.test.cjs (390px, web, both engines, en, zh,
  zh-TW, ja, de, light and dark): 20/20 green; with app.css from main
  20/20 red (colour, size, inset). fixtures/caller-keys.cjs takes
  options.keys.
- go test -tags nogui ./internal/gui -run 'Budget|Asset|I18n|CSS': ok
  (no budget raised).
- The whole GUI suite (node --test --test-concurrency=2 tests/*.test.cjs,
  both engines) was started at 687c3645f's tree and was still running
  when this was pushed (owner: ship at once). Its result is not in this
  record.

Not tried: a real iPhone Safari; the Go suite (only CSS and GUI tests
change).
2026-10-25 13:04:41 +08:00