perf(dashboard): stop refetching on every tab switch; own the QueryClient
Two changes, together removing nearly all the redundant conversation/history calls visible in the network panel. Keep-alive modules: Messenger and Inbox were rendered from the tab ternary, so every tab change UNMOUNTED them — all their state died and returning re-hit the API. They now mount on first visit and stay mounted, hidden with CSS. Deliberately mount-on-first-visit rather than eager-mount-both, so opening the dashboard does not fire two modules' initial loads for a user who never opens either. QueryClient ownership: the SDK (0.2.0) takes React Query as a peer and falls back to its own client if it can't find one — but then its cache would be invisible to the CRM. Providing it here keeps SDK and CRM data in one store, so a write can invalidate a conversation list. Client is created in useState, not at module scope, so an SSR render can't leak one user's cache into another's. refetchOnWindowFocus is off: the socket already pushes live changes, so focus refetching was pure noise. Also declares onnxruntime-web@1.21.0, a PINNED peerDependency of @imgly/background-removal that npm prunes on any re-resolve. The committed lock had it, so `npm ci` worked and `npm install` silently broke the gallery build — declaring it directly makes it unprunable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9624
-1696
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user