[Bug] 项目树删除时在窗口线程逐个同步执行废纸篓命令或 os.RemoveAll,大目录或多选删除会卡住界面
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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. / 我已从报告中移除敏感信息和个人数据。
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 151
- 平均合并
- 3 小时 48 分钟
- 30 天内合并 PR
- 571
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
1lck/Lithe-IDEA 的其他 Issue
-
review: medium
难度 2/5 1-3 小时 新手友好度 78/100
1lck/Lithe-IDEA#2432 ·
维护者通常 1 天内回复
-
review: medium
难度 1/5 1 小时以内 新手友好度 82/100
1lck/Lithe-IDEA#2431 ·
维护者通常 1 天内回复
-
refactor review: high
难度 2/5 1-3 小时 新手友好度 72/100
1lck/Lithe-IDEA#2376 ·
维护者通常 1 天内回复
-
area:ui enhancement P2 platform:cross-platform refactor review: high
难度 1/5 1 小时以内 新手友好度 84/100
1lck/Lithe-IDEA#2365 ·
维护者通常 1 天内回复
-
review: medium
难度 3/5 1-2 天 新手友好度 57/100
1lck/Lithe-IDEA#2434 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
posit-dev/positron-sas-extension#196 ·
维护者通常 1 天内回复
-
bug composer
难度 2/5 1-3 小时 新手友好度 82/100
inmanta/web-console#8037 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtime未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复