Skip to content

feat(ui): ask before archiving sessions with nested sessions - #172489

Merged
steipete merged 3 commits into
mainfrom
steipete/nested-sessions-archive-d66d8c
Oct 15, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/nested-sessions-archive-d66d8c

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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. confirmSessionArchive in 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 returns single, 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-dialog gains showConfirmChoiceDialog(), which shares the existing view, reentrancy guard, and abort handling.

Removed paths: archiveSessionTreeWithUndo, SessionsPageArchive.archiveTree, the archive-tree menu action, the archive submenu and its compact view, SessionMenuData.hasChildren, and the archiveSessionTree / archiveSessionTreeConfirm / archiveSessionOnly strings. The docs are updated in docs/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.

before

After:

after

  • New E2E ui/src/e2e/session-management.nested-archive.e2e.test.ts (3/3 passing): Archive this session patches only the parent, Archive 2 sessions sends one sessions.patchMany (child, then parent), and Cancel patches nothing.
  • Focused unit suites for the archive runtime, batch mutations, confirm dialog, session menu, chat header menu, Sessions page archive outcome/lifetime/tree, and the archive-tree collector: 183/183.
  • Confirm-dialog and session-menu browser tests pass in both Chromium and WebKit.
  • pnpm tsgo:ui, scoped oxlint/oxfmt, and pnpm ui:i18n:baseline + verify all pass (no baseline diff).
  • Codex autoreview (P1): scoped-clean.
  • check:changed reports an environment budget of 455/454. That reproduces on untouched main, so this PR does not cause it.

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.
@steipete
steipete marked this pull request as ready for review October 14, 2026 19:29
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T07:55:40.927144Z bf42105 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@steipete
steipete enabled auto-merge (squash) October 14, 2026 20:10
@steipete
steipete disabled auto-merge October 15, 2026 07:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@steipete
steipete merged commit 86380bb into main Oct 15, 2026
83 checks passed
@steipete
steipete deleted the steipete/nested-sessions-archive-d66d8c branch October 15, 2026 09:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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
steipete added a commit that referenced this pull request Oct 16, 2026
…ounts promoted sessions (#173014)

Follow-up to #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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant