Skip to content

docs: feat: Add workspace archiving and restoration functionality - #212

Merged
Ziinc merged 4 commits into
mainfrom
claude/workspace-archiving-qhl87v
Aug 9, 2026
Merged

docs: feat: Add workspace archiving and restoration functionality#212
Ziinc merged 4 commits into
mainfrom
claude/workspace-archiving-qhl87v

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds the ability to archive and restore workspaces. Archived workspaces are removed from the filesystem and jj registration but preserved in the database with their full history (sessions, pending reviews), allowing users to restore them later.

Key Changes

Backend (Rust)

  • Database schema: Added archived boolean field to the Workspace struct and workspaces table
  • New database functions:
    • get_archived_workspaces() - retrieves only archived workspaces
    • update_workspace_archived() - sets the archived flag
    • Refactored all workspace queries to use a WORKSPACE_COLUMNS constant for consistency
  • Core workspace operations:
    • archive_workspace() - marks workspace as archived, removes jj registration and directory (best-effort)
    • restore_workspace() - recreates jj working copy and directory, clears archived flag
    • list_archived_workspaces() - public API for retrieving archived workspaces
  • Tauri commands: Added get_archived_workspaces, archive_workspace, and restore_workspace commands
  • NAPI dispatch: Added corresponding dispatch handlers for Node.js integration

Frontend (React/TypeScript)

  • New modal component: ArchivedWorkspacesModal displays archived workspaces with restore buttons
  • API functions: Added getArchivedWorkspaces(), archiveWorkspace(), and restoreWorkspace() in api-extra.ts
  • Dashboard integration:
    • Added archive/restore mutations with proper error handling and toast notifications
    • Integrated archive option into workspace context menu
    • Added bulk archive functionality with multi-select support
    • Connected "Archived Workspaces" command palette entry to modal
  • Sidebar updates: Added archive button to bulk action toolbar alongside delete
  • Type updates: Added archived: boolean field to Workspace interface

Testing

  • Unit tests: Database state verification for archiving/restoration
  • Integration tests: Full workflow testing including context menu, bulk operations, and modal interactions
  • Screenshot spec: Comprehensive visual test capturing the archive/restore user flow
  • Test fixtures: Updated all mock workspace factories to include archived: false

Implementation Details

  • Non-destructive archiving: Unlike deletion, archiving preserves the database row, branch/bookmark, and all associated history (sessions, pending reviews)
  • Child workspace handling: Child workspaces targeting an archived workspace's branch continue to target that branch (only the working copy is removed)
  • Best-effort cleanup: Directory and jj registration removal failures don't prevent the archived flag from being set, matching delete_workspace's tolerance
  • Query consistency: All workspace queries now use a centralized WORKSPACE_COLUMNS constant to ensure the archived field is consistently included
  • Active-only by default: get_workspaces() filters to non-archived workspaces; archived workspaces require explicit get_archived_workspaces() call
    https://claude.ai/code/session_0115DsUDUmHFSMV2ziDkVPcX

@Ziinc Ziinc changed the title Add workspace archiving and restoration functionality feat: Add workspace archiving and restoration functionality Aug 8, 2026
@Ziinc
Ziinc force-pushed the claude/workspace-archiving-qhl87v branch from 5b5a090 to d1fcb0f Compare August 8, 2026 09:45
@github-actions github-actions Bot changed the title feat: Add workspace archiving and restoration functionality docs: feat: Add workspace archiving and restoration functionality Aug 8, 2026
@Ziinc
Ziinc force-pushed the claude/workspace-archiving-qhl87v branch 2 times, most recently from 53f866a to b73288b Compare August 8, 2026 20:50
@Ziinc
Ziinc force-pushed the claude/workspace-archiving-qhl87v branch from b73288b to 20f3a96 Compare August 8, 2026 21:11
@Ziinc
Ziinc merged commit 7a097e0 into main Aug 9, 2026
7 checks passed
@Ziinc
Ziinc deleted the claude/workspace-archiving-qhl87v branch August 9, 2026 11:14
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