feat(dashboard): bulk restore and make permanent for memories (issue 676)

IC
3d ago
+151-1

Approved issue: #676

What

Adds Restore and Make permanent to the Memories bulk-action bar, so a selection can be brought back from archived (or lifted to permanent) in one command. The backend already supports both: bulk_update_memory_status accepts any status, treats a change into active/permanent as a restore for epoch-bump purposes, and only bumps for rows whose status actually changes.

Changes

  • packages/dashboard/src/components/MemoryBrowser/MemoryBrowser.tsx: handleBulkRestore / handleBulkPermanent mirroring handleBulkArchive (confirm → bulkUpdateMemoryStatus → clear selection → refetch), plus Restore and Make permanent buttons next to Archive. Confirm dialogs mirror the Archive one, including the singular/plural template.
  • packages/dashboard/src-tauri/tests/db_mutations.rs: bulk_restore_mixed_selection_changes_and_bumps_only_actually_changed_rows — a mixed selection (archived→active and permanent→active that change, active→active no-ops, including one project path with no changes at all) asserts only the transitioning rows change, only their paths bump the epoch, and a restore queues no memory mutations.
  • packages/docs/src/content/docs/reference/dashboard.md: the bulk-select line now lists restore and make permanent.

No production Rust change — the approved shape is frontend plus a test of the existing command.

Harness coverage (required)

  • OpenCode 1: covered — shared dashboard over the shared context.db
  • OpenCode 2: covered — same dashboard
  • Pi: covered — same dashboard; Pi shares the store
  • OMP: covered — same dashboard
  • Rust module: covered — new integration test in db_mutations.rs exercises bulk_update_memory_status's no-op guard and epoch semantics (no production Rust change)

Summary by cubic

Adds Restore and Make permanent to the Memories bulk-action bar, so a selection can be brought back from archived or lifted to permanent in one command, alongside the existing Archive and Delete.

  • The backend already supports both via bulk_update_memory_status; only frontend, tests, and docs change.
  • Confirm dialogs mirror the Archive flow; Restore warns when selected permanent memories would lose never-expire status.
  • Selection is pruned whenever a refetch drops selected rows from the visible list, so bulk actions never act on rows the user can no longer see.
  • New integration tests cover restore-to-active and make-permanent: only rows that actually change status bump the epoch, and neither queues memory mutations.
  • The bulk-action bar now wraps on narrow windows, and the dashboard docs list the new actions.

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no outstanding findings.

Summary

Adds Restore and Make permanent to the Memories bulk-action bar.

  • Selected memories can be restored to active in one action.
  • Selected memories can be made permanent in one action.
  • The selected rows stay in step with the refreshed Memories list.
  • The bulk-action bar and its buttons wrap onto extra lines.

No new actionable issues were found. The previous selection warning finding is fixed. Tests were inspected but not run.

Reviews (3) · Last reviewed commit: "feat(dashboard): bulk restore and make p..." · Reviewed by Greptile