[Bug] 项目树删除时在窗口线程逐个同步执行废纸篓命令或 os.RemoveAll,大目录或多选删除会卡住界面
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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. / 我已从报告中移除敏感信息和个人数据。
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 151
- Merge medio
- 3 h 48 min
- PR fusionados (30 d)
- 571
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 1lck/Lithe-IDEA
-
review: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
1lck/Lithe-IDEA#2432 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
1lck/Lithe-IDEA#2431 ·
Los mantenedores suelen responder en 1 día
-
refactor review: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
1lck/Lithe-IDEA#2376 ·
Los mantenedores suelen responder en 1 día
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
1lck/Lithe-IDEA#2365 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
1lck/Lithe-IDEA#2434 ·
Los mantenedores suelen responder en 1 día
Todos los issues de 1lck/Lithe-IDEA
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
posit-dev/positron-sas-extension#196 ·
Los mantenedores suelen responder en 1 día
-
bug composer
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
inmanta/web-console#8037 ·
Los mantenedores suelen responder en 1 día
-
Add: AlFajer Palestine FHDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día