♻️ refactor: optimize state management, switch to @tanstack/vue-virtual, and improve performance

- 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.
This commit is contained in:
Zoe
2026-02-23 15:56:10 +00:00
parent 59bb7fbc12
commit 6ee4087a29
42 changed files with 889 additions and 828 deletions
+30 -8
View File
@@ -10,6 +10,7 @@ export default defineNuxtConfig({
},
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'format-detection', content: 'telephone=no' },
{
name: 'description',
content: 'A chat-based AI assistant for your LLMs.',
@@ -81,6 +82,12 @@ export default defineNuxtConfig({
},
},
vue: {
config: {
performance: true,
}
},
vite: {
server: {
allowedHosts: true,
@@ -109,10 +116,10 @@ export default defineNuxtConfig({
'@vue/devtools-kit',
'@sentry/nuxt',
'@nuxt/hints/runtime/hydration/component',
'vue-virtual-scroller',
'@nuxt/hints/runtime/lazy-load/composables',
'@tanstack/vue-virtual',
'shiki',
'better-auth/vue',
'big.js',
'unified',
'remark-gfm',
'remark-parse',
@@ -122,9 +129,17 @@ export default defineNuxtConfig({
'unist-util-visit',
'@triplit/client',
'@triplit/db',
'comlink'
'sorted-btree',
'elen',
'comlink',
'nanoid'
],
},
build: {
commonjsOptions: {
transformMixedEsModules: true,
}
},
},
nitro: {
@@ -138,7 +153,14 @@ export default defineNuxtConfig({
// viewTransition: true,
// },
modules: ['@vue-macros/nuxt', '@nuxt/hints', '@nuxt/icon', '@unocss/nuxt', 'triplit-nuxt', '@sentry/nuxt/module', '@nuxt/fonts'],
modules: [
'@nuxt/hints',
'@nuxt/icon',
'@unocss/nuxt',
'triplit-nuxt',
// '@sentry/nuxt/module',
'@nuxt/fonts'
],
triplit: {
schema_path: './triplit/schema.ts',
@@ -159,10 +181,10 @@ export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
sentry: {
org: 'veridian-ol',
project: 'javascript-nuxt',
},
// sentry: {
// org: 'veridian-ol',
// project: 'javascript-nuxt',
// },
sourcemap: {
client: 'hidden',