Skip to content

fix(download-lib): 修复 Wiki 链接拼接缺少斜杠#3227

Merged
lhx077 merged 3 commits into
devfrom
fix/3223
Jun 21, 2026
Merged

fix(download-lib): 修复 Wiki 链接拼接缺少斜杠#3227
lhx077 merged 3 commits into
devfrom
fix/3223

Conversation

@LuLu-ling

@LuLu-ling LuLu-ling commented Jun 21, 2026

Copy link
Copy Markdown
Member

close #3223

Summary by Sourcery

Bug Fixes:

  • 修复在拼接 Wiki 基础 URL 和用于更新日志链接的路径后缀时缺少斜杠的问题。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix missing slash when concatenating the Wiki base URL and path suffix for update log links.

@LuLu-ling LuLu-ling requested a review from a team June 21, 2026 08:05
@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: XS PR 大小评估:微型 labels Jun 21, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor
审阅者指南(在小型 PR 上折叠)

审阅者指南

在构造更新日志视图中使用的 Minecraft Wiki URL 时,补上缺失的斜杠,确保在打开网站之前,基础 URL 与版本对应的 wiki 路径能够被正确拼接。

McUpdateLogShow 中更正后 Wiki URL 构造的时序图

sequenceDiagram
    participant Caller
    participant ModDownloadLib
    participant McFormatter
    participant ModBase

    Caller->>ModDownloadLib: McUpdateLogShow(versionJson)
    ModDownloadLib->>McFormatter: GetWikiUrlSuffix(id)
    McFormatter-->>ModDownloadLib: wikiName
    ModDownloadLib->>McFormatter: GetWikiBaseUrl()
    McFormatter-->>ModDownloadLib: baseUrl
    Note right of ModDownloadLib: baseUrl + "/" + wikiName
    ModDownloadLib->>ModBase: OpenWebsite(wikiUrl)
Loading

文件级变更

变更 详情 文件
修复更新日志视图中 Minecraft Wiki 链接的 URL 构造,确保包含分隔斜杠。
  • 像之前一样,使用 McFormatter.GetWikiUrlSuffix 从版本 JSON 中获取 wiki URL 后缀。
  • 修改 wiki URL 拼接逻辑,在 McFormatter.GetWikiBaseUrl() 与 wiki 后缀之间插入一个 '/'。
  • 保持 McUpdateLogShow 其余逻辑(读取 id 和打开网站)不变。
Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs

与关联 Issue 的对照评估

Issue 目标 是否解决 说明
#3223 修复 Minecraft 更新日志(更新日志)按钮,使其在浏览器中打开正确的网页,而不是空白/无效页面。

可能相关的 Issue


小贴士与命令

与 Sourcery 互动

  • 触发新的审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub Issue: 在某条审阅评论下回复,请求 Sourcery 从该评论创建一个 Issue。你也可以直接回复 @sourcery-ai issue,从该评论生成 Issue。
  • 生成 pull request 标题: 在 pull request 标题中的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文中的任意位置写上 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,以标记所有 Sourcery 评论为已解决。如果你已处理完所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 审阅。特别适合在你想从一次全新的审阅开始时使用——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义你的体验

前往你的 dashboard 来:

  • 启用或禁用审阅功能,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a missing slash when constructing the Minecraft Wiki URL used in the update log view, ensuring the base URL and version-specific wiki path are concatenated correctly before opening the website.

Sequence diagram for corrected Wiki URL construction in McUpdateLogShow

sequenceDiagram
    participant Caller
    participant ModDownloadLib
    participant McFormatter
    participant ModBase

    Caller->>ModDownloadLib: McUpdateLogShow(versionJson)
    ModDownloadLib->>McFormatter: GetWikiUrlSuffix(id)
    McFormatter-->>ModDownloadLib: wikiName
    ModDownloadLib->>McFormatter: GetWikiBaseUrl()
    McFormatter-->>ModDownloadLib: baseUrl
    Note right of ModDownloadLib: baseUrl + "/" + wikiName
    ModDownloadLib->>ModBase: OpenWebsite(wikiUrl)
Loading

File-Level Changes

Change Details Files
Fix URL construction for Minecraft Wiki links in the update log view to include a separating slash.
  • Retrieve the wiki URL suffix from the version JSON as before using McFormatter.GetWikiUrlSuffix.
  • Change the wiki URL composition to insert a '/' between McFormatter.GetWikiBaseUrl() and the wiki suffix.
  • Leave the rest of the McUpdateLogShow logic (reading id and opening the website) unchanged.
Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#3223 Fix the Minecraft update log (更新日志) button so that it opens the correct web page in the browser instead of an empty/invalid page.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

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.

Hey - 我已经给出了一些整体性的反馈:

  • 在拼接之前,考虑对 GetWikiBaseUrl() 做一次规范化处理(例如去掉末尾的 /),这样即使基础 URL 将来改为包含结尾斜杠,也能避免在最终 URL 中出现潜在的 //
面向 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- Consider normalizing `GetWikiBaseUrl()` (e.g., trimming any trailing `/`) before concatenation so that you avoid potential `//` in the URL if the base URL ever changes to include a trailing slash.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈来改进以后的评审。
Original comment in English

Hey - I've left some high level feedback:

  • Consider normalizing GetWikiBaseUrl() (e.g., trimming any trailing /) before concatenation so that you avoid potential // in the URL if the base URL ever changes to include a trailing slash.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider normalizing `GetWikiBaseUrl()` (e.g., trimming any trailing `/`) before concatenation so that you avoid potential `//` in the URL if the base URL ever changes to include a trailing slash.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@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: bc7da1fff3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs Outdated
Chiloven945
Chiloven945 previously approved these changes Jun 21, 2026
Comment thread Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs Outdated
@lhx077 lhx077 merged commit ffbe800 into dev Jun 21, 2026
3 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Jun 21, 2026
@lhx077 lhx077 deleted the fix/3223 branch June 21, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS PR 大小评估:微型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#]: 无法查看Minecraft更新日志

4 participants