From 62af348a0159e253c314ad32bc48780a890cdbfc Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Wed, 20 May 2026 13:32:23 +0800 Subject: [PATCH] fix: custom find/replace UI for SQL editor (Ctrl+F) Closes #352 --- apps/desktop/src/App.vue | 1 - .../src/components/editor/QueryEditor.vue | 256 +++++++++++++++++- .../src/components/layout/ContentArea.vue | 4 +- package.json | 1 + pnpm-lock.yaml | 3 + 5 files changed, 261 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue index f3e2e11f7..572d2db0e 100644 --- a/apps/desktop/src/App.vue +++ b/apps/desktop/src/App.vue @@ -537,7 +537,6 @@ function handleKeydown(e: KeyboardEvent) { const shortcuts = settingsStore.editorSettings.shortcuts; if (isFocusSearchShortcut(e, shortcuts)) { - if (activeTab.value?.mode === "query") return; const focused = contentAreaRef.value?.focusSearch() || appSidebarRef.value?.focusSearch(); if (focused) { e.preventDefault(); diff --git a/apps/desktop/src/components/editor/QueryEditor.vue b/apps/desktop/src/components/editor/QueryEditor.vue index cf0c6e008..a79c15680 100644 --- a/apps/desktop/src/components/editor/QueryEditor.vue +++ b/apps/desktop/src/components/editor/QueryEditor.vue @@ -1,7 +1,17 @@ diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vue index 5f00664b8..b480106bf 100644 --- a/apps/desktop/src/components/layout/ContentArea.vue +++ b/apps/desktop/src/components/layout/ContentArea.vue @@ -91,6 +91,7 @@ const columnInfoColumns = ref([]); const columnInfoLoading = ref(false); const columnInfoError = ref(undefined); const dataGridRef = ref(); +const queryEditorRef = ref>(); const columnVisibilitySearch = ref(""); const columnVisibilityOptions = computed( () => dataGridRef.value?.filteredColumnVisibilityOptions(columnVisibilitySearch.value) ?? [], @@ -209,7 +210,7 @@ function onHandleCloseColumnPanel() { function focusSearch(): boolean { if (props.activeTab.mode === "redis") return redisKeyBrowserRef.value?.focusSearch() ?? false; if (props.activeTab.mode === "objects") return objectBrowserRef.value?.focusSearch() ?? false; - if (props.activeTab.mode === "query" && props.activeOutputView !== "result") return false; + if (props.activeTab.mode === "query") return queryEditorRef.value?.openSearch() ?? false; return dataGridRef.value?.focusSearch() ?? false; } @@ -230,6 +231,7 @@ defineExpose({ focusSearch, refreshData });