[Enhancement] 不在主界面,或者已显示对话框的情况下,暂时不弹出启动器更新对话框 #5768 reforged#6021
Open
CalbootOnceMore wants to merge 14 commits intoHMCL-dev:mainfrom
Open
[Enhancement] 不在主界面,或者已显示对话框的情况下,暂时不弹出启动器更新对话框 #5768 reforged#6021CalbootOnceMore wants to merge 14 commits intoHMCL-dev:mainfrom
CalbootOnceMore wants to merge 14 commits intoHMCL-dev:mainfrom
Conversation
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the launcher update notification UX so the update dialog won’t interrupt users while they’re not on the main page, and will wait until any currently-open dialog is closed—addressing dialog-overlapping issues like #5762 and state issues like #5490.
Changes:
- Add a “show dialog later” mechanism to queue dialogs behind an active dialog stack.
- Split update bubble animation from update dialog display, and gate dialog display on being at the root (non-backable) UI state.
- Adjust update-check completion ordering to better coordinate
checkingUpdatevs.latestVersionupdates.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
HMCL/src/main/java/org/jackhuang/hmcl/upgrade/UpdateChecker.java |
Tweaks update-check completion sequencing to update latestVersion before clearing checkingUpdate. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java |
Moves update bubble binding responsibility out of RootPage (now done during controller initialization). |
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java |
Introduces a separate showUpdateDialog property and dialog display logic using the new deferred-dialog API. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorController.java |
Exposes navigation “backable” state and adds showDialogLater delegation. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogUtils.java |
Adds dialog queuing (showLater) and runs queued dialogs after closing the active dialog. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java |
Binds update bubble + dialog gating centrally and adds Controllers.dialogLater(...). |
Comments suppressed due to low confidence (2)
HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogUtils.java:169
JFXDialog.close()is asynchronous, butDialogUtils.closetriggers the next queued dialog immediately after callingclose()(seeshowNextDialogAction.run()later in this method). This can result in the next dialog being shown while the previous one is still closing/visible. Consider invoking the queued action from thesetOnDialogClosed(...)callback (after the close animation and cleanup complete).
if (dialog != null && pane != null) {
if (pane.size() == 1 && pane.peek().orElse(null) == content) {
dialog.setOnDialogClosed(e -> pane.pop(content));
dialog.close();
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java:293
- The dialog’s cancel button is added with
addCancel(null), so dismissing the update prompt does not setconfig().setPromptedVersion(...). SinceshowUpdateDialoggates onconfig().getPromptedVersion(), users who dismiss the dialog may be prompted again for the same version on later checks/runs. If the intent is “don’t show again for this version”, setpromptedVersionon cancel as well; otherwise consider using a different button text than “Cancel” to clarify it will reappear.
.addAction(i18n("button.view"), () -> {
config().setPromptedVersion(getLatestVersion().getVersion());
onUpgrade();
})
.addCancel(null)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#5768 由于原账号被封,无法推进,现重新打开一个新pr。原pr应该 Close as not planned
Closes #5762
Fixes #5490
如果不在主界面,则会在切换回主界面之后再显示;如果已经有对话框,则在对话框关闭后再显示