Two bugs from the persist-chat-history change: the briefing was resumed from the DB on every reopen, so it never reflected new cards/connections and the scan never replayed. Separately, connections were never persisted at all.
Fixed
- Connections now persist (
lib/canvas-store.ts,components/Canvas.tsx). Edges wereuseEdgesState([])with no save/load — they lived only in memory and vanished on reload (so the AI genuinely saw none after a refresh). AddedloadEdges/saveEdges(localStorage, per space); the canvas hydrates edges on mount and saves on every change.deleteCanvasDataclears them too. - Briefing re-runs when the board changed (
components/AIPanel.tsx,app/api/ai/route.ts). The panel now fingerprints the board content (boardSignature, excluding layout/blobs) and only resumes the saved thread if the signature matches; otherwise it re-briefs. A re-brief sendsreset: true, and the route wipes the saved thread first so briefings don't stack. - Scan plays on every open — decoupled from briefing;
startScan/endScanfire whether the thread is resumed or re-generated.
Notes
- Edge persistence is localStorage (per device), matching how cards already cache locally. Cross-device/collab edge sync (a cloud store) is a follow-up.