Add a new Zustand store following Ascend's frontend patterns. Use when introducing client-only UI state, builder state, command palette state, or local persisted settings that should not live in TanStack Query.
Use Zustand only for client-local state.
Use other tools when:
Common patterns already used:
src/components/command-palette/store.tssrc/dialogs/store.tspersist: src/integrations/ai/store.tsimmer and zundo: src/components/resume/store/resume.tsPlace it near the owning feature when possible:
src/components/ or src/dialogs/Follow the common shape:
type MyState = { open: boolean };
type MyActions = { setOpen: (open: boolean) => void };
type MyStore = MyState & MyActions;
persist for browser-only preferencesimmer when nested updates would otherwise get noisyzundo only for editor-style undo/redo workflowsDo not add middleware by default.
Read only what a component needs:
const open = useMyStore((state) => state.open);
const setOpen = useMyStore((state) => state.setOpen);
For persisted state:
pnpm typecheckpnpm lint