From 5c0ce7e4dc6d9c3fab926f7ae7e98fca75ef47e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Sat, 26 Sep 2026 22:18:38 +0800 Subject: [PATCH] feat(history): add unified MCP execution history --- apps/desktop/src/App.vue | 30 +- .../editor/EditorSettingsDialog.vue | 57 +++- .../src/components/editor/QueryHistory.vue | 193 ++++++++--- ...ialog.historyRetention.integration.spec.ts | 6 + .../QueryHistory.manualTransaction.spec.ts | 22 +- .../useHistoryRetentionSetting.spec.ts | 51 +++ .../__tests__/usePanelResize.spec.ts | 35 ++ .../composables/useHistoryRetentionSetting.ts | 6 +- .../desktop/src/composables/usePanelResize.ts | 24 +- .../__tests__/historyMcpKindParity.spec.ts | 26 ++ apps/desktop/src/i18n/locales/az.ts | 18 ++ apps/desktop/src/i18n/locales/en.ts | 18 ++ apps/desktop/src/i18n/locales/es.ts | 18 ++ apps/desktop/src/i18n/locales/it.ts | 18 ++ apps/desktop/src/i18n/locales/ja.ts | 12 + apps/desktop/src/i18n/locales/ko.ts | 12 + apps/desktop/src/i18n/locales/pt-BR.ts | 18 ++ apps/desktop/src/i18n/locales/ru.ts | 12 + apps/desktop/src/i18n/locales/tr.ts | 18 ++ apps/desktop/src/i18n/locales/zh-CN.ts | 12 + apps/desktop/src/i18n/locales/zh-TW.ts | 12 + apps/desktop/src/lib/backend/api.ts | 4 + apps/desktop/src/lib/backend/http.ts | 21 ++ apps/desktop/src/lib/backend/tauri.ts | 23 ++ .../src/lib/history/historyActivityKind.ts | 2 +- .../src/lib/history/historyVirtualList.ts | 2 +- .../src/lib/settings/settingsSearch.ts | 1 + .../src/stores/__tests__/historyStore.spec.ts | 10 + apps/desktop/src/stores/historyStore.ts | 6 +- crates/dbx-core/src/persistence/history.rs | 17 + crates/dbx-core/src/persistence/storage.rs | 257 ++++++++++++++- crates/dbx-mcp/src/http_auth.rs | 21 +- crates/dbx-mcp/src/server.rs | 303 +++++++++++++++++- crates/dbx-web/src/main.rs | 6 + crates/dbx-web/src/routes/app_settings.rs | 17 + crates/dbx-web/src/routes/history.rs | 16 +- src-tauri/src/commands/app_settings.rs | 10 + src-tauri/src/commands/history.rs | 10 + src-tauri/src/lib.rs | 4 + 39 files changed, 1261 insertions(+), 87 deletions(-) create mode 100644 apps/desktop/src/composables/__tests__/useHistoryRetentionSetting.spec.ts create mode 100644 apps/desktop/src/i18n/__tests__/historyMcpKindParity.spec.ts diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue index 5135f2a6bb..66672df809 100644 --- a/apps/desktop/src/App.vue +++ b/apps/desktop/src/App.vue @@ -402,6 +402,7 @@ const agentDriverUpdateCount = ref(0); const showHistory = ref(false); const showAiPanel = ref(safeLocalStorageGet("dbx-ai-panel-open") === "true"); const isAiPanelMaximized = ref(false); +const isHistoryPanelMaximized = ref(false); const isZenMode = ref(false); const showSqlLibraryPanel = ref(safeLocalStorageGet("dbx-sql-library-open") === "true"); const showSqlFilePanel = ref(safeLocalStorageGet("dbx-sql-file-panel-open") === "true"); @@ -1689,6 +1690,7 @@ function applyRightSidebarPanelState(next: RightSidebarPanelState) { } function setRightSidebarPanelOpen(panelId: RightSidebarPanelId, open: boolean) { + if ((panelId === "history" && !open) || (panelId !== "history" && open)) isHistoryPanelMaximized.value = false; if (panelId === "ai" && !open) { isAiPanelMaximized.value = false; } else if (open && panelId !== "ai" && isAiPanelMaximized.value) { @@ -4192,7 +4194,11 @@ onUnmounted(() => { @mousedown="rememberSidebarSearchSurface" /> -
+
{
@@ -4493,20 +4499,28 @@ onUnmounted(() => {
-
+
- +
@@ -4520,7 +4534,7 @@ onUnmounted(() => {
diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 411f9a81f9..b9d24f68b2 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -1,4 +1,5 @@