Commit Graph
2 Commits
Author SHA1 Message Date
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