Commit Graph
5 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 3d56822d41 gui: a provider's editor grows from where its row was pressed
The owner (10-24, 点击这里,然后放大弹窗的时候,应该从点击处可放大吧):
pressed past its name, a provider row's editor grew from the row's left
end, its logo and name, not from the press. Pressed on the logo itself
(the row's drag handle), it didn't grow from the row at all: the handle
was recorded with no way to find it again once the row was drawn anew,
so the dialog opened with no morph.

The press now keeps its x. rowOwnRect still takes a strip the size of
the logo and name, and when the press is past them it centres that strip
on the press, inside the row. A press on .pv-handle counts as the row's.
Closing goes back to the same strip.

Run (darwin, chromium and webkit, on d0a54d74a's calm() refactor):
- modal-morph: 6/6 ok at 1240 and 420px. Its first open now presses the
  logo, and a new case presses at 62% of the row and checks the strip:
  centred within 3px of the press, as wide as the first one, inside the
  row, closing back to it. Broken by hand: without the handle mapping,
  red at "opening clips the dialog: none"; without the centring, red at
  "again: the strip centred on the press".
- modal-centred-late 6/6, group-morph 22/22 ok.
- go test ./internal/gui -run TestCoreScriptBudget: ok, with no room
  added (calm() made the room).
Not run: the whole GUI suite (load ~400 on the box); the real Wails app.
2026-10-24 20:12:27 +08:00
yetone c8c6e7e23f gui tests: modal-morph measures the provider row once the list is still
Chromium at 420px read the row 1 to 5px off the strip the dialog grew
from (401 vs 404-406), red 4 of 4 here on db48697d6 and on its parent:
the list's rows were still coming in when the row was measured. The
test now waits until the row's top is the same 100ms apart.

Run: modal-morph.test.cjs chromium 3 of 3 green (was 0 of 4), webkit
green. The app is unchanged.
2026-10-23 16:49:06 +08:00
yetone 1b9b97f8db gui: a provider's dialog grows out of its icon and name, as an add sheet tile's does
The owner, 10-21: the provider editor's opening was stiff ("太生硬"), and
the add sheet's, opening a vendor's tile, is the one to follow. Both run
through openModal's morph, but a tile is narrower than the dialog, so the
dialog starts shrunk to it (scale ~.4) and zooms out; a provider row is
wider than the dialog, so the scale stayed 1 and the dialog opened as a
full-size strip widening over the row, its text at full size from the
first frame.

A provider row is now measured as a tile: from its left edge to where
its name and host line's words end (rowOwnRect, the text nodes' extents;
a range over the block spans its whole width), the row's height. The
dialog grows out of that and folds back into it, as a tile's does.

Run on origin/main b855cfee9 + this commit, macOS, playwright 1.62.0:
- modal-morph.test.cjs: 6/6 chromium and webkit, 1240 and 420px. Its new
  checks (starts at the row's left, ends before the words do, scale < .8;
  closes into the same) are red on the old app.js: chromium 1240 and 420
  fail.
- frames held at 8/16/30/50% of the opening and closing, row beside the
  add sheet's Custom provider tile, looked at side by side.
- go test ./internal/gui/ -run Budget ok; gofmt -l clean.

Shipped at the owner's word (10-21, "赶紧上线") before the full GUI suite
finished: it was stopped at ~2,040 passing tests (about a quarter of the
files, on b855cfee9 + the dialog change), with two reds,
desktop-longest chromium zh 640px and gateway-key-groups chromium en,
both under load at ~100. On origin/main c79400556 + both commits (rebased after onto
e68a0b1db, which adds only internal/sessions):
desktop-longest, gateway-key-groups, modal-morph, lightweight,
segs-glide, segs-press-redraw and settings-general 108/108 in chromium
and webkit; go test ./internal/settings/ ok; go test ./internal/gui/
-run 'Budget|Lightweight' ok; gofmt -l clean; GOOS=linux go vet -tags
nogui and GOOS=windows go vet of internal/settings and internal/gui.
Not run: the rest of the GUI suite.
2026-10-21 18:45:23 +08:00
yetone d9d1680ab6 gui: a dialog grows out of the row that opened it and folds back into it
The owner, 10-20: a provider's editor "从右上角弹出" and should open from
the provider's row and close back into it, as iOS does. openModal scaled
the dialog from the row's rect, but a row is wider than the dialog, so
scale alone left a full-size dialog sliding in from the row's middle.

Now the dialog starts as a strip the row's size (transform plus a
clip-path inset, morphFrom), grows into the dialog on the spring, and
closeModal runs it back into the row. The backdrop fades its own
background and blur (VEIL_OFF) instead of the modal's opacity, which
faded the dialog with it, so a dialog folding back stays visible until
it lands. A ResizeObserver keeps the start on the row when an editor
settles its size after it was measured. Reduced motion still only fades.

Every page's dialogs open through the core, so app.js's budget rises
(1,271,683 bytes).

Run on origin/main 75e769a9f + this commit, macOS, playwright 1.62.0:
- modal-morph.test.cjs (new): 6/6, chromium and webkit at 1240 and 420px;
  it fails without the change in webkit.
- gofmt -l clean; go test ./internal/gui/ -run TestCoreScriptBudget ok.
- Full GUI suite (814 files, --test-concurrency=4) on this commit with
  the two after it, on 75e769a9f before the rebase: 11,385 pass, 90
  fail. The morph's own reds (modal-morph chromium 1240 and 420) were
  under load: 6/6 run alone on the rebased head. The rest are the agent
  settings commit's (fixed there) or red alone on origin/main a9304efe0
  too: codex-predictions 420px (#2624), quota-count-wrap and
  quota-name-translated (#2228), routing-bodies, routing-request-metrics,
  s3-sync (#2658), usage-agents-hide, usage-fold (#2399), usage-checkin
  webkit and rail-tip (#3091). agy-launch and name-suffix-remote were red
  only in the full run and pass alone.
- An earlier full run on this commit alone was cut short, not finished.
2026-10-21 02:06:18 +08:00