diff --git a/docs/UX-BENCHMARKS.md b/docs/UX-BENCHMARKS.md index d529520..7be32f7 100644 --- a/docs/UX-BENCHMARKS.md +++ b/docs/UX-BENCHMARKS.md @@ -90,8 +90,8 @@ Scheduled(有日期的)。 清除日期同时清除时间,避免任务残留不可见的 due_time。 - ✅ Linux:基于 GTK 原生多选(#33)增加可见的批量完成和批量移动操作栏, 同时适用于当前列表和全局搜索。刷新时按任务 ID 保留选择。 -- 🔜 **尚未完成**:Windows 批量删除及撤销、行内详情展开; - Linux 批量排期/删除及撤销;以及三平台按真实快捷键进行实机回归。 +- ✅ Windows 单条/批量删除采用 6 秒延后提交:先隐藏选中任务,期间撤销可直接恢复原任务 ID 与元数据,超时才发送后端删除 RPC;失败时恢复任务。 +- 🔜 **尚未完成**:Windows 行内详情展开;Linux 批量删除及撤销;以及三平台按真实快捷键进行实机回归。 ### 2.5 Quick Find diff --git a/scripts/e2e/e2e-windows.ps1 b/scripts/e2e/e2e-windows.ps1 index cc78518..a148790 100644 --- a/scripts/e2e/e2e-windows.ps1 +++ b/scripts/e2e/e2e-windows.ps1 @@ -264,6 +264,40 @@ try { return $false }) + # A batch deletion must be fully reversible without giving tasks + # replacement IDs (including their list ownership and due metadata). + $undoName1 = 'Undo safety task one' + $undoName2 = 'Undo safety task two' + foreach ($title in @($undoName1, $undoName2)) { + $quickAdd.GetCurrentPattern( + [System.Windows.Automation.ValuePattern]::Pattern).SetValue($title) + $quickAdd.SetFocus() + [System.Windows.Forms.SendKeys]::SendWait('{ENTER}') + [void](Wait-Until ("saved task: {0}" -f $title) { + Find-ByName $window $title + }) + } + Select-TaskForBatch $undoName1 $false + Select-TaskForBatch $undoName2 $true + $deleteBatch = Wait-Until 'bulk-delete action' { + Find-ById $window 'bulk-delete' + } + $deleteBatch.GetCurrentPattern( + [System.Windows.Automation.InvokePattern]::Pattern).Invoke() + $undo = Wait-Until 'undo-delete action' { + $item = Find-ById $window 'undo-delete' + if ($null -ne $item -and + -not $item.Current.IsOffscreen) { return $item } + return $null + } + $undo.GetCurrentPattern( + [System.Windows.Automation.InvokePattern]::Pattern).Invoke() + foreach ($title in @($undoName1, $undoName2)) { + [void](Wait-Until ("task restored without backend delete: {0}" -f $title) { + Find-ByName $window $title + }) + } + $nodes = $window.FindAll( [System.Windows.Automation.TreeScope]::Descendants, [System.Windows.Automation.Condition]::TrueCondition) @@ -302,6 +336,7 @@ try { 'view switches preserve task list ownership', 'global search shows the real owning list for every task', 'Ctrl/Shift multi-selection completes two tasks in one command', + 'bulk deletion undo restores original rows before backend mutation', 'batch scheduling is visible and enabled when multiple tasks are selected', 'native window close stopped the process' ) diff --git a/windows/MainWindow.xaml b/windows/MainWindow.xaml index 99deb27..1447efc 100644 --- a/windows/MainWindow.xaml +++ b/windows/MainWindow.xaml @@ -355,6 +355,9 @@