25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
优化 SearchableSelect 滚动逻辑和 AI 模型选择器布局
zipg7ae024ffd4d0
diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vueindex 368c7716b6..890e048406 100644--- a/apps/desktop/src/components/editor/AiAssistant.vue+++ b/apps/desktop/src/components/editor/AiAssistant.vue@@ -1287,6 +1287,7 @@ const messageRenderer = computed(() => {item-class="text-xs px-2"@update:model-value="(value) => selectAction(value as AiAction)"/>+ <span class="min-w-0 flex-1" /><SearchableSelectv-if="settings.isConfigured()":model-value="settings.aiConfig.model"@@ -1297,7 +1298,7 @@ const messageRenderer = computed(() => {:loading-text="t('ai.loadingModels')":loading="modelLoading":display-name="displayModelName"- trigger-class="min-w-0 flex-1 shrink justify-end rounded-full border px-2 py-0.5 text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground"+ trigger-class="min-w-0 w-auto max-w-[220px] shrink justify-end rounded-full border px-2 py-0.5 text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground"content-class="w-72"item-class="text-xs px-2"@update:model-value="handleModelSelect"diff --git a/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue b/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vueindex 61b571b465..3c779aa002 100644--- a/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue+++ b/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue@@ -57,6 +57,20 @@ function highlightSelectedOption() {highlightIndex.value = selectedIndex >= 0 ? selectedIndex : 0;}+async function scrollHighlightedOptionIntoView() {+ await nextTick();+ const container = listContainer.value;+ if (!container || highlightIndex.value < 0) return;+ const buttons = container.querySelectorAll("button");+ const target = buttons[highlightIndex.value];+ target?.scrollIntoView({ block: "nearest" });+}++function highlightAndScrollSelectedOption() {+ highlightSelectedOption();+ void scrollHighlightedOptionIntoView();+}+watch(open, async (value) => {emit("update:open", value);if (!value) {@@ -67,7 +81,7 @@ watch(open, async (value) => {await nextTick();const input = searchInput.value?.$el as HTMLInputElement | undefined;input?.focus();- highlightSelectedOption();+ highlightAndScrollSelectedOption();});watch(searchText, () => {@@ -78,19 +92,12 @@ watch(() => [props.modelValue, props.options],() => {if (!open.value || searchText.value) return;- highlightSelectedOption();+ highlightAndScrollSelectedOption();},{ deep: true },);-watch(highlightIndex, async () => {- await nextTick();- const container = listContainer.value;- if (!container || highlightIndex.value < 0) return;- const buttons = container.querySelectorAll("button");- const target = buttons[highlightIndex.value];- target?.scrollIntoView({ block: "nearest" });-});+watch(highlightIndex, scrollHighlightedOptionIntoView);function selectOption(option: string) {emit("update:modelValue", option);