fix: 修复文件树删除失效问题并优化删除响应速度 - #117
Merged
Merged
Conversation
Closed
1lck
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复文件树右键删除操作无法真正删除本地文件的问题,并将删除流程优化为乐观更新,减少确认删除后的界面卡顿。
Fixes #86
问题原因
SwiftUI 在关闭删除确认弹窗时会先清空待删除请求,而原有异步删除任务随后才读取该请求,导致删除逻辑提前返回,文件没有被移动到废纸篓。
此外,原有流程会在删除前同步记录目标目录下所有文件的本地历史。删除较大目录时,这一步会产生明显等待。
修改内容
confirmationDialog捕获本次删除请求,避免弹窗关闭后请求丢失。beforeDelete历史快照,避免删除耗时随目录文件数量增长。删除流程
测试
新增回归测试覆盖:
验证结果:
./scripts/test-macos.sh->448 项测试全部通过./scripts/verify-service-boundaries.sh->通过