Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

fix(redis): make completion menu follow typing

haipengno1f14973eaef79
diff --git a/apps/desktop/src/components/editor/QueryEditor.vue b/apps/desktop/src/components/editor/QueryEditor.vue
index 5a255be2dd..631d145425 100644
--- a/apps/desktop/src/components/editor/QueryEditor.vue
+++ b/apps/desktop/src/components/editor/QueryEditor.vue
@@ -990,7 +990,16 @@ async function provideRedisCompletions(currentState: import("@codemirror/state")
if (epoch !== completionEpoch) return null;
const items = buildRedisCompletionItemsFromContext(completionContext, { keys });
- return buildCompletionResult(items, completionContext.from, getRedisCompletionResultValidFor());
+ if (items.length === 0) return null;
+ // Use the built-in filter (the default) so typing narrows the list and moves
+ // the selection synchronously. `filter: false` + `validFor` are mutually
+ // exclusive (the latter is ignored), which would leave the menu frozen while
+ // typing — hence we build the result here instead of via buildCompletionResult.
+ return {
+ from: completionContext.from,
+ options: items.map((item) => completionOptionForItem(item)),
+ validFor: getRedisCompletionResultValidFor(),
+ };
}
async function provideSqlCompletions(currentState: import("@codemirror/state").EditorState, position: number, explicit: boolean) {