mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-10 00:14:38 +00:00
Lazy-load AIChat to cut frontend entry bundle by 29 percent
This commit is contained in:
parent
62cd23b97b
commit
5e2dfe48c7
2 changed files with 36 additions and 26 deletions
|
|
@ -5,34 +5,34 @@
|
|||
"defaultThresholdPercent": 15,
|
||||
"chunks": {
|
||||
"index": {
|
||||
"baselineGzip": 128886
|
||||
"baselineGzip": 117548
|
||||
},
|
||||
"Alerts": {
|
||||
"baselineGzip": 84692
|
||||
"baselineGzip": 84724
|
||||
},
|
||||
"Settings": {
|
||||
"baselineGzip": 84417
|
||||
"baselineGzip": 84570
|
||||
},
|
||||
"InfrastructureWorkspace": {
|
||||
"baselineGzip": 72406
|
||||
"baselineGzip": 72487
|
||||
},
|
||||
"AIIntelligence": {
|
||||
"baselineGzip": 63969
|
||||
"baselineGzip": 63997
|
||||
},
|
||||
"Infrastructure": {
|
||||
"baselineGzip": 61643
|
||||
"baselineGzip": 61725
|
||||
},
|
||||
"Workloads": {
|
||||
"baselineGzip": 48496
|
||||
"baselineGzip": 48573
|
||||
},
|
||||
"Storage": {
|
||||
"baselineGzip": 39249
|
||||
"baselineGzip": 39286
|
||||
},
|
||||
"Recovery": {
|
||||
"baselineGzip": 30353
|
||||
"baselineGzip": 30393
|
||||
},
|
||||
"ScrollToTopButton": {
|
||||
"baselineGzip": 24582
|
||||
"baselineGzip": 24621
|
||||
},
|
||||
"vendor-ai": {
|
||||
"baselineGzip": 20801
|
||||
|
|
@ -41,48 +41,51 @@
|
|||
"baselineGzip": 17298
|
||||
},
|
||||
"searchParams": {
|
||||
"baselineGzip": 13394
|
||||
"baselineGzip": 13393
|
||||
},
|
||||
"APIAccessPanel": {
|
||||
"baselineGzip": 10695
|
||||
"baselineGzip": 10767
|
||||
},
|
||||
"vendor": {
|
||||
"baselineGzip": 9853
|
||||
},
|
||||
"vendor-icons": {
|
||||
"baselineGzip": 9621
|
||||
"baselineGzip": 9595
|
||||
},
|
||||
"ReportingPanel": {
|
||||
"baselineGzip": 8724
|
||||
"baselineGzip": 8803
|
||||
},
|
||||
"AuditLogPanel": {
|
||||
"baselineGzip": 8292
|
||||
"baselineGzip": 8357
|
||||
},
|
||||
"routeStateNavigation": {
|
||||
"baselineGzip": 7708
|
||||
"baselineGzip": 7709
|
||||
},
|
||||
"UpdatesSettingsPanel": {
|
||||
"baselineGzip": 6623
|
||||
"baselineGzip": 6663
|
||||
},
|
||||
"Ceph": {
|
||||
"baselineGzip": 6336
|
||||
"baselineGzip": 6345
|
||||
},
|
||||
"SecurityAuthPanel": {
|
||||
"baselineGzip": 5960
|
||||
"baselineGzip": 5948
|
||||
},
|
||||
"DiagnosticsPanel": {
|
||||
"baselineGzip": 5684
|
||||
"baselineGzip": 5723
|
||||
},
|
||||
"HelpIcon": {
|
||||
"baselineGzip": 5377
|
||||
"baselineGzip": 5382
|
||||
},
|
||||
"useUnifiedResources": {
|
||||
"baselineGzip": 5261
|
||||
},
|
||||
"OrganizationSharingPanel": {
|
||||
"baselineGzip": 5195
|
||||
"baselineGzip": 5214
|
||||
}
|
||||
},
|
||||
"totals": {
|
||||
"js": {
|
||||
"baselineGzip": 878113
|
||||
"baselineGzip": 883834
|
||||
},
|
||||
"css": {
|
||||
"baselineGzip": 24654
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ import { createTooltipSystem } from './components/shared/Tooltip';
|
|||
import { TokenRevealDialog } from './components/TokenRevealDialog';
|
||||
import { UpdateProgressModal } from './components/UpdateProgressModal';
|
||||
import { UpdatesAPI, type UpdateStatus } from './api/updates';
|
||||
import { AIChat } from './components/AI/Chat';
|
||||
// AIChat is the side-panel chat UI plus its store deps (markdown rendering,
|
||||
// tool-call formatting, prompt scaffolding). Lazy-load behind aiChatStore.isOpen
|
||||
// so the entry bundle stays out of "everything users might ever click."
|
||||
const AIChat = lazy(() => import('./components/AI/Chat').then((m) => ({ default: m.AIChat })));
|
||||
import { aiChatStore } from './stores/aiChat';
|
||||
import { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts';
|
||||
import { useKioskMode } from '@/hooks/useKioskMode';
|
||||
|
|
@ -406,8 +409,12 @@ function App() {
|
|||
{props.children}
|
||||
</AppLayout>
|
||||
</div>
|
||||
{/* AI Panel - slides in from right, pushes content */}
|
||||
<AIChat onClose={() => aiChatStore.close()} />
|
||||
{/* AI Panel - slides in from right, pushes content.
|
||||
Mounted only when open so the lazy chunk only
|
||||
downloads on first chat-open click. */}
|
||||
<Show when={aiChatStore.isOpenSignal()}>
|
||||
<AIChat onClose={() => aiChatStore.close()} />
|
||||
</Show>
|
||||
</div>
|
||||
<KeyboardShortcutsModal
|
||||
isOpen={shortcutsOpen()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue