React Query in MUZE
The frontend uses TanStack React Query v5 for all server state management. This replaces traditional Redux/Zustand patterns for API data.Provider setup
App.tsx together with SessionProvider and the toast mount point.
Cache tiers (Phase 2.12)
Cached data is the default render path. Tier constants live infrontend/src/lib/cache-tiers.ts and are shared by pages, the warm-start
prefetcher and the sidebar hover prefetch:
Changes to reference/directory data are surfaced by the invalidation helpers in
lib/query-invalidation.ts; operational queries opt back into
refetchOnMount: true. Client-scoped admin and manager queries include
activeClientId in the key and guard with enabled: !!activeClientId, so they
fire only after the active client resolves. Client-sensitive queries do not use
keepPreviousData; a client switch clears the old rows while fresh data loads.
Prefetch keys for the login warm-start and the sidebar hover/focus prefetch
come from the single lib/navigation-prefetch.ts registry, aligned exactly to
the page keys. Sign-out cancels and clears the query cache before navigating to
/login. Full policy: doc/architecture_and_workflow.md §10.6.