Skip to content

feat(session): add archive undo + unarchive command#16212

Open
anduimagui wants to merge 9 commits intoanomalyco:devfrom
anduimagui:opencode/lucky-eagle
Open

feat(session): add archive undo + unarchive command#16212
anduimagui wants to merge 9 commits intoanomalyco:devfrom
anduimagui:opencode/lucky-eagle

Conversation

@anduimagui
Copy link

@anduimagui anduimagui commented Mar 5, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a proper unarchive flow and makes archive easy to undo.

What changed:

  • Added desktop menu items for:
    • Archive Session (Cmd+Shift+Backspace)
    • Unarchive Session (Cmd+Shift+U)
  • Added session.unarchive in the app command registry.
  • Added an archive success toast with an Undo action.
  • Fixed the ordering issue on restore: unarchived sessions now go back to their previous spot instead of jumping to the top.
  • Updated backend + SDK types so archived can be cleared (null) and unarchive can preserve the old updated timestamp.

Why this solves it:

  • Archive is now reversible from both keyboard/menu and the toast.
  • Restoring a session keeps list ordering stable, so UX feels consistent.

How did you verify your code works?

  • bun install
  • ./packages/sdk/js/script/build.ts
  • bun run typecheck in:
    • packages/app
    • packages/desktop
    • packages/opencode
  • Push hook also ran bun turbo typecheck successfully.

Screenshots / recordings

Screenshot 2026-03-05 at 18 09 55

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@anduimagui anduimagui requested a review from adamdotdevin as a code owner March 5, 2026 17:52
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, here are potentially related PRs (excluding the current PR #16212):

Related PRs:

  1. feat(session): add lifecycle management — storage reclamation, CLI commands, VACUUM support #16201 - feat(session): add lifecycle management — storage reclamation, CLI commands, VACUUM support

    • Likely related to session archive/unarchive functionality
  2. fix: unarchive session on touch, stop cache eviction on archive #16031 - fix: unarchive session on touch, stop cache eviction on archive

    • Directly related to unarchive behavior and archive handling
  3. feat(app): unarchive sessions #16001 - feat(app): unarchive sessions

    • Similar feature for unarchiving sessions in the app
  4. feat(app): view archived sessions & unarchive #15250 - feat(app): view archived sessions & unarchive

    • Related feature for viewing and unarchiving archived sessions
  5. feat: add session archive/unarchive support to TUI #13961 - feat: add session archive/unarchive support to TUI

    • Related archive/unarchive implementation for TUI
  6. Feat/view archived sessions #6769 - Feat/view archived sessions

    • Earlier related work on archived session viewing

Note: The most recent and relevant duplicates appear to be #16031, #16001, and #15250, which all involve unarchive functionality. You may want to review these to ensure the work doesn't overlap or cause conflicts.

@anduimagui
Copy link
Author

This builds on the same unarchive groundwork from related PRs, but the main UX goal here is speed to immediately undo if it was a mistake. like Gmail’s “Undo Send” toast, instead of having to navigate elsewhere to restore a session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant