[Bug] 项目树删除时在窗口线程逐个同步执行废纸篓命令或 os.RemoveAll,大目录或多选删除会卡住界面
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start with desktop/internal/workbench/filetree_batch.go around removeTreeItems and treeRemovalDialog, then read filetree_menu.go around saveDocumentsThen and filetree_duplicate.go around moveToTrash. Trace how deletion runs for trash and permanent removal, then check the project’s existing tests for this flow. Done means large or multiple selections no longer block the window, the tree refreshes after completion, and failures are reported.
Written by the indexing model from the issue text.
Description
Platform / 平台
macOS
Area / 模块
Project and workspace / 项目与工作区
Lithe version / Lithe 版本
main 0a234bd8d
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
OS and architecture / 操作系统与架构
macOS,Apple Silicon(代码审查发现;Windows 走同一份 Go 代码,只是外部命令不同)
Environment / 环境信息
Viva 桌面端,项目树删除功能,与 JDK、Maven、语言服务器无关。
Steps to reproduce / 复现步骤
- 打开一个项目,在项目树里选中一个较大的目录,或者多选几十个文件。
- 右键选择“删除”,在确认弹窗里点“移到废纸篓”(或“永久删除”)。
- 删除进行时尝试滚动项目树、切换标签页或输入。
Expected behavior / 预期行为
删除在后台执行,窗口保持响应;完成后刷新项目树,失败时给出提示。
Actual behavior / 实际行为
这是代码审查发现的问题,还没有实测卡顿时长。从代码看,删除在窗口线程上同步执行:
desktop/internal/workbench/filetree_batch.go:221的treeRemovalDialog通过c.After在窗口线程调用removeTreeItems。removeTreeItems(filetree_batch.go:142)在saveDocumentsThen的回调里逐个调用treeMoveToTrash或os.RemoveAll。选中的文件没有在编辑器里打开时,saveDocumentsThen(filetree_menu.go:453)会同步调用这个回调,所以整个循环都跑在窗口线程上。moveToTrash(filetree_duplicate.go:109)每一项都启动一个外部进程,并等它退出(CombinedOutput),用的是context.Background(),没有超时:- macOS:
osascript,让 Finder 删除; - Windows:
powershell,加载Microsoft.VisualBasic后移到回收站; - 其他平台:
gio trash。
- macOS:
- 选中 N 项就串行启动 N 个进程,每个都要几百毫秒,窗口在这段时间里不会重绘。永久删除时
os.RemoveAll删大目录(例如node_modules、target)同样会阻塞窗口线程。 - 未验证的推测:macOS 第一次让 Finder 删除时可能会弹出“自动化”授权框,用户回答之前窗口线程一直在等。
Logs or diagnostic output / 日志或诊断输出
未采集。问题来自对 main 0a234bd8d 的代码审查,没有运行时日志或耗时测量。
Screenshots or recordings / 截图或录屏
无。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
- I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 3h 48m
- Merged PRs (30d)
- 571
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 82/100
1lck/Lithe-IDEA#2431 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 3/5 1-2 days Newbie friendliness 57/100
1lck/Lithe-IDEA#2434 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
rel: fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/fews-web-oc#2400 ·
Maintainers usually reply within 1 day
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on ClaudePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ardia-browser/ardia#4426 ·
Maintainers usually reply within 1 day
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePossibly taken @bardrop claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pnp/cli-microsoft365#7713 ·
Maintainers usually reply within 1 day
-
Diagram: Journey Type: Bug / Error
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainers usually reply within 1 day