feat(canvas): keep closed canvases mounted and save before unmount
Merged
GN
4d ago+2387+2387+0123456789012345678901234567890123456789-421-421-012345678901234567890123456789
Summary
- Agents must keep working when the user closes the tab, and no close may lose edits.
- Part 4 of 10 in a stacked series. Review and merge bottom-up; each PR targets the one below it. Canvas mode v3 (figcraft engine). Spec:
spec-openpencil-canvas-mode; architecture spine 2026-10-16 (AD-17 to AD-31).
Related Issue
No issue. Split from #1369 so each part stays under 50 files.
Type of Change
- feat: new feature
What Changed
- A closed tab keeps the iframe offscreen 1ร1 (never
display:none); one mount registry lives in Rust. - Project close and app quit run quiesce, save, verify, unmount; a failed save asks Retry / Discard / Keep editing.
Scope
- E2-2.
How It Was Tested
-
bun run typecheckon this branch - Each part is a checkpoint that was built and tested when it was made (
cargo testfor canvas and host_mcp, vitest, real runs in headless Edge). The bottom and top of the stack were rebuilt and re-tested on currentdev.
Checklist
- PR title follows the conventional commit format
- Explained why no issue exists
- Added or updated tests
- Read AGENTS.md
- A human reviewed the complete diff before submission
๐ค Generated with Claude Code
Summary by cubic
Closing a canvas tab now hides the editor instead of unmounting it, so the figcraft session stays alive: agent calls keep working and reopening the tab is instant. Unmounting a canvas (project close/delete/archive, app quit) now runs quiesce โ save โ verify โ unmount; when the save fails, the user is asked to retry, discard, or keep editing, so no unsaved work is dropped. The Rust persistence module is now the single mount registry the gateway and transports share.