Repository navigation
feat(ui): ask before archiving sessions with nested sessions - #172489
Conversation
Archiving a persistent session with live nested sessions now opens one choice dialog at every entry point (sidebar row button, sidebar menu, chat header, Sessions page): archive only this session (nested sessions move to the top level), archive the whole tree, or cancel. Replaces the separate Archive session and children submenu.
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a60d51f151
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf4210599c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Merged via squash.
|
…w#172489) * feat(ui): ask before archiving sessions with nested sessions Archiving a persistent session with live nested sessions now opens one choice dialog at every entry point (sidebar row button, sidebar menu, chat header, Sessions page): archive only this session (nested sessions move to the top level), archive the whole tree, or cancel. Replaces the separate Archive session and children submenu. * test(ui): accept optional mock request params in nested archive e2e * test(ui): type nested archive fixtures as gateway rows
…ounts promoted sessions (openclaw#173014) Follow-up to openclaw#172489 review: the sidebar hint now also counts unloaded worker branches (childLoadParentKeys), and the dialog copy counts only direct children, the sessions that actually move to the top level.
What Problem This Solves
Clicking archive on a session that has nested sessions archives the parent with no prompt. Its children silently fall back to the top level, and archiving the whole tree is hidden behind a separate Archive → Archive session and children… submenu.
User Impact
User impact: archiving a session that has nested sessions now asks Archive session?, the same way Claude desktop does. You choose Archive this session (the parent is archived and its nested sessions move to the top level), Archive N sessions (the whole tree is archived, with Undo), or Cancel. This works the same from the sidebar archive button, the sidebar menu, the chat header menu, and the Sessions page. The separate "Archive session and children…" menu entry is gone. Sessions without nested sessions behave exactly as before.
Why This Change Was Made
Archive scope belongs in the archive action itself, not in a second menu entry.
confirmSessionArchivein the archive runtime is now the single owner. It looks up the descendant tree only when the caller already knows the row has children, so archiving a leaf session adds no Gateway reads. It then returnssingle,tree, or cancelled. The choice dialog carries the active-work warning, so there is no second running-session confirm. Tree archives reuse the existing guarded descendant-first batch with Undo.confirm-dialoggainsshowConfirmChoiceDialog(), which shares the existing view, reentrancy guard, and abort handling.Removed paths:
archiveSessionTreeWithUndo,SessionsPageArchive.archiveTree, thearchive-treemenu action, the archive submenu and its compact view,SessionMenuData.hasChildren, and thearchiveSessionTree/archiveSessionTreeConfirm/archiveSessionOnlystrings. The docs are updated indocs/web/control-ui/sessions-and-sidebar.md.Evidence
Before (mocked Gateway): one click archives the parent and shows only a toast; nothing asks about the nested session. The child row disappears here only because the mock's sessions list is static; on a real Gateway it moves to the top level.
After:
ui/src/e2e/session-management.nested-archive.e2e.test.ts(3/3 passing): Archive this session patches only the parent, Archive 2 sessions sends onesessions.patchMany(child, then parent), and Cancel patches nothing.pnpm tsgo:ui, scoped oxlint/oxfmt, andpnpm ui:i18n:baseline+ verify all pass (no baseline diff).check:changedreports an environment budget of 455/454. That reproduces on untouched main, so this PR does not cause it.