Skip to content

Preserve board state across canvas remounts - #105

Merged
ojowwalker77 merged 1 commit into
mainfrom
agent/preserve-canvas-session
Jul 29, 2026
Merged

Preserve board state across canvas remounts#105
ojowwalker77 merged 1 commit into
mainfrom
agent/preserve-canvas-session

Conversation

@ojowwalker77

Copy link
Copy Markdown
Owner

Summary

  • retain one controller-owned workspace across every full ComposerCanvas remount
  • synchronously flush live board text and geometry before replacing the SwiftUI root
  • preserve the same BoardViewModel, per-board undo/redo cache, CanvasBridge target, and pan/zoom state across theme, language, system-appearance, and full-screen recovery remounts

Root cause

PanelController rebuilt the canvas with ComposerCanvas(), which created a new @StateObject BoardViewModel. A pending debounced save captured the discarded model weakly, while undo/redo and viewport state lived only on that model/view, so a remount inside the 400 ms debounce window could lose the latest edit and history.

Verification

  • swift test --filter CanvasWorkspaceSessionTests — 2 passed; every remount trigger covers latest text/geometry, stable model identity, undo/redo, viewport, bridge routing, cancelled debounce, and protected unreadable payloads
  • ./script/check — release build + 196 tests passed
  • ./script/verify — signed release bundle validated
  • ./script/build_and_run.sh --verify — staged app launched
  • real app: Light→Dark→Light and System→English→System remounts kept board/settings context intact; original preferences restored
  • Splus staged audit — 0 findings, 15/15 changed export contracts traced

Deliberate non-goals / risk

Closes #96

@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 29, 2026
@ojowwalker77
ojowwalker77 merged commit 664607c into main Jul 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P0] Flush and preserve board state across canvas remounts

1 participant