Skip to content

fix(ui): 修复 Markdown 弹窗中超链接点击无反应#3423

Open
Lokins577 wants to merge 2 commits into
PCL-Community:devfrom
Lokins577:fix/markdown-hyperlink
Open

fix(ui): 修复 Markdown 弹窗中超链接点击无反应#3423
Lokins577 wants to merge 2 commits into
PCL-Community:devfrom
Lokins577:fix/markdown-hyperlink

Conversation

@Lokins577

@Lokins577 Lokins577 commented Jul 16, 2026

Copy link
Copy Markdown
Member

Markdig.Wpf 的超链接点击会发出 Markdig.Wpf.Commands.Hyperlink 路由命令,需由宿主绑定处理才会导航;MyMsgMarkdown 从未绑定该命令,导致更新日志等Markdown 弹窗中的蓝色链接渲染正常但点击无任何反应。

在 MyMsgMarkdown 构造中为该命令添加 CommandBinding,处理器取命令参数(URL)交由 ModBase.OpenWebsite 打开。一处修复覆盖所有 Markdown 弹窗(更新日志、反馈详情、设置-更新的更新日志详情)。

resolves #3419

本PR的提交信息生成由Claude Code Opus 4.8生成,由Opus 4.8对代码进行了审查。

Summary by Sourcery

Bug Fixes:

  • 修复在更新日志和其他 Markdown 弹窗中,Markdown 对话框中的超链接虽然显示为蓝色链接但点击无响应的问题。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix Markdown dialog hyperlinks that rendered as blue links but did not respond to clicks in update logs and other Markdown popups.
Original summary in English

Summary by Sourcery

Bug Fixes:

  • 修复在更新日志和其他 Markdown 弹窗中,Markdown 对话框中的超链接虽然显示为蓝色链接但点击无响应的问题。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix Markdown dialog hyperlinks that rendered as blue links but did not respond to clicks in update logs and other Markdown popups.

@pcl-ce-automation pcl-ce-automation Bot added 🚧 正在处理 开发人员正在对该内容进行开发、测试或修复,进展中 size: XS PR 大小评估:微型 labels Jul 16, 2026
@Lokins577
Lokins577 marked this pull request as ready for review July 16, 2026 17:17
@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 and removed 🚧 正在处理 开发人员正在对该内容进行开发、测试或修复,进展中 labels Jul 16, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 16, 2026

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

审阅者指南

在 Markdown 消息对话框中添加一个命令绑定,使 Markdig.Wpf 的超链接命令通过打开关联 URL 来处理,从而修复所有基于 Markdown 的弹窗中无响应的链接问题。

处理 Markdown 超链接点击的序列图

sequenceDiagram
    actor User
    participant MyMsgMarkdown
    participant MarkdigWpf
    participant ModBase

    User->>MarkdigWpf: Click hyperlink
    MarkdigWpf->>MyMsgMarkdown: Commands.Hyperlink (url)
    MyMsgMarkdown->>MyMsgMarkdown: _OpenHyperlink(e)
    MyMsgMarkdown->>ModBase: OpenWebsite(url)
Loading

文件级变更

变更 详情 文件
在 Markdown 对话框中处理 Markdig.Wpf 的超链接命令,将其绑定到一个打开 URL 的处理程序。
  • 在 MyMsgMarkdown 构造函数中为 Markdig.Wpf.Commands.Hyperlink 添加 CommandBinding,使超链接点击会调用处理程序。
  • 实现一个静态的 _OpenHyperlink 命令处理程序,从命令参数中读取 URL,并将导航委托给 ModBase.OpenWebsite。
  • 通过在此控件中集中设置绑定,确保修复应用于所有使用 MyMsgMarkdown 的对话框,例如更新日志和反馈详情。
Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml.cs

与关联 Issue 的对照评估

Issue 目标 是否解决 说明
#3419 确保 Markdown 驱动的更新日志弹窗(以及其他 Markdown 对话框)中的蓝色下划线超链接在点击时会触发导航并打开对应的 URL。

可能关联的其他 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 来触发新审阅!

自定义你的体验

访问你的 控制面板,可以:

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

获取帮助

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

Reviewer's Guide

Adds a command binding in the Markdown message dialog so that Markdig.Wpf hyperlink commands are handled by opening the associated URL, fixing non-responsive links in all Markdown-based popups.

Sequence diagram for handling Markdown hyperlink clicks

sequenceDiagram
    actor User
    participant MyMsgMarkdown
    participant MarkdigWpf
    participant ModBase

    User->>MarkdigWpf: Click hyperlink
    MarkdigWpf->>MyMsgMarkdown: Commands.Hyperlink (url)
    MyMsgMarkdown->>MyMsgMarkdown: _OpenHyperlink(e)
    MyMsgMarkdown->>ModBase: OpenWebsite(url)
Loading

File-Level Changes

Change Details Files
Handle Markdig.Wpf hyperlink commands in the Markdown dialog by binding them to an URL-opening handler.
  • Add a CommandBinding for Markdig.Wpf.Commands.Hyperlink in the MyMsgMarkdown constructor so hyperlink clicks invoke a handler.
  • Implement a static _OpenHyperlink command handler that reads the URL from the command parameter and delegates navigation to ModBase.OpenWebsite.
  • Ensure the fix applies to all dialogs that use MyMsgMarkdown, such as update logs and feedback details, by centralizing the binding in this control.
Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#3419 Ensure that blue underlined hyperlinks in the Markdown-based update log popup (and other Markdown dialogs) trigger navigation and open the corresponding URL when clicked.

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.

嗨,我已经审查了你的修改,看起来很棒!


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

Hey - I've reviewed your changes and they look great!


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: 75316e4feb

ℹ️ 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/Controls/MyMsg/MyMsgMarkdown.xaml.cs Outdated
@pcl-ce-automation pcl-ce-automation Bot added size: S PR 大小评估:小型 and removed size: XS PR 大小评估:微型 labels Jul 16, 2026
@Lokins577
Lokins577 requested a review from a team July 19, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S PR 大小评估:小型 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#]: 更新日志中的蓝色链接没有交互事件(点不开)

1 participant