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:
+3
-1
@@ -14,8 +14,9 @@
|
||||
"@huggingface/transformers": "^4.2.0",
|
||||
"@imgly/background-removal": "^1.7.0",
|
||||
"@insignia/iios-kernel-client": "^0.1.6",
|
||||
"@insignia/iios-messaging-ui": "^0.1.17",
|
||||
"@insignia/iios-messaging-ui": "^0.2.0",
|
||||
"@photo-gallery/sdk": "file:./vendor/photo-gallery-sdk",
|
||||
"@tanstack/react-query": "^5.101.4",
|
||||
"@tensorflow-models/coco-ssd": "^2.2.3",
|
||||
"@tensorflow/tfjs": "^4.22.0",
|
||||
"@vladmandic/face-api": "^1.7.15",
|
||||
@@ -23,6 +24,7 @@
|
||||
"leaflet": "^1.9.4",
|
||||
"lucide-react": "^1.21.0",
|
||||
"next": "16.2.9",
|
||||
"onnxruntime-web": "^1.21.0",
|
||||
"react": "19.2.4",
|
||||
"react-dom": "19.2.4",
|
||||
"tailwind-merge": "^3.6.0",
|
||||
|
||||
Reference in New Issue
Block a user