feat(crash-report): 支持收起错误报告并在独立窗口中查看 - #3614
whitecat346 wants to merge 2 commits into
Conversation
审查者指南该 PR 通过扩展通用消息框的第四按钮能力,并重构崩溃报告展示为基于快照和会话的流程,实现报告弹窗可收起、在独立窗口中恢复查看,同时增加配置开关、设置页联动和多语言支持。 崩溃报告停靠与重新打开的时序图sequenceDiagram
participant CrashAnalysis as CrashAnalysis
participant Presenter as CrashDialogPresenter
participant Dialog as MsgBoxWrapper
participant Session as CrashReportSession
participant Window as CrashReportWindow
CrashAnalysis->>Presenter: Output(isHandAnalyze, extraFiles)
Presenter->>Session: CloseWindow()
Presenter->>Dialog: ShowWithCustomButtons(report, Button1..Button4)
Dialog-->>Presenter: selectedButton
alt selectedButton is 1
Presenter->>Session: Collapse(report)
else selectedButton is 4
Presenter->>Session: Collapse(report)
Presenter->>Session: OpenWindow()
Session->>Window: Show report snapshot
end
文件级变更
提示与命令与 Sourcery 交互
自定义使用体验访问你的控制面板以:
获取帮助Original review guide in EnglishReviewer's Guide该 PR 通过扩展通用消息框的第四按钮能力,并重构崩溃报告展示为基于快照和会话的流程,实现报告弹窗可收起、在独立窗口中恢复查看,同时增加配置开关、设置页联动和多语言支持。 Sequence diagram for docking and reopening a crash reportsequenceDiagram
participant CrashAnalysis as CrashAnalysis
participant Presenter as CrashDialogPresenter
participant Dialog as MsgBoxWrapper
participant Session as CrashReportSession
participant Window as CrashReportWindow
CrashAnalysis->>Presenter: Output(isHandAnalyze, extraFiles)
Presenter->>Session: CloseWindow()
Presenter->>Dialog: ShowWithCustomButtons(report, Button1..Button4)
Dialog-->>Presenter: selectedButton
alt selectedButton is 1
Presenter->>Session: Collapse(report)
else selectedButton is 4
Presenter->>Session: Collapse(report)
Presenter->>Session: OpenWindow()
Session->>Window: Show report snapshot
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
你好——我发现了 1 个问题
面向 AI 代理的提示
请处理本次代码审查中的评论:
## 单独评论
### 评论 1
<location path="Plain Craft Launcher 2/Modules/Minecraft/CrashAnalysis/Presentation/CrashDialogPresenter.cs" line_range="26" />
<code_context>
- var thirdButtonText = isHandAnalyze
- ? ""
- : Lang.Text("Crash.Dialog.Button.ExportReport");
+ var report = new CrashReportSnapshot(context, crashContent, title, isHandAnalyze, extraFiles);
- var secondButtonAction = _GetSecondButtonAction(
</code_context>
<issue_to_address>
**需要处理的问题(bug_risk):** 该 presenter 实例化了 `CrashReportSnapshot` 并调用了 `CrashReportSession`,但仓库中的任何位置都不存在这两种类型。因此,项目会因无法解析类型名称而编译失败。
**建议修复方案:** 将 `CrashReportSnapshot` 和 `CrashReportSession` 的实现添加到项目中,或者将这些引用替换为现有的报告管理类型。
</issue_to_address>Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="Plain Craft Launcher 2/Modules/Minecraft/CrashAnalysis/Presentation/CrashDialogPresenter.cs" line_range="26" />
<code_context>
- var thirdButtonText = isHandAnalyze
- ? ""
- : Lang.Text("Crash.Dialog.Button.ExportReport");
+ var report = new CrashReportSnapshot(context, crashContent, title, isHandAnalyze, extraFiles);
- var secondButtonAction = _GetSecondButtonAction(
</code_context>
<issue_to_address>
**issue (bug_risk):** The presenter instantiates `CrashReportSnapshot` and calls `CrashReportSession`, but neither type is present anywhere in the repository. The project therefore fails to compile with unresolved type-name errors.
**Suggested fix:** Add the `CrashReportSnapshot` and `CrashReportSession` implementations to the project, or replace these references with existing report-management types.
</issue_to_address>There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf5555c3a8
ℹ️ 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".
Hill23333
left a comment
There was a problem hiding this comment.
代码通过,翻译部分转接 @Chiloven945 审查
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0640330473
ℹ️ 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".
| private void BtnExport_Click(object sender, ModBase.RouteEventArgs e) | ||
| { | ||
| // 打包压缩包可能耗时较久,放到后台线程,避免卡住界面 | ||
| ModBase.RunInThread(() => _report.ExportReport()); |
There was a problem hiding this comment.
Serialize exports from the report window
If the user clicks Export again after dismissing the first save dialog but before packaging finishes, this starts another background export for the same snapshot. Both calls use the same context.TempFolder/Report workspace in CrashReportExporter, where each invocation deletes and recreates that directory, so the exports can delete files out from under each other and fail or produce incomplete archives. Disable the button while an export is active or otherwise serialize exports for a snapshot.
Useful? React with 👍 / 👎.
Chiloven945
left a comment
There was a problem hiding this comment.
i18n 没有问题,and 不是 en-US 和 zh-CN 的语言可以不用翻译。这两个是需要严格审查的,其他交由 Weblate 翻译即可。
Closes #3612
Sourcery 摘要
为错误报告增加可配置的收起入口和独立窗口查看体验。
新功能:
改进:
Original summary in English
Summary by Sourcery
为错误报告增加可配置的收起入口和独立窗口查看体验。
New Features:
Enhancements: