ClipSpacesClipSpaces Docs
Back to app

All releases

Fix: stale AI briefing + lost connections + missing scan

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 were useEdgesState([]) with no save/load — they lived only in memory and vanished on reload (so the AI genuinely saw none after a refresh). Added loadEdges/saveEdges (localStorage, per space); the canvas hydrates edges on mount and saves on every change. deleteCanvasData clears 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 sends reset: true, and the route wipes the saved thread first so briefings don't stack.
  • Scan plays on every open — decoupled from briefing; startScan/endScan fire 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.