Skip to content

feat(ui): add canvas snapshot save/restore functionality#8978

Open
GGSSKK wants to merge 1 commit intoinvoke-ai:mainfrom
GGSSKK:feat/canvas-snapshot-save-restore
Open

feat(ui): add canvas snapshot save/restore functionality#8978
GGSSKK wants to merge 1 commit intoinvoke-ai:mainfrom
GGSSKK:feat/canvas-snapshot-save-restore

Conversation

@GGSSKK
Copy link
Contributor

@GGSSKK GGSSKK commented Mar 20, 2026

Summary

Adds a canvas snapshot save/restore button to the toolbar (camera icon). Users can save the
current canvas state at any time and restore it later — useful when the canvas resets unexpectedly
due to freezes or reloads.

Reuses the existing client_state API with a canvas_snapshot: key prefix, keeping changes
minimal.

snapshot.mp4

Related Issues / Discussions

Related to #6554 (canvas state not persisting). This provides a manual workaround by letting users
explicitly save/restore canvas state.

QA Instructions

  1. Add layers and adjust bbox on the canvas
  2. Click the camera icon in the toolbar → save a snapshot (leave name blank for auto date/time)
  3. Reset canvas via New Session
  4. Click the camera icon → select the snapshot to restore
  5. Verify layers, masks, and bbox are restored
  6. Test deleting a snapshot via the trash icon

Merge Plan

Simple merge. No DB schema changes — uses existing client_state table.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Changes to a redux slice have a corresponding migration — N/A, no state shape change (new
    reducer only)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Add ability to save and restore canvas state snapshots, allowing users
to preserve their canvas layout at any point and restore it later.
This is useful when the canvas freezes or resets unexpectedly.

Backend:
- Add get_keys_by_prefix and delete_by_key to client_state persistence
- Add corresponding API endpoints

Frontend:
- Add canvasSnapshotRestored reducer to canvasSlice
- Add useCanvasSnapshots hook for snapshot CRUD operations
- Add CanvasToolbarSnapshotMenuButton with save/restore UI
- Add i18n keys for snapshot feature
- Regenerate API schema types

Tests:
- Add tests for new client_state endpoints (prefix search, key deletion)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added api python PRs that change python files services PRs that change app services frontend PRs that change frontend files python-tests PRs that change python tests labels Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api frontend PRs that change frontend files python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant