Skip to content

fix(crash): 修复部分证据来源显示异常 & 略微加粗 Code 控件边框#3072

Merged
Chiloven945 merged 1 commit into
refactor/crashfrom
refactor/crash-1
Jun 7, 2026
Merged

fix(crash): 修复部分证据来源显示异常 & 略微加粗 Code 控件边框#3072
Chiloven945 merged 1 commit into
refactor/crashfrom
refactor/crash-1

Conversation

@LuLu-ling

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

Copy link
Copy Markdown
Member
PixPin_2026-06-08_01-06-34 PixPin_2026-06-08_01-03-36

Summary by Sourcery

为崩溃事实(crash facts)添加证据元数据,并略微增加崩溃界面中代码块的可视边框厚度。

New Features:

  • 在从解析上下文创建崩溃事实时,附加崩溃证据元数据(来源类型和名称)。

Bug Fixes:

  • 确保与运行时相关的崩溃事实能正确记录其证据来源,适用于 Java 启动器日志和 Minecraft 版本检测。

Enhancements:

  • 加粗崩溃可视化界面中代码 UI 元素的边框,以提升可见度。
Original summary in English

Summary by Sourcery

Annotate crash facts with evidence metadata and slightly increase the visual border thickness of code blocks in crash UI.

New Features:

  • Attach crash evidence metadata (source kind and name) when creating crash facts from parsing context.

Bug Fixes:

  • Ensure runtime-related crash facts correctly record their evidence source for Java launcher logs and Minecraft version detection.

Enhancements:

  • Thicken the border of code UI elements in the crash visualization to improve visibility.

@LuLu-ling LuLu-ling requested a review from Chiloven945 June 7, 2026 16:07
@pcl-ce-automation pcl-ce-automation Bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 size: S PR 大小评估:小型 labels Jun 7, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 7, 2026

Copy link
Copy Markdown
审查者指南(在小型 PR 上折叠显示)

审查者指南

为通过解析日志创建的崩溃事实添加证据元数据,并略微增加崩溃代码显示控件的边框粗细。

为解析出的崩溃事实添加证据的时序图

sequenceDiagram
    participant JavaCrashParser
    participant MinecraftCrashReportParser
    participant CrashFactFactory
    participant CrashFact

    JavaCrashParser->>CrashFactFactory: CreateFromContext(JavaVersionDetected, javaInfo, properties, visibility, strength, scope, CrashLogKind.LauncherLog, sourceName)
    CrashFactFactory->>CrashFact: new CrashFact()
    CrashFactFactory->>CrashFact: set Evidence = [CrashFactEvidence]

    MinecraftCrashReportParser->>CrashFactFactory: CreateFromContext(MinecraftVersionDetected, minecraftVersion, properties, visibility, strength, scope, CrashLogKind.LauncherLog, sourceName)
    CrashFactFactory->>CrashFact: new CrashFact()
    CrashFactFactory->>CrashFact: set Evidence = [CrashFactEvidence]
Loading

文件级变更

变更 详情 文件
将崩溃日志来源元数据作为结构化证据传播到新创建的 CrashFact 实例中。
  • 扩展 CrashFactFactory.CreateFromContext 签名,以接受可选的 sourceKind 和 sourceName 参数。
  • 在提供 sourceKind/sourceName 时,用其初始化 CrashFact.Evidence;否则初始化为空列表。
  • 更新 Java 崩溃运行时事实创建逻辑,将 CrashLogKind.LauncherLog 作为 Java 版本和厂商事实的证据来源传入。
  • 更新 Minecraft 崩溃报告运行时事实创建逻辑,将 CrashLogKind.LauncherLog 作为 Minecraft 版本事实的证据来源传入。
PCL.Core/Minecraft/CrashAnalysis/Parsing/CrashFactExtractor.cs
PCL.Core/Minecraft/CrashAnalysis/Parsing/Parsers/JavaCrashParser.cs
PCL.Core/Minecraft/CrashAnalysis/Parsing/Parsers/MinecraftCrashReportParser.cs
调整崩溃视图中使用的代码块控件的视觉强调程度。
  • 将代码显示周围的 WPF Border BorderThickness 从 1 个 WPF 单位增加到 2 个 WPF 单位,使其略微更粗一些。
Plain Craft Launcher 2/Modules/Minecraft/Crash/MinecraftCrashVisualFactory.cs

提示与命令

与 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 evidence metadata to crash facts created from parsing logs and slightly increases the border thickness of the crash code display control.

Sequence diagram for adding evidence to parsed crash facts

sequenceDiagram
    participant JavaCrashParser
    participant MinecraftCrashReportParser
    participant CrashFactFactory
    participant CrashFact

    JavaCrashParser->>CrashFactFactory: CreateFromContext(JavaVersionDetected, javaInfo, properties, visibility, strength, scope, CrashLogKind.LauncherLog, sourceName)
    CrashFactFactory->>CrashFact: new CrashFact()
    CrashFactFactory->>CrashFact: set Evidence = [CrashFactEvidence]

    MinecraftCrashReportParser->>CrashFactFactory: CreateFromContext(MinecraftVersionDetected, minecraftVersion, properties, visibility, strength, scope, CrashLogKind.LauncherLog, sourceName)
    CrashFactFactory->>CrashFact: new CrashFact()
    CrashFactFactory->>CrashFact: set Evidence = [CrashFactEvidence]
Loading

File-Level Changes

Change Details Files
Propagate crash log source metadata into newly created CrashFact instances as structured evidence.
  • Extended CrashFactFactory.CreateFromContext signature to accept optional sourceKind and sourceName parameters.
  • Initialized CrashFact.Evidence from sourceKind/sourceName when provided, and to an empty list otherwise.
  • Updated Java crash runtime fact creation to pass CrashLogKind.LauncherLog as the evidence source for Java version and vendor facts.
  • Updated Minecraft crash report runtime fact creation to pass CrashLogKind.LauncherLog as the evidence source for Minecraft version facts.
PCL.Core/Minecraft/CrashAnalysis/Parsing/CrashFactExtractor.cs
PCL.Core/Minecraft/CrashAnalysis/Parsing/Parsers/JavaCrashParser.cs
PCL.Core/Minecraft/CrashAnalysis/Parsing/Parsers/MinecraftCrashReportParser.cs
Adjust visual emphasis of the code block control used in crash views.
  • Increased the WPF Border BorderThickness around the code display from 1 WPF unit to 2 WPF units to make it slightly bolder.
Plain Craft Launcher 2/Modules/Minecraft/Crash/MinecraftCrashVisualFactory.cs

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

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些整体反馈:

  • CrashFactFactory.CreateFromContext 中新增的 sourceName 参数目前从未被调用方设置;建议要么从现有上下文(例如日志/报告标识符)中把它正确传递进来,要么在有明确的 source name 需要传递之前先移除这个参数。
  • CrashFact.Evidence 修改为始终初始化(即使只是一个空集合)可能会影响之前依赖 null 与“无证据”之间差异的逻辑;如果存在这样的调用方,建议同步更新它们的预期行为,或者在文档中说明这一行为变更。
供 AI 代理使用的提示词
Please address the comments from this code review:

## Overall Comments
- The new `sourceName` parameter in `CrashFactFactory.CreateFromContext` is never set by callers; either wire it up from the available context (e.g., log/report identifier) or drop it until there’s a concrete source name to pass through.
- Changing `CrashFact.Evidence` to always be initialized (even as an empty collection) may affect any logic that previously distinguished between `null` and 'no evidence'; if such callers exist, consider aligning their expectations or documenting this behavioral change.

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

Hey - I've left some high level feedback:

  • The new sourceName parameter in CrashFactFactory.CreateFromContext is never set by callers; either wire it up from the available context (e.g., log/report identifier) or drop it until there’s a concrete source name to pass through.
  • Changing CrashFact.Evidence to always be initialized (even as an empty collection) may affect any logic that previously distinguished between null and 'no evidence'; if such callers exist, consider aligning their expectations or documenting this behavioral change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `sourceName` parameter in `CrashFactFactory.CreateFromContext` is never set by callers; either wire it up from the available context (e.g., log/report identifier) or drop it until there’s a concrete source name to pass through.
- Changing `CrashFact.Evidence` to always be initialized (even as an empty collection) may affect any logic that previously distinguished between `null` and 'no evidence'; if such callers exist, consider aligning their expectations or documenting this behavioral change.

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.

@Chiloven945 Chiloven945 merged commit 55efdc8 into refactor/crash Jun 7, 2026
3 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Jun 7, 2026
@Chiloven945 Chiloven945 deleted the refactor/crash-1 branch June 7, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants