From 89e0f1734ba7210069a12900b456eaf306bdcf11 Mon Sep 17 00:00:00 2001 From: Melody Ruch <396921921@qq.com> Date: Thu, 20 Aug 2026 15:14:45 +0800 Subject: [PATCH] fix(sidebar): keep destructive table operations cancellable --- .../components/editor/DangerConfirmDialog.vue | 11 +- .../__tests__/DangerConfirmDialog.spec.ts | 52 ++++- .../src/components/sidebar/ConnectionTree.vue | 47 +++- .../sidebar/SidebarTreeRuntimeHost.vue | 29 ++- .../sidebar/sidebarTreeDialogState.ts | 2 + ...idebarTableMutationRuntime.saphana.spec.ts | 210 +++++++++++++++++- .../useSidebarTableMutationRuntime.ts | 167 +++++++++++++- apps/desktop/src/i18n/locales/en.ts | 4 + apps/desktop/src/i18n/locales/es.ts | 4 + apps/desktop/src/i18n/locales/it.ts | 4 + apps/desktop/src/i18n/locales/ja.ts | 4 + apps/desktop/src/i18n/locales/ko.ts | 4 + apps/desktop/src/i18n/locales/pt-BR.ts | 4 + apps/desktop/src/i18n/locales/zh-CN.ts | 4 + apps/desktop/src/i18n/locales/zh-TW.ts | 4 + .../src/lib/sidebar/sidebarDangerDialog.ts | 1 + crates/dbx-core/Cargo.toml | 1 + crates/dbx-core/src/query_cancel.rs | 80 ++++++- .../app-tests/sidebarMutationRuntime.test.ts | 2 +- src-tauri/src/commands/query.rs | 18 +- 20 files changed, 627 insertions(+), 25 deletions(-) diff --git a/apps/desktop/src/components/editor/DangerConfirmDialog.vue b/apps/desktop/src/components/editor/DangerConfirmDialog.vue index cabe1fa7f9..876a74de2c 100644 --- a/apps/desktop/src/components/editor/DangerConfirmDialog.vue +++ b/apps/desktop/src/components/editor/DangerConfirmDialog.vue @@ -33,6 +33,8 @@ const props = withDefaults( suppressToggleLabel?: string; loading?: boolean; closeOnConfirm?: boolean; + cancelable?: boolean; + cancelRunningLoading?: boolean; }>(), { sql: "", @@ -45,11 +47,14 @@ const props = withDefaults( suppressToggleLabel: "", loading: false, closeOnConfirm: true, + cancelable: false, + cancelRunningLoading: false, }, ); const emit = defineEmits<{ confirm: []; + "cancel-running": []; }>(); const code = computed(() => props.details || props.sql); @@ -119,7 +124,11 @@ async function copyFullCode() { - + +