fix(download): 修复 Minecraft 更新提示弹窗按 ESC 打开 Wiki#3436
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's Guide重新排列按钮,并调整 Minecraft 客户端更新提示对话框中的回调处理,使 ESC 不再触发打开 Wiki/更新日志,并相应更新结果处理逻辑。 更新后的 Minecraft 客户端更新提示对话框按钮处理时序图sequenceDiagram
actor User
participant McDownloadClientUpdateHint
participant ModMain
participant ModDownloadLib
participant ModBase
User ->> McDownloadClientUpdateHint: trigger update hint
McDownloadClientUpdateHint ->> ModMain: MyMsgBox(msgBoxText, title, Lang.Text(Common.Action.Download), [optional] Lang.Text(Common.Action.UpdateLog), Lang.Text(Common.Action.Cancel), button2Action: McUpdateLogShow)
ModMain -->> McDownloadClientUpdateHint: msgResult
alt msgResult == 1
McDownloadClientUpdateHint ->> ModBase: RunInUi(download action)
else msgResult == 2
McDownloadClientUpdateHint ->> ModDownloadLib: McUpdateLogShow(version)
else msgResult == 0
McDownloadClientUpdateHint ->> McDownloadClientUpdateHint: [Cancel or ESC, no further action]
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your Experience访问你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideReorders the buttons and adjusts the callback handling in the Minecraft client update hint dialog so that ESC no longer triggers opening the Wiki/update log, and updates the result handling accordingly. Sequence diagram for updated Minecraft client update hint dialog button handlingsequenceDiagram
actor User
participant McDownloadClientUpdateHint
participant ModMain
participant ModDownloadLib
participant ModBase
User ->> McDownloadClientUpdateHint: trigger update hint
McDownloadClientUpdateHint ->> ModMain: MyMsgBox(msgBoxText, title, Lang.Text(Common.Action.Download), [optional] Lang.Text(Common.Action.UpdateLog), Lang.Text(Common.Action.Cancel), button2Action: McUpdateLogShow)
ModMain -->> McDownloadClientUpdateHint: msgResult
alt msgResult == 1
McDownloadClientUpdateHint ->> ModBase: RunInUi(download action)
else msgResult == 2
McDownloadClientUpdateHint ->> ModDownloadLib: McUpdateLogShow(version)
else msgResult == 0
McDownloadClientUpdateHint ->> McDownloadClientUpdateHint: [Cancel or ESC, no further action]
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 在重新排列按钮之后,
msgResult各索引的含义发生了变化(下载操作从2变为1);最好确认一下其他调用点,以及对话框的默认行为 / ESC 行为,是否仍与新的按钮顺序和索引保持一致。
给 AI 智能体的提示
请根据这次代码审查中的评论进行修改:
## 整体评论
- 在重新排列按钮之后,`msgResult` 各索引的含义发生了变化(下载操作从 `2` 变为 `1`);最好确认一下其他调用点,以及对话框的默认行为 / ESC 行为,是否仍与新的按钮顺序和索引保持一致。帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的审查。
Original comment in English
Hey - I've left some high level feedback:
- The meaning of
msgResultindices changed (2→1for download) after reordering buttons; it would be good to confirm that other call sites and the dialog’s default/ESC behavior still align with the new button order and indices.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The meaning of `msgResult` indices changed (`2` → `1` for download) after reordering buttons; it would be good to confirm that other call sites and the dialog’s default/ESC behavior still align with the new button order and indices.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40666d90d8
ℹ️ 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".
| (DateTime.Now - time).TotalHours > 3d ? Lang.Text("Common.Action.UpdateLog") : "", | ||
| button3Action: () => ModDownloadLib.McUpdateLogShow(version)); | ||
| Lang.Text("Common.Action.Cancel"), |
There was a problem hiding this comment.
Keep the cancel button in a waited slot
When the version was released within the last 3 hours, this ternary passes an empty button2 while still passing Cancel as button3. ModMain.MyMsgBox only blocks when button2.Length > 0 || forceWait, so in that fresh-release case it returns 1 immediately; the following if (msgResult == 1) then jumps to the download page before the user can cancel the update prompt. Put the cancel action in button2 when the changelog is hidden, or force the dialog to wait.
Useful? React with 👍 / 👎.
更新提示弹窗原按钮顺序为 [确认, 下载, 更新日志]。
将按钮重排为 [下载, 更新日志, 取消] 以解决 ESC 触发问题。
resolves #2626
本PR由Opus 4.8对代码进行了审查。
Summary by Sourcery
Bug Fixes:
Original summary in English
Summary by Sourcery
Bug Fixes: