From 6ee4087a29bd6f54defcbee22cc30c0a0c0c46c9 Mon Sep 17 00:00:00 2001 From: Zoe <62722391+juls0730@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:56:10 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20optimize=20sta?= =?UTF-8?q?te=20management,=20switch=20to=20@tanstack/vue-virtual,=20and?= =?UTF-8?q?=20improve=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Centralize `useAgents` and `useModels` state within the Nuxt app context to prevent data leaks and improve initialization. - Migrate virtualization from `vue-virtual-scroller` to `@tanstack/vue-virtual` with new `RowVirtualizerFixed` and `RowVirtualizerDynamic` components. - Upgrade Nuxt to v4.3.1 and remove `@vue-macros/nuxt`. - Replace `big.js` with an optimized custom `lshDecimal` string manipulation logic for pricing calculations in the provider API. - Implement automatic focus redirection in `ChatInput` to capture standard keyboard input. - Refactor Sidenav and Settings components to utilize virtualization for long lists (topics, agents, models). - Enhance theme colors and mobile experience. More work to come on both of these. --- .vscode/launch.json | 19 + .vscode/settings.json | 3 + app/app.vue | 2 - app/assets/css/base.css | 33 +- app/components/ChatInput.vue | 21 +- app/components/Markdown/Renderer.vue | 8 +- app/components/Markdown/ShikiHighlight.vue | 2 +- app/components/Message/Agent/Reasoning.vue | 10 +- app/components/Message/Agent/Tool/Debug.vue | 2 +- app/components/Message/Agent/Tool/index.vue | 2 +- app/components/Message/Agent/index.vue | 5 +- app/components/Message/User.vue | 2 +- app/components/ModelInfo.vue | 2 +- app/components/ModelSelector.vue | 6 +- app/components/RowVirtualizerDynamic.vue | 57 ++ app/components/RowVirtualizerFixed.vue | 46 ++ app/components/Settings/AIServiceProvider.vue | 72 +- .../Settings/AppearanceSettings.vue | 3 +- app/components/Settings/Dialog.vue | 7 +- app/components/Settings/ModelItem.vue | 6 +- app/components/Settings/ProviderSettings.vue | 9 +- app/components/Settings/ProviderSidebar.vue | 8 +- app/components/Settings/SystemAssistants.vue | 3 +- app/components/Sidenav/HeaderAgent.vue | 41 +- app/components/Sidenav/NavAgent.vue | 126 ++-- app/components/Sidenav/NavHome.vue | 84 ++- app/components/Sidenav/index.vue | 9 +- app/composables/useAgents.ts | 77 +- app/composables/useModels.ts | 108 +-- app/layouts/auth.vue | 4 + app/layouts/default.vue | 4 - app/pages/agent/[id]/index.vue | 17 +- app/pages/agent/[id]/profile.vue | 20 +- app/pages/agent/[id]/topic/[topicId].vue | 14 +- app/pages/index.vue | 13 +- app/pages/test.vue | 3 + app/plugins/global-data.ts | 10 + bun.lock | 702 +++++++----------- nuxt.config.ts | 38 +- package.json | 15 +- patches/@triplit%2Fdb@1.1.10.patch | 18 - .../api/provider/[providerId]/models.post.ts | 86 ++- 42 files changed, 889 insertions(+), 828 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 app/components/RowVirtualizerDynamic.vue create mode 100644 app/components/RowVirtualizerFixed.vue create mode 100644 app/pages/test.vue create mode 100644 app/plugins/global-data.ts diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a612054 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Run vite", + "runtimeExecutable": "npm", + "cwd": "${workspaceFolder}", + "args": [ + "run", + "dev" + ] + }, + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..10a0a9e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dependi.npm.lockFileEnabled": true +} diff --git a/app/app.vue b/app/app.vue index 23f1520..1fa4810 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,6 +1,4 @@ diff --git a/app/components/Markdown/Renderer.vue b/app/components/Markdown/Renderer.vue index a8ea532..85f9843 100644 --- a/app/components/Markdown/Renderer.vue +++ b/app/components/Markdown/Renderer.vue @@ -41,11 +41,15 @@ const renderNode = (node: any, index: number): any => { return null; }; -defineRender(() => { +const render = () => { const children = ast.value?.children?.flatMap(renderNode) || []; return h('div', { class: 'prose-wrapper' }, [ h('article', { class: 'markdown-body' }, children) ]); -}) +} + + \ No newline at end of file diff --git a/app/components/Markdown/ShikiHighlight.vue b/app/components/Markdown/ShikiHighlight.vue index 051c0b7..7255bfe 100644 --- a/app/components/Markdown/ShikiHighlight.vue +++ b/app/components/Markdown/ShikiHighlight.vue @@ -1,4 +1,4 @@ -