From 1808523f3febc8719392643e5c7cebb2ce2d2be7 Mon Sep 17 00:00:00 2001 From: viettranx Date: Sun, 12 Apr 2026 18:16:42 +0700 Subject: [PATCH] feat(vault): add confirmation dialog for stop enrichment button --- ui/web/src/i18n/locales/en/vault.json | 2 ++ ui/web/src/i18n/locales/vi/vault.json | 2 ++ ui/web/src/i18n/locales/zh/vault.json | 2 ++ ui/web/src/pages/vault/vault-page.tsx | 14 +++++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ui/web/src/i18n/locales/en/vault.json b/ui/web/src/i18n/locales/en/vault.json index 748a622c..6dab3254 100644 --- a/ui/web/src/i18n/locales/en/vault.json +++ b/ui/web/src/i18n/locales/en/vault.json @@ -75,6 +75,8 @@ "enrichStopped": "Enrichment stopped", "enrichStopFailed": "Failed to stop enrichment", "stopEnrich": "Stop enrichment", + "stopEnrichConfirm": "Are you sure you want to stop the enrichment process? Documents already processed will keep their summaries.", + "stop": "Stop", "errors": "errors", "rescanNew": "{{count}} new", "rescanUpdated": "{{count}} updated", diff --git a/ui/web/src/i18n/locales/vi/vault.json b/ui/web/src/i18n/locales/vi/vault.json index 2c717244..e52bb1b8 100644 --- a/ui/web/src/i18n/locales/vi/vault.json +++ b/ui/web/src/i18n/locales/vi/vault.json @@ -75,6 +75,8 @@ "enrichStopped": "Đã dừng xử lý", "enrichStopFailed": "Không thể dừng xử lý", "stopEnrich": "Dừng xử lý", + "stopEnrichConfirm": "Bạn có chắc muốn dừng quá trình xử lý? Các tài liệu đã xử lý sẽ giữ nguyên.", + "stop": "Dừng", "errors": "lỗi", "rescanNew": "{{count}} mới", "rescanUpdated": "{{count}} cập nhật", diff --git a/ui/web/src/i18n/locales/zh/vault.json b/ui/web/src/i18n/locales/zh/vault.json index 39533c3b..15993fc6 100644 --- a/ui/web/src/i18n/locales/zh/vault.json +++ b/ui/web/src/i18n/locales/zh/vault.json @@ -75,6 +75,8 @@ "enrichStopped": "处理已停止", "enrichStopFailed": "停止处理失败", "stopEnrich": "停止处理", + "stopEnrichConfirm": "确定要停止处理吗?已处理的文档将保留其摘要。", + "stop": "停止", "errors": "错误", "rescanNew": "{{count}} 个新文件", "rescanUpdated": "{{count}} 个已更新", diff --git a/ui/web/src/pages/vault/vault-page.tsx b/ui/web/src/pages/vault/vault-page.tsx index f810cd58..88b3bb68 100644 --- a/ui/web/src/pages/vault/vault-page.tsx +++ b/ui/web/src/pages/vault/vault-page.tsx @@ -14,6 +14,7 @@ import { toast } from "@/stores/use-toast-store"; import { VaultDocumentSidebar } from "./vault-document-sidebar"; import { VaultSearchDialog } from "./vault-search-dialog"; import { VaultCreateDialog } from "./vault-create-dialog"; +import { ConfirmDialog } from "@/components/shared/confirm-dialog"; import type { VaultDocument } from "@/types/vault"; const VaultGraphView = lazy(() => @@ -41,6 +42,7 @@ export function VaultPage() { const [searchOpen, setSearchOpen] = useState(false); const [createOpen, setCreateOpen] = useState(false); const [sidebarOpen, setSidebarOpen] = useState(false); + const [stopConfirmOpen, setStopConfirmOpen] = useState(false); const { rescan, isPending: rescanPending } = useRescanWorkspace(); const { stop: stopEnrich, isPending: stopPending } = useStopEnrichment(); @@ -155,7 +157,7 @@ export function VaultPage() {