Commit Graph
4 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 f4640c0aee sessions: an agent's folders are one list, newest first, the temporary ones folded at the end
The Sessions page drew each folder as a boxed group with its checkbox,
path and buttons always showing. Now it is one list, the way Finder's
recents read: a row says the folder's name, where it is (home as ~, from
the manage reply's new `home`), its newest session's title, when, and how
many. Temporary folders, the disk's root and apps' hidden folders under
home wait folded under Other folders at the end; a search or a session
opened from elsewhere unfolds them. Checkboxes and the Delete bar come
only with Select, and Done lets the pick go. Relocate project and Delete
all sessions move into a folder's ⋯ menu (hover, always on touch, and
right-click); Delete all asks in magpie's own dialog.

Asked for by the owner ("这个会话页面其实特别丑"), who approved the design.

Tests: sessions-folder-list.test.cjs (new) checks the order, the ~ path,
the fold and its count, Select/Done, the ⋯ menu's Delete all and its ask,
and no horizontal scroll, in Chromium and WebKit, en/zh/zh-TW/ja/de, at
1000 and 420px. The other sessions tests follow the ⋯ menu and Select.

Run at this head (rebased on 17a2b00ef):
- node --test, 37 GUI files (every sessions*/session*, i18n*,
  checkbox-look, account-mask-sessions, routing-session*,
  usage-session*): 493 pass, 0 fail.
- gofmt -l internal/gui: clean; go vet -tags nogui ./internal/gui: ok;
  go test -tags nogui ./internal/gui: ok (budgets included).
Not run: the whole GUI suite at this head. The last full run (183fa169b,
10-23) had its reds filed (#3402 to #3416 and earlier issues); none is a
sessions file. Not tried in the Wails window on a real machine's sessions.
2026-10-24 02:31:17 +08:00
yetone 0c8c4f4cab sessions: each project folder's row starts with a box, so several folders are picked and deleted together with the bar's Delete, the count still in sessions (mintonight, on #527: 现在这样一次只能删一个项目…在项目文件夹那一行的字首加一个复选框…多选同时删除多个项目,并且还能复用已选 x 项那一行右侧的删除按钮,这个数量 x 的计数逻辑还是按会话数量来,不要把文件夹这个复选框当做一个数) — #527 gave each folder's row a Delete all, which deleted one folder at a time beside the box-and-bar way sessions are deleted. Each folder's row now starts with a box, as each session's row does, where magpie can delete the agent's sessions: ticked, it picks every session of the folder shown, folded or not, and the bar says "{n} selected" (已选 {n} 个) counting those sessions, the folder not one of them; unticked, it lets them go; a session's own box ticked or not part-ticks or ticks its folder's at once; under a filter it picks the ones the filter shows, as the bar's select-all does. Folders and single sessions picked together go with the bar's Delete, which asks in magpie's own dialog as before: a pick that is one whole folder is headed "Delete all {n} sessions in {folder}?" with its path, as Delete all's was; several whole folders "Delete all {n} sessions in {k} folders?" (删除 {k} 个文件夹下的全部 {n} 个会话?); anything else "Delete {n} sessions?". They go to magpie's trash through sessions/delete as before, and one written to in the last minute is left and said so. Delete all is gone from the folder's row: it did what the box and the bar's Delete do, two ways for one thing (the lesson of #526's Close). The box's label is "Select every session in {folder}" (选中 {folder} 下的全部会话); the box doesn't fold the folder or move the page; no left-border accent. sessions-folder-delete.test.cjs now covers the boxes (first in their row, none for OpenCode), a folded folder picked and asked about by name, Cancel posting nothing, two folders and a mixed pick, the part-tick, a filtered pick, the whole of app with its running session refused; it fails without the change (no folder box). sessions-manage, sessions-purge, click-scroll, sessions-toolbar, session-terminal, sessions-bar-names and sessions-overview pass in WebKit. 2026-10-02 20:22:00 +08:00
yetone 6835e8d297 sessions: every session of a project folder can be deleted at once, from the folder's row (#527: 有些codex会话多,有些特别老的项目,希望能直接删除整个项目文件夹下所有会话) — the Sessions page lists an agent's sessions by the folder they ran in, but deleting a folder's took picking each one or the per-row trash one by one. Each folder's row now has Delete all (全部删除, titled "Delete every session in this folder" / 删除这个文件夹下的全部会话; the label folds to its icon under 420px) where magpie can delete the agent's sessions. It opens the same dialog of magpie's own as a delete of picked sessions (never confirm()), headed "Delete all {n} sessions in {folder}?" (删除 {folder} 下的全部 {n} 个会话?) with the folder's path under it, the first titles and how many more, and the note that they go to magpie's trash; the confirm posts sessions/delete with every id of the folder, the path a single delete takes, so each goes to magpie's trash as one deleted alone does (Trash restores it) and one written to in the last minute is left and said so. A filter hiding some of the folder's sessions doesn't keep them: the button is the folder's, and the dialog says how many. A folder of one asks as a single delete does; an agent whose sessions magpie can't delete (OpenCode) has no button; the click doesn't fold the folder or move the page. Deleting 200 of 600 sessions one id at a time took about 0.5 s in a sandbox, so the route is unchanged and there is no Go change. The CLI's magpie sessions only lists sessions and what they cost, with no delete, trash or restore, so no folder delete was added there: deleting from a terminal with nothing to put it back would be a new, one-way thing. sessions-folder-delete.test.cjs (new; WebKit, en and zh): the button on every folder in its row, Cancel posting nothing, a filtered folder's Delete all posting all fourteen ids, a folded folder's two posted and the folder gone with the others kept, the running one left and said so, a folder of one asking as one, none for OpenCode, no click moving the page, no left-border accent, every string in Chinese, no browser dialog; it fails without the change (no Delete all). sessions-manage, sessions-purge, click-scroll, sessions-toolbar, session-terminal, sessions-bar-names and sessions-overview pass in WebKit. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestFXInState and TestUserPath failed once under load, pass on the rerun; untouched). 2026-10-02 15:48:17 +08:00