Repository navigation
home: derive confirmation dialog presentation from the pending action - #8003
Open
ianplusplus wants to merge 1 commit into
Open
ianplusplus wants to merge 1 commit into
ianplusplus wants to merge 1 commit into
Conversation
The confirmation dialog was presented by mirroring `confirmAction` into a separate `isPresented` state with `onChange`, but nothing ever cleared `confirmAction` after the dialog went away. Requesting the same action on the same VM again (for example cloning a VM twice) produced an equal value, so `onChange` never fired and the dialog silently failed to appear until the app was restarted. Replace the mirrored state with a binding derived from `confirmAction`, as VMSnapshotsView already does, so dismissal clears the action and there is a single source of truth for whether the dialog is shown. Assisted-by: Claude:claude-fable-5-1
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.
The confirmation dialog in
VMConfirmActionModifierwas presented by mirroringconfirmActioninto a separateisPresentedstate withonChange, but nothing ever clearedconfirmActionafter the dialog was dismissed. Requesting the same action on the same VM again (for example cloning a VM twice) produced an equal value, soonChangenever fired and the dialog silently failed to appear until the app was restarted. The same stale state also blocked Stop and Move on that VM.Replace the mirrored state with a binding derived from
confirmAction, asVMSnapshotsViewalready does, so dismissal clears the action and there is a single source of truth for whether the dialog is shown.Testing: Tested by a human on macOS 27.0.1, MacBook Pro (Apple M5 Pro). Reproduced the bug on the release build (second Clone on the same VM shows no dialog), then confirmed with this change that cloning the same VM repeatedly from both the toolbar and the context menu prompts every time. The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM's AI contribution guidelines.