Superseded by 0079: client state is
@stackra/state;
Query owns optimism and the offline queue.Context
Web, desktop and mobile all hold two kinds of state: data owned by the backend and purely local UI state. Mixing them in one store causes stale caches and hand-written loading logic. Offline behaviour on mobile (0059) also needs a cache that can be persisted.Decision
- Server state lives in TanStack Query, keyed from the generated API client.
- Local client state lives in Zustand. Nothing server-owned is copied into a Zustand store.
- The Figentra OS signals package is dropped; its network, keyboard and coordinator concerns are redesigned on Zustand as needed.
- The same two libraries are used on web, desktop and mobile.
Consequences
- One mental model across surfaces; caching, retries and invalidation come from a maintained library.
- Persistence for offline use is a Query concern, not a custom store.
- Two libraries to keep current through the catalogs.
Enforcement
Versions only throughpnpm-workspace.yaml catalogs (enforced by pnpm validate). Planned — a review rule against copying fetched data into Zustand; nothing checks it yet.