Skip to content

[Bugfix] 修复导出整合包文件选择界面UI线程阻塞#6363

Open
ToobLac wants to merge 1 commit into
HMCL-dev:mainfrom
ToobLac:fix/6354
Open

[Bugfix] 修复导出整合包文件选择界面UI线程阻塞#6363
ToobLac wants to merge 1 commit into
HMCL-dev:mainfrom
ToobLac:fix/6354

Conversation

@ToobLac

@ToobLac ToobLac commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #6354

现在在 IO 线程上进行加载,加载完成后再显示并开放“下一步”按钮

@ToobLac
ToobLac marked this pull request as ready for review July 10, 2026 10:12
@CiiLu

CiiLu commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

我感觉可以把文件树展开变成惰性加载,现在太卡是主要因为每次进入这个页面都会创建完整的文件树列表项控件(并且可能造成大量内存占用),感觉这样还是有点治标不治本

@ToobLac

ToobLac commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

我感觉可以把文件树展开变成惰性加载,现在太卡是主要因为每次进入这个页面都会创建完整的文件树列表项控件(并且可能造成大量内存占用),感觉这样还是有点治标不治本

那展开节点的时候还得卡一下,手感不好啊。而且本来加载的过程根本不读取文件内容,只看文件名以及是否为目录,占用和耗时并不是很大

@Glavo Glavo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本审查建议由 GPT-5.6 Sol 生成


已将具体审查建议标注在对应代码行。

setMargin(spinnerPane, new Insets(10, 10, 5, 10));
this.setCenter(spinnerPane);

spinnerPane.setLoading(true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当遍历期间出现 UncheckedIOException 等异常时,CompletableFuture 会异常完成,导致 thenAcceptAsync 完全不执行;此时 spinnerPane 永远保持加载状态,“下一步”也始终禁用,且异常不会被记录或展示。应添加异常完成处理,在 JavaFX 线程中结束加载状态并向用户报告或允许重试。

@@ -176,6 +189,7 @@ public void cleanup(SettingsMap settings) {
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当游戏目录不存在、为空或所有内容均被过滤时,getTreeItem 会返回 null;加载结束后按钮会重新启用,但此处直接返回,使用户点击“下一步”没有任何反应。修改前 getFilesNeeded(null, ...) 会生成空列表并继续调用 controller.onFinish(),因此这是空目录场景下的新回归。

@github-actions github-actions Bot added the 10+ label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 当导出整合包功能时,整合包文件过多时,检索文件时会提示启动器无响应

3 participants