Skip to content

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

Merged
Glavo merged 184 commits into
HMCL-dev:mainfrom
ToobLac:mod-changelog
Aug 5, 2026
Merged

Glavo merged 184 commits into
HMCL-dev:mainfrom
ToobLac:mod-changelog

Conversation

@ToobLac

@ToobLac ToobLac commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

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

具体变化:

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

TODO:

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

Reference: #4828

可能不准确不地道,需要熟悉这些语言的人验证
# 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
@3gf8jv4dv

Copy link
Copy Markdown
Contributor

拉锯战

我找个时间再测测。

ToobLac added 5 commits August 1, 2026 23:06
# Conflicts:
#	HMCLCore/src/main/java/org/jackhuang/hmcl/addon/RemoteAddon.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/addon/repository/CurseForgeRemoteAddonRepository.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/instances/DownloadPage.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/addon/repository/CurseForgeRemoteAddonRepository.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/addon/repository/ModrinthRemoteAddonRepository.java
@3gf8jv4dv

3gf8jv4dv commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Fresh Animations

最近几版的日志有个水平线,但没有渲染。CF / MR 都有。

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

Collective

最近几版日志下面有几张图片,但没有渲染。仅 CF。

@ToobLac

ToobLac commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

最近几版日志下面有几张图片,但没有渲染。仅 CF。

这几个是 SVG。起码 alt 没问题(

最近几版的日志有个水平线,但没有渲染。CF / MR 都有。

CommonMark 好像没支持这个。

这俩问题都得好好考虑一下怎么解决了

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

这几个是 SVG。起码 alt 没问题(

欸,我看上面两个 What’s new 和 Historic changelog 也是 SVG,但它们渲染了。这其中有啥奥秘吗 🤔

@ToobLac

ToobLac commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

#6098 (comment) solved

@ToobLac

ToobLac commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

欸,我看上面两个 What’s new 和 Historic changelog 也是 SVG,但它们渲染了。这其中有啥奥秘吗 🤔

下面这几个SVG开头有一个 <?xml...> 的标签,然而HMCL识别SVG靠的是看最开头几个字母是不是 <svg ,然后就炸了

@ToobLac

ToobLac commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

#6098 (comment)

@3gf8jv4dv 这个我不太想整了。这玩意是 ImageUtils 的问题,而且由于 SVG 是 XML 格式,且尝试判断图片加载器的时候只会用前 1024 个 byte,导致没法做 XML 解析。我打算提个 issue,以后再搞。至少现在是能用的。

@3gf8jv4dv

3gf8jv4dv commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

#6098 (comment)

@3gf8jv4dv 这个我不太想整了。这玩意是 ImageUtils 的问题,而且由于 SVG 是 XML 格式,且尝试判断图片加载器的时候只会用前 1024 个 byte,导致没法做 XML 解析。我打算提个 issue,以后再搞。至少现在是能用的。

OK 的。我的想法是,如果没有维护者难以接受的问题,这个 PR 应该尽早合并到开发版里供大伙试用。

@Glavo

Glavo commented Aug 5, 2026

Copy link
Copy Markdown
Member

@codex review

# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/instances/DownloadPage.java

@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: 8b30497ad4

ℹ️ 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 +171 to +174
if (code) {
text.getStyleClass().add("html-code");
text.setStyle("-fx-font-family: \"%s\";".formatted(Lang.requireNonNullElse(settings().logFontFamilyProperty().get(), FXUtils.DEFAULT_MONOSPACE_FONT)));
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.

P3 Badge Preserve links inside inline code

When changelog Markdown uses code as the link label, such as [`foo`](https://example.com), CommonMark renders nested <a><code>...</code></a>. This early return handles the code styling before the hyperlink branch below runs, so the visible link text gets no click handler or hand cursor and the link is dead; apply the code styling without bypassing the hyperlink handling.

Useful? React with 👍 / 👎.

@Glavo
Glavo merged commit 0443ff7 into HMCL-dev:main Aug 5, 2026
3 checks passed
@3gf8jv4dv

Copy link
Copy Markdown
Contributor

善

@ToobLac

ToobLac commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

OHHHHHHH

@ToobLac
ToobLac deleted the mod-changelog branch August 5, 2026 14:26
MinecraftSTL pushed a commit to MinecraftSTL/XYML that referenced this pull request Aug 17, 2026
MinecraftSTL added a commit to MinecraftSTL/XYML that referenced this pull request Aug 17, 2026
Upstream endpoint: cf21cf4 (HMCL-dev#6649).

Integrates the audited applicable upstream changes with XYML equivalents:
- HMCL-dev#6098 0443ff7: on-demand add-on changelogs and safe Swing HTML rendering.
- HMCL-dev#6620 ff459a5: exact provider version links.
- HMCL-dev#6617 c149401: changelog spacing.
- HMCL-dev#6630 15d4874: streaming MCBBS pack metadata.
- HMCL-dev#6633 8eec184: instance selector popup toggle.
- HMCL-dev#6641 0807c04: 32-bit automatic-memory cap.
- HMCL-dev#6642 78b8d37: missing manifest patches handling.
- HMCL-dev#6636 a0d1fa8: OOM task lifecycle completion.
- HMCL-dev#6649 cf21cf4: non-empty log export with native-encoding fallback.

Commit HMCL-dev#6613 (5796dad) is intentionally content-skipped because it only changes the removed JavaFX image-detection/UI path.

Conflict policy: retain the Swing rewrite and all XYML-specific behavior; do not restore removed JavaFX/JFoenix files. This merge makes the cached upstream history an ancestor without forcing unrelated branch differences into the resulting tree.
MinecraftSTL added a commit to MinecraftSTL/XYML that referenced this pull request Aug 18, 2026
Upstream endpoint: cf21cf4 (HMCL-dev#6649).

Integrates the audited applicable upstream changes with XYML equivalents:
- HMCL-dev#6098 0443ff7: on-demand add-on changelogs and safe Swing HTML rendering.
- HMCL-dev#6620 ff459a5: exact provider version links.
- HMCL-dev#6617 c149401: changelog spacing.
- HMCL-dev#6630 15d4874: streaming MCBBS pack metadata.
- HMCL-dev#6633 8eec184: instance selector popup toggle.
- HMCL-dev#6641 0807c04: 32-bit automatic-memory cap.
- HMCL-dev#6642 78b8d37: missing manifest patches handling.
- HMCL-dev#6636 a0d1fa8: OOM task lifecycle completion.
- HMCL-dev#6649 cf21cf4: non-empty log export with native-encoding fallback.

Commit HMCL-dev#6613 (5796dad) is intentionally content-skipped because it only changes the removed JavaFX image-detection/UI path.

Conflict policy: retain the Swing rewrite and all XYML-specific behavior; do not restore removed JavaFX/JFoenix files. This merge makes the cached upstream history an ancestor without forcing unrelated branch differences into the resulting tree.
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