♻️ 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:
@@ -192,8 +192,8 @@ useClickOutside(dropdownRef, closeDropdown);
|
||||
|
||||
<template>
|
||||
<div ref="dropdownRef" class="relative">
|
||||
<button @click="isOpen = !isOpen" ref="dropdownButton"
|
||||
class="flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors duration-200"
|
||||
<div role="button" @click="isOpen = !isOpen" ref="dropdownButton"
|
||||
class="cursor-pointer flex items-center w-fit select-none gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors duration-200"
|
||||
:class="[
|
||||
isOpen
|
||||
? 'bg-[var(--color-hover)] text-[var(--text-primary)]'
|
||||
@@ -206,7 +206,7 @@ useClickOutside(dropdownRef, closeDropdown);
|
||||
</span>
|
||||
<Icon name="mynaui:chevron-down" class="text-3.5 transition-transform duration-200"
|
||||
:class="{ 'rotate-180': isOpen }" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<Transition enter-active-class="transition-all duration-150 ease-[cubic-bezier(0.5,_1,_0.89,_1)]"
|
||||
|
||||
Reference in New Issue
Block a user