Zustand stores
Canvas store
The canvas store manages the interactive project editor state:- Nodes and edges — the full canvas graph
- Selection — which node or edge is selected
- Viewport — zoom level and pan position
- Dirty tracking — whether unsaved changes exist
View store
Manages navigation and filtering state:Codebase map store
Manages the repository visualization view state.SWR for server state
SWR handles data fetching with automatic caching, revalidation, and deduplication:When to use which
| State type | Tool | Examples |
|---|---|---|
| Rapidly changing UI state | Zustand | Node positions, selections, viewport |
| Server-derived data | SWR | Project lists, memories, conversations |
| Form state | React state (useState) | Input values, validation errors |
| URL state | Next.js router | Current page, query params |