Skip to content

更新模组时允许选择目标版本并预览对应更新日志 - #6747

Open
ZZZank wants to merge 14 commits into
HMCL-dev:mainfrom
ZZZank:update-changelog-s
Open

更新模组时允许选择目标版本并预览对应更新日志#6747
ZZZank wants to merge 14 commits into
HMCL-dev:mainfrom
ZZZank:update-changelog-s

Conversation

@ZZZank

@ZZZank ZZZank commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

以下演示稍显过时了,现在在选择框里选择版本可以改变实际会更新到的目标版本,文本也有变化。


得益于检查更新时已经收集过所有比当前更加新的模组版本了,最复杂的部分可以跳过,只考虑实现一个界面。

Snipaste_2026-08-26_22-32-10
2026-08-26.223311.mp4

语言文件和第一个提交由AI生成。

fixes #6686

@github-actions github-actions Bot added the 40+ label Aug 26, 2026
`I18N_zh_CN.properties: misspelled '其它' should be replaced by '其他'` from `gradle checkTranslations`
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
@Glavo

Glavo commented Aug 27, 2026

Copy link
Copy Markdown
Member

这里不需要说“查看其他版本的游戏日志”啊,你直接说这里是“游戏版本”不就行了吗?

@3gf8jv4dv

3gf8jv4dv commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

这里不需要说“查看其他版本的游戏日志”啊,你直接说这里是“游戏版本”不就行了吗?

感觉 “游戏版本” 也不太好,应该是 “模组版本” 吧?

@ToobLac

ToobLac commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

感觉 “游戏版本” 也不太好,应该是 “模组版本” 吧?

不是模组啊,资源包也可以检查更新的,光影包也有计划做

@ToobLac

ToobLac commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

你确定这样不会oom吗,我记得 tnt 之前专门把这一堆候选给删掉了,因为会爆内存

以及你为什么要把 remoteVersions 和 remoteVersions.get(0) 都存在 AddonUpdate 里面呢?只存列表不就行了吗?

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

不是模组啊,资源包也可以检查更新的,光影包也有计划做

当时看 glavo 似乎说错了,写的太快没想太多 🤣

@ZZZank

ZZZank commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

所以有没有比较好的文本建议,最开始的“查看其他版本的游戏日志”还是太长了

你确定这样不会oom吗

我自己用visualvm试的时候是没注意到内存占用有什么区别,说实话多存这些record要是真能导致oom,那简直就是奇观。

下图是AddonUpdate在这个PR后的内存占用情况,(大约)59个可更新模组总共不到1mb。
image

为什么要把 remoteVersions 和 remoteVersions.get(0) 都存在 AddonUpdate 里面

毕竟最终更新到的版本还是那个targetVersion,这样意思表达比较直观就保留了。或者说懒得改定义也可以

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

所以有没有比较好的文本建议,最开始的“查看其他版本的游戏日志”还是太长了

“截至最新版本的所有变化” 如何?我暂时没想到其他的

@ToobLac

ToobLac commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

“截至最新版本的所有变化” 如何?我暂时没想到其他的

直接“其他版本”行不行?或者“选择版本”?

要不顺便做一个让用户自己选择更新到什么版本得了,把“更新日志”那一列改成“其他版本”?

这样 targetVersion 字段也就可以省略了

@ToobLac

ToobLac commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

下图是AddonUpdate在这个PR后的内存占用情况,(大约)59个可更新模组总共不到1mb。

这样就放心了。之前可能是modrinth更新会把更新日志直接拉下来然后就爆炸了,现在延后加载就好了

另外现在这么实现是不是只能看到 mr/cf 一方的版本啊?是否要把两个渠道的所有版本都显示出来,按发布时间排序?

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

直接“其他版本”行不行?或者“选择版本”?

要不顺便做一个让用户自己选择更新到什么版本得了,把“更新日志”那一列改成“其他版本”?

我觉得可以 😃

@Minecraft269

Copy link
Copy Markdown

@Minecraft269

Copy link
Copy Markdown
image 有俩Action炸了 估计是两(三)天前的问题 https://www.githubstatus.com/ https://www.githubstatus.com/incidents/kfspvrz14xr0

@github-actions github-actions Bot added 100+ and removed 40+ labels Aug 29, 2026
@ZZZank ZZZank changed the title 更新模组时允许查看其他版本的更新日志 更新模组时允许选择目标版本并预览对应更新日志 Aug 29, 2026
@Glavo

Glavo commented Sep 3, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T12:21:21.962964Z 9fcb77e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

loadVersionPageUrl(object, versionPageBtn);

P2 Badge Refresh the version-page link when selection changes

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Glavo

Glavo commented Sep 8, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

[Feature] 显示模组更新日志时包括从当前到最新的所有更新日志

5 participants