更新模组时允许选择目标版本并预览对应更新日志 - #6747
Conversation
Co-authored-by: mimo-v2.5
Co-authored-by: mimo-v2.5
|
这里不需要说“查看其他版本的游戏日志”啊,你直接说这里是“游戏版本”不就行了吗? |
感觉 “游戏版本” 也不太好,应该是 “模组版本” 吧? |
不是模组啊,资源包也可以检查更新的,光影包也有计划做 |
|
你确定这样不会oom吗,我记得 tnt 之前专门把这一堆候选给删掉了,因为会爆内存 以及你为什么要把 remoteVersions 和 remoteVersions.get(0) 都存在 AddonUpdate 里面呢?只存列表不就行了吗? |
当时看 glavo 似乎说错了,写的太快没想太多 🤣 |
“截至最新版本的所有变化” 如何?我暂时没想到其他的 |
直接“其他版本”行不行?或者“选择版本”? 要不顺便做一个让用户自己选择更新到什么版本得了,把“更新日志”那一列改成“其他版本”? 这样 targetVersion 字段也就可以省略了 |
这样就放心了。之前可能是modrinth更新会把更新日志直接拉下来然后就爆炸了,现在延后加载就好了 另外现在这么实现是不是只能看到 mr/cf 一方的版本啊?是否要把两个渠道的所有版本都显示出来,按发布时间排序? |
我觉得可以 😃 |
|
https://github.com/HMCL-dev/HMCL/actions/runs/32983901906/job/98227072480 What is this? What happened? |
Co-authored-by: mimo-v2.5
Co-authored-by: mimo-v2.5
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
When the user selects another target version, the listener updates targetVersionObject and reloads the changelog, but this URL loader is invoked only once during dialog construction. Consequently, the enabled mods.url hyperlink continues opening the initially selected version's page while the table and eventual update point to the newly selected version.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| fileName = StringConstant.valueOf(data.localAddonFile().getFileName()); | ||
| currentVersion = StringConstant.valueOf(data.currentVersion().version()); | ||
| targetVersion = this.targetVersionObject.map(RemoteAddon.Version::version); |
There was a problem hiding this comment.
Replace the JavaFX 19-only ObservableValue.map call
On the supported linux-loongarch64 distribution, JavaFXPlatform selects JavaFX 17.0.8, whose ObservableValue does not provide map. Opening the add-on updates page on that platform therefore reaches this newly compiled interface call and throws NoSuchMethodError; derive the target-version text with a binding/listener available in JavaFX 17 instead.
Useful? React with 👍 / 👎.
| addon.broken_dependency.desc=This dependency existed before, but it does not exist anymore. Try using another download source. | ||
| addon.category=Category | ||
| addon.changelog=Changelog | ||
| addon.changelog=Select target version |
There was a problem hiding this comment.
Preserve the shared changelog translation
This key is also used by DownloadPage for its changelog hyperlink and dialog heading (lines 528 and 659), outside the update-selection UI. Repurposing it makes those unrelated controls read “Select target version” even though they only display a fixed version's changelog; keep addon.changelog as “Changelog” and introduce a dedicated key for the new selector title.
Useful? React with 👍 / 👎.
| scrollPane.setContent(FXUtils.renderAddonChangelog(object.changelog, repo == null ? "" : repo.getBaseUrl())); | ||
| String html = StringUtils.isNotBlank(result) ? result : i18n("addon.changelog.empty"); | ||
| changelogCache.put(version.versionId(), html); | ||
| scrollPane.setContent(FXUtils.renderAddonChangelog(html, repo == null ? "" : repo.getBaseUrl())); |
There was a problem hiding this comment.
Ignore stale changelog task completions
If the user changes the version while a previous changelog request is still running, both tasks remain active and may finish out of order. This unconditional callback can therefore replace the selected version's changelog with an older selection's result and clear its loading/error state; apply the result only if version is still selected, or cancel/supersede the preceding task.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fcb77e67e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Task.supplyAsync(() -> { | ||
| RemoteAddonRepository repo = object.data.source().getRepoForType(object.data.repoType()); | ||
| return repo == null ? null : repo.getVersionPageUrl(object.data.targetVersion()); | ||
| return repo == null ? null : repo.getVersionPageUrl(object.targetVersionObject.get()); |
There was a problem hiding this comment.
Bind the version-page request to one selection
When the user changes the combo-box selection while a version-page lookup is running, this worker reads the mutable targetVersionObject, and multiple lookups can complete out of order; an older completion can therefore overwrite the hyperlink with a URL for a version that is no longer selected. A failed lookup also leaves the previously enabled URL in place. Pass the selected version into this method, disable/reset the button when starting, and only apply the result if that version remains selected.
Useful? React with 👍 / 👎.


以下演示稍显过时了,现在在选择框里选择版本可以改变实际会更新到的目标版本,文本也有变化。
得益于检查更新时已经收集过所有比当前更加新的模组版本了,最复杂的部分可以跳过,只考虑实现一个界面。
2026-08-26.223311.mp4
语言文件和第一个提交由AI生成。
fixes #6686