Skip to content

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

Open
ToobLac wants to merge 132 commits into
HMCL-dev:mainfrom
ToobLac:mod-changelog
Open

[Feature] 模组等的更新日志以及 HTMLRenderer 的完善#6098
ToobLac wants to merge 132 commits into
HMCL-dev:mainfrom
ToobLac:mod-changelog

Conversation

@ToobLac
Copy link
Copy Markdown
Contributor

@ToobLac ToobLac commented May 16, 2026

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

具体变化:

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

TODO:

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

可能不准确不地道,需要熟悉这些语言的人验证
# 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
支持裸URL
修复更新日志过长时显示不全的问题
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
Calboot and others added 28 commits March 13, 2026 16:50
# 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
# Conflicts:
#	HMCL/src/main/resources/assets/about/deps.json
This reverts commit b62d8e3.
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/HTMLRenderer.java
#	HMCL/src/main/resources/assets/about/deps.json
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java
#	gradle/libs.versions.toml
# Conflicts:
#	HMCL/src/main/resources/assets/about/deps.json
#	HMCLCore/build.gradle.kts
#	gradle/libs.versions.toml
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AddonUpdatesPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/LocalModFile.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/util/StringUtils.java
@Glavo
Copy link
Copy Markdown
Member

Glavo commented May 21, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@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 changelog viewing system for mods and addons, incorporating the CommonMark library for Markdown-to-HTML conversion and significantly upgrading the HTMLRenderer to support tables, code blocks, and asynchronous image loading. UI updates in AddonUpdatesPage and DownloadPage enable users to access changelogs and external version URLs. Feedback points out potential memory leaks in JavaFX property bindings to static controllers, code duplication across changelog dialog implementations, and the need for more robust error handling when generating repository URLs to prevent UI crashes.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/HTMLRenderer.java
Comment on lines +366 to +367
tableView.setFixedCellSize(25);
tableView.setPrefHeight(25 * (rows.size() + 1) + 5);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

在渲染 HTML 表格时,使用固定的行高(setFixedCellSize(25))会导致内容在多行文本或较大字体下被截断。建议移除固定行高。另外,在第 373 行和第 380 行创建单元格内容时,未调用 mergeLineBreaks(),这可能导致表格内部的换行符处理与外部不一致。建议在 render() 之前调用 mergeLineBreaks()

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.

要不先这样吧。。。

修不好一点,子元素的高度明明只有15但父元素却有60,删掉固定行高会出问题

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] 更新模组时获取更新日志

3 participants