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 7c8f0da0ea gui: the Agents page's hidden agents come last, behind a disclosure shut until opened (0xZaTe on Discord)
0xZaTe (#feedback): after hiding agents, they looked pinned, not hidden
(看着反而像是一个置顶功能了 … 现在反而更显眼了). renderAgents put the
fold's groups in the order [Hidden, Not set up], so once the fold was
opened (its button then reads 「收起」, which is what they saw under Codex)
the hidden rows, each with a Show pill, sat right under the agent in use,
above the ones nothing is set on.

What changed (internal/gui/assets/app.js, app.css, i18n.js):
- In the fold, Not set up comes first. The hidden ones come last, behind
  a line of their own, 「已隐藏(2)」 / "Hidden (2)", with a disclosure
  chevron (right shut, down open), as a Finder sidebar section does. It
  is shut by default (showHiddenAgents), its rows inert while shut, and
  it unrolls on the same curve as the fold, the panel's edge moving with
  it (fit) and the view following (unrollInView).
- The fold's button counts only the ones nothing is set on ("Show 3
  more"), no longer "Show 5 more (2 hidden)".
- With nothing but hidden ones folded, the fold is theirs: no second
  disclosure inside it, its button still reads "{n} hidden agents", and
  opening it leaves the hidden rows open, so Show on one of them doesn't
  shut the rest behind a new line once another goes under Not set up.
- New strings in zh, zh-TW, ja, de; the unused "Show {n} more ({h}
  hidden)" is dropped.

Siblings checked: the window and the tray panel draw the Agents list
with the same code, so both get it. The Usage page's hidden clients are
already a shut "{n} hidden" line under the list. The panel's Arrange
(usage tab) is an edit mode that lists every subscription with Show/Hide
in place, as iOS's edit lists do, so it is left as is. The model picker
is a checklist.

Tests:
- new agents-hidden-last.test.cjs: the reporter's list (Codex connected,
  two hidden, three not set up). Order of the fold, the hidden rows out
  of sight and inert until their line is opened, then shown under it
  with Show, the button's count, no sideways scroll. Window at 420px and
  the tray panel at 380px, Chromium and WebKit, en/zh/zh-TW/ja/de, plus
  the hidden-only case. Run against the old app.js/app.css/i18n.js it
  fails on the order ([Hidden, agy, commandcode, Not set up, ...]).
- hidden-agent-cleared and rollup-short updated for the new order and
  count.

Run (macOS, playwright 1.62.0, both engines): agents-hidden-last,
hidden-agent-cleared, rollup-short, show-unset-agent, fold-show-grip,
agent-grip, grip-inset, panel-fold, panel-arrange, panel-effort,
panel-profiles, click-scroll, usage-agents-hide, removed-hide,
i18n-keys, gui-zh-tw, gui-ja, gui-de, lightweight and every agent-*
test: all green. go test -tags nogui ./internal/gui/ ok; gofmt -l clean;
go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./... clean. Screenshots of the window and the panel in zh checked by
eye. Not run: the whole GUI suite (no shared class or API changed).
2026-10-12 22:27:20 +08:00
yetone 0376ddfb55 gui: folding a list shorter than the window no longer flips the view for 4 seconds (#355) — with Reduce motion on, collapsing a list that ends above the window's bottom made hold and fitRoom undo each other every frame: the room was sized from scrollHeight, which never falls below the view, so the blank under the list counted as content. The room is now sized from where the content really ends, and dropped once back at the top. rollup-short.test.cjs (Chromium, WebKit, en/zh, Reduce motion on and off) fails without the change; old-webkit, click-scroll, panel-fold pass. 2026-10-01 11:28:52 +08:00