Skip to content

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

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

ZZZank wants to merge 11 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
@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
Contributor

@Minecraft269

Copy link
Copy Markdown
Contributor
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-10T14:01:20.118943Z f2cc90f 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".

@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".

@Glavo

Glavo commented Sep 9, 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: cc50e63e7a

ℹ️ 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".

Comment on lines +380 to +383
RemoteAddon.Version currentVersion = object.targetVersionObject.get();
if (currentVersion != null && !currentVersion.versionId().equals(version.versionId())) {
// Version changed while loading, discard this result. Why's there no 'Task.interrupt()'
return;

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 Supersede requests instead of comparing only version IDs

When the user selects A → B → A before the first A changelog request completes, both A callbacks pass this version-ID check, so the older request can finish last and overwrite the newer request’s loading/error state—for example, a late failure can hide a successfully rendered changelog behind the retry state. Fresh evidence in this revision is that the stale-result guard identifies only the selected version, not the individual request; track a request generation/task identity so only the most recently started request may update the pane.

Useful? React with 👍 / 👎.

@github-actions github-actions 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.

🤖 Static analysis found the following issues (max count 10):

@Glavo

Glavo commented Sep 10, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: f2cc90f690

ℹ️ 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".

@Minecraft269

Copy link
Copy Markdown
Contributor

#6844 (comment)

@Glavo

Glavo commented Sep 11, 2026

Copy link
Copy Markdown
Member
image

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

@Glavo 这个有什么问题吗?点击 “查看” 可以选择模组的某个版本。

Co-authored-by: deepseek-v4.1-flash
apparently you can't use `Bindings.createStringBinding` because it will read value eagerly, causing subtitle to always be one step short
@ZZZank
ZZZank force-pushed the update-changelog-s branch from 2385b73 to 99ea62b Compare October 17, 2026 11:27
@ZZZank

ZZZank commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

按照改版之后的代码库重新写了一次,再做了一次测试:

2026-10-17.182258.mp4

以及,感觉这里条目的边距似乎比其他地方大不少

@burningtnt

Copy link
Copy Markdown
Member

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

在超大型整合包里真的会炸,请优化。

未来我们会进一步降低 HMCL 的 -Xmx 设置以降低占用

@ToobLac

ToobLac commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

在超大型整合包里真的会炸,请优化。

看来只能保留一个版本名到更新日志的 map 了啊,没办法实现自选版本来更新了

不过我觉得有点奇怪,毕竟他声称 59 个 mod 只占用 1MB,那得多少个 mod 才能爆内存啊

@ZZZank

ZZZank commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

在超大型整合包里真的会炸,请优化。

有无证明或者实例,我是想不到怎么个炸法。

另外我让ai做了个极端的模拟计算,看不出多大的oom风险:

模拟计算,点击展开

不妨假设有1000个模组,每个有100个更加新的版本(说实话我觉得平均下来有10个都顶天了,但是反正是极端),模组自身的数据按照下表设定:

类型 轻量 LIGHT 典型 TYPICAL 重型 HEAVY
name ModName 1.2.3(约 16 字符) ModName 1.2.3 for Fabric and NeoForge(约 40 字符) 同典型(约 40 字符)
file.hashes 只有 sha512(128 字符) sha512 + sha1(128 + 40) sha512 + sha1
file.url 约 95 字符 约 110 字符 约 115 字符
dependencies 0 个 0–3 个,均值 1.5 0–6 个,均值 3
gameVersions 1 个 1–4 个,均值 2.5 5–8 个,均值 6.5
loaders 1 个(Fabric) 2 个(Fabric + NeoForge) 4 个(Fabric/NeoForge/Quilt/Forge)
每候选版本 922 B 1320 B 1712 B

为了方便,按照只有一种类型计算。

模拟程序:https://gist.github.com/ZZZank/4828bd0bf8968b21492bf86e9ef269eb

在1000模组*100更新的情况下,内存占用大约是126MB:

$ java -Xmx3g AddonMemorySim.java typical 1000 100
scale: 1000 addons x 100 candidate versions = 101,000 Version objects

| profile | total MB | per candidate version (B) |
|---|---|---|
| LIGHT | 87.9 | 922 |
| TYPICAL | 125.8 | 1320 |
| HEAVY | 163.2 | 1711 |

如果正常一点,1000模组*10更新,那就只有区区14MB:

$ java -Xmx3g AddonMemorySim.java typical 1000 10
scale: 1000 addons x 10 candidate versions = 11,000 Version objects

| profile | total MB | per candidate version (B) |
|---|---|---|
| LIGHT | 9.8 | 1026 |
| TYPICAL | 13.8 | 1451 |
| HEAVY | 18.0 | 1886 |

Iu-yang1 added a commit to Iu-yang1/HMCL-Fix that referenced this pull request Oct 21, 2026
Iu-yang1 added a commit to Iu-yang1/HMCL-Fix that referenced this pull request Oct 21, 2026
Iu-yang1 added a commit to Iu-yang1/HMCL-Fix that referenced this pull request Oct 21, 2026
Upstream HMCL HMCL-dev#6194 HMCL-dev#6860 HMCL-dev#6947 HMCL-dev#6747 HMCL-dev#6806 HMCL-dev#6407 HMCL-dev#6869 HMCL-dev#6825. Adapt JFXPopup and mod update logic to preserve existing fork features; retain crash diagnostics. Java CI and Check Codes passed; JAR/EXE/SH/DEB and nonempty credentials verified.
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/instances/AddonUpdatesPage.java
for less diff against `main`
@ZZZank

ZZZank commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

有无更新?“超大型整合包里真的会炸”这个说法的例子,或者PR什么时候有合并的可能?8月挂到11月了已经

@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-6 Astra 生成

# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/instances/AddonUpdatesPage.java
#	HMCL/src/main/resources/assets/lang/I18N_zh_Hant.properties

This branch has not been deployed

No deployments
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] 显示模组更新日志时包括从当前到最新的所有更新日志

6 participants