From 1318a32b7155f5c646262bd2926607e879da1283 Mon Sep 17 00:00:00 2001 From: matevip Date: Wed, 8 Jul 2026 15:53:57 +0800 Subject: [PATCH] perf(ui): cut initial-load bundle via lazy model-viewer and preload fix --- .../src/components/chat/MessageBubble.vue | 10 ++++- mateclaw-ui/src/main.ts | 8 ++-- mateclaw-ui/src/utils/lazyModelViewer.ts | 22 ++++++++++ mateclaw-ui/vite.config.ts | 44 ++++++++++++++----- 4 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 mateclaw-ui/src/utils/lazyModelViewer.ts diff --git a/mateclaw-ui/src/components/chat/MessageBubble.vue b/mateclaw-ui/src/components/chat/MessageBubble.vue index 2ca034a6..31732931 100644 --- a/mateclaw-ui/src/components/chat/MessageBubble.vue +++ b/mateclaw-ui/src/components/chat/MessageBubble.vue @@ -537,6 +537,7 @@ import { } from '@element-plus/icons-vue' import { useStreamingMarkdown } from '@/composables/useStreamingMarkdown' import { buildGeneratedFileNameMap, linkifyGeneratedFileUrls } from '@/utils/generatedFileLinks' +import { ensureModelViewer } from '@/utils/lazyModelViewer' import { useAuthenticatedAttachment } from '@/composables/useAuthenticatedAttachment' import { useToolLabel } from '@/composables/useToolLabel' import { http } from '@/api' @@ -901,9 +902,14 @@ watch(audioAttachments, (atts) => { if (atts.length > 0) loadAllAudios(atts) }, { immediate: true }) // 3D models also need the auth-blob loader — doesn't carry -// the Authorization header any more than /