Skip to content

[Feature] 模组等的更新日志以及 HTMLRenderer 的完善#4828

Open
Calboot wants to merge 126 commits intoHMCL-dev:mainfrom
Calboot:mod-changelog
Open

[Feature] 模组等的更新日志以及 HTMLRenderer 的完善#4828
Calboot wants to merge 126 commits intoHMCL-dev:mainfrom
Calboot:mod-changelog

Conversation

@Calboot
Copy link
Copy Markdown
Contributor

@Calboot Calboot commented Nov 19, 2025

添加了下载模组、数据包等以及更新模组时显示更新日志的功能
Resolves #4685

具体变化:

  • 以下载模组为例,在原来仅用作展示模组依赖项的页面中同时展示该版本更新日志并可跳转到版本发布界面
  • 检查模组更新之后的表格中在最右侧添加“更新日志”列,点击单元格即可打开更新日志并可跳转到版本发布界面
  • 添加打开链接页面的“复制”按钮
  • HTMLRenderer 的优化与完善,以及对 Markdown 的支持(引入了新依赖)

TODO:

  • 添加下载时的更新日志
  • 添加更新模组时的更新日志
  • 给上述功能添加多语言支持
  • HTML
  • Markdown
  • Cache

依赖 #5463

@Calboot
Copy link
Copy Markdown
Contributor Author

Calboot commented Nov 21, 2025

需要能读懂日语、俄语、乌克兰语、西班牙语的人来审核一下语言文件

我把那些语言的删了,以后再加吧

# Conflicts:
#	HMCL/src/main/resources/assets/lang/I18N.properties
#	HMCL/src/main/resources/assets/lang/I18N_es.properties
#	HMCL/src/main/resources/assets/lang/I18N_ja.properties
#	HMCL/src/main/resources/assets/lang/I18N_lzh.properties
#	HMCL/src/main/resources/assets/lang/I18N_ru.properties
#	HMCL/src/main/resources/assets/lang/I18N_uk.properties
#	HMCL/src/main/resources/assets/lang/I18N_zh.properties
#	HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModUpdatesPage.java
@Calboot
Copy link
Copy Markdown
Contributor Author

Calboot commented Dec 13, 2025

现在对 Markdown 里面的裸超链接还没有进行支持,是否应该支持?

支持裸URL
修复更新日志过长时显示不全的问题
@Calboot
Copy link
Copy Markdown
Contributor Author

Calboot commented Dec 19, 2025

现在对 Markdown 里面的裸超链接还没有进行支持,是否应该支持?

Solved

@Calboot
Copy link
Copy Markdown
Contributor Author

Calboot commented Dec 20, 2025

HMCL jar 文件体积变大了 0.2MB,应该问题不大吧…?

Calboot added 6 commits March 13, 2026 16:53
# Conflicts:
#	HMCLCore/build.gradle.kts
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
#	HMCL/src/main/resources/assets/css/root.css
@3gf8jv4dv
Copy link
Copy Markdown
Contributor

我不太理解这个 PR 不合并的点在哪。

而且,目前已经有一些启动器,可以展示更新日志,如 XMCL——它使用 Electron,所以对于它而言是「顺手的事」。
HMCL 能实现这个功能的话,也可以吸引青睐此项的用户。

此外我同意 Calboot 说的,

能满足少数人(比如我自己)的需求而不会影响大部队的使用体验

何乐而不为呢?

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 3, 2026

@codex review

Copy link
Copy Markdown

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

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: 917d7d9586

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

Calboot added 2 commits April 3, 2026 21:33
# Conflicts:
#	HMCL/src/main/resources/assets/about/deps.json
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 3, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive system for displaying mod changelogs and external URLs within the launcher. It adds Markdown-to-HTML conversion using the CommonMark library, enhances the HTMLRenderer to support tables, lists, and code blocks, and integrates these features into the mod download and update pages. Key improvements include a new changelog cache, confirmation dialogs for opening external links, and updated repository interfaces to fetch changelog data from CurseForge and Modrinth. Feedback highlights the need for proper equals/hashCode implementations in the Version class to ensure cache hits, fixing style inheritance in the HTML renderer, and improving the rendering of inline code and table content.

AutolinkExtension.create(), InsExtension.create(), StrikethroughExtension.create(), TablesExtension.create()
)).build();

public static String convertToHtml(String md) {
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.

有必要把 Markdown 转成 HTML 再渲染吗?直接写 Markdown 的渲染器更合适吧?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

两个标记语言写两套完全不同的渲染器感觉没啥好处吧


if (downloadButton == null) {
this.setActions(saveAsButton, cancelButton);
this.setActions(versionPageBtn, changelogButton, saveAsButton, cancelButton);
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.

考虑把这些链接样式的按钮拆分到单独一行上,不要和 downloadButtonsaveAsButton 还有 cancelButton 在一行里抢地方了。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

不会抢地方吧,即便是英语也能一整行放下

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

我能理解现在这样会抢视觉重心,但问题在于那个小对话框本来就没多大地方,其他地方要么放不下要么很突兀,还不如现在这里

applyStyle(textNode);
children.add(textNode);
if (code) {
var codeFlow = new TextFlow(textNode);
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.

有必要给所有 <code> 标签生成子 TextFlow 吗?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

有的很长的不用textflow就没办法换行了,而需不需要换行并不是很容易判断的事


String style = node.attr("style");
if (StringUtils.isNotBlank(style)) {
styleBuilder.append(StringUtils.addSuffix(
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.

不应该这么简单地处理 CSS 样式,我们可能需要实现更完整的 CSS 解析。

@3gf8jv4dv
Copy link
Copy Markdown
Contributor

3gf8jv4dv commented Apr 6, 2026

  1. 日志加载失败时,仍然显示「加载版本列表失败」。
Image1
  1. 平台 (CurseForge/Modrinth) 没有提供日志时,措辞可以考虑改一下,明确源本身没有提供日志。目前的提示「暂无更新日志」含义模糊。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 更新模组时获取更新日志

5 participants