Commit Graph
3 Commits
Author SHA1 Message Date
yetoneandRick Chan f95bacdfba gui tests: agent-panel-name-width's lists tick two models, as menuSaid names them (#4203)
The fixture gave WorkBuddy's and Claude Desktop's lists `shown`/`total`,
but /api/state counts them as `listed`, and since 6915c8cde menuSaid
names a list's models only while one or two are ticked. So the rows read
"Showing 3 / undefined models", words too short to cut, and every case
failed at "workbuddy's words not cut" on macOS and Linux alike. The
reporter's two long names were never drawn, so the test no longer
checked #2447. Each list now ticks two of its `listed` 3 and 9.

Cause and patch by R1cK-ChaN on #4203 (c99d001 on their fork), ported
as written.

Run at origin/main ea51526b6 on mote (macOS 27, Playwright 1.62.0):
- agent-panel-name-width.test.cjs alone, chromium and webkit: 0/32
  before, 32/32 after.
- Broken by hand: #2447's grid put back (20px minmax(0, 1fr) auto) with
  this change, chromium: 0/16, "en 550: workbuddy's name cut to
  26.5px of 76", "en 440: ... 0px of 76".
Not run: the whole GUI suite (another session's full GUI suite was on
mote); a test fixture only, no app code changed.

Co-authored-by: Rick Chan <rick.chan.zhikun@gmail.com>
2026-11-02 18:40:31 +08:00
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 0f391a7a71 gui: a panel row's name keeps its width beside a long model summary (#2447)
EdwinDigital: in the tray panel, WorkBuddy's row said its models in words
("gpt-6.1-sol · Microsoft Foundry, claude-opus-5-5 · Microsoft Foundry +1"),
and the words took the row: the name was squeezed to 10px at 550px and to
nothing at 440px and below, or at any width once the pointer came onto the
row and the model's logo eased in. The row's columns were 20px, a name in
minmax(0, 1fr) and the words in auto, so the words claimed their whole
width and the name gave way.

Now the name's column is fit-content(60%): it keeps its own width, up to
60% of the row, and the words take what is left and cut first (.vt already
ellipsizes). The words sit at the row's end (justify-self: end), so their
effort bars and chevrons stay in one column down the list. It holds for
every panel row with a summary (a model list, one model's label, import,
launch, CLI not found), not WorkBuddy alone.

Name width, WorkBuddy / Claude Desktop, before -> after, chromium and webkit
the same: 550px 10.05 / 8.09 -> 76.05 / 103.92; 440px and 360px 0 / 0 ->
76.05 / 103.92; hovered the same after.

Run at 0cad76cd9:
- agent-panel-name-width.test.cjs (new): chromium and webkit; en, zh,
  zh-TW, ja and de; 550, 440 and 360px; hovered and not. Each name is
  whole, the words are after it and inside the row, right edges line up,
  the model lists are cut, and nothing scrolls sideways. 32/32 pass. With
  HEAD's app.css it fails 32/32 (name 10.05px at 550, 0 below).
- GUI, every file that renders the panel or an agent row (101 files,
  4-wide): # tests 1390, pass 1387, fail 3. The 3 reds also fail at HEAD
  without this change, run alone: key-balance-card chromium de
  (view-usage 570>560, #2443) and usage-fold chromium en/zh (the view
  didn't scroll, 184 !== 180, #2163).
- The whole GUI suite (780 files) was not run.
- gofmt -l clean; GOOS=darwin/linux/windows go vet -tags nogui ./... ok;
  go test -tags nogui -timeout 45m ./internal/gui/... ok (385.6s).
2026-10-16 04:54:34 +08:00