Skip to content

home: derive confirmation dialog presentation from the pending action - #8003

Merged
osy merged 1 commit into
utmapp:mainfrom
ianplusplus:fix/confirm-action-reset
Nov 12, 2026
Merged

osy merged 1 commit into
utmapp:mainfrom
ianplusplus:fix/confirm-action-reset

Conversation

@ianplusplus

Copy link
Copy Markdown
Contributor

The confirmation dialog in VMConfirmActionModifier was presented by mirroring confirmAction into a separate isPresented state with onChange, but nothing ever cleared confirmAction after the dialog was dismissed. 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. The same stale state also blocked Stop and Move on that VM.

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.

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.

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
UTMapp-bot added a commit to UTMapp-bot/UTM that referenced this pull request Nov 12, 2026
@UTMapp-bot

Copy link
Copy Markdown

UI test: repeated confirmation dialog

Steps: select a VM, click Clone in the toolbar, Cancel (on iPad, tap outside the popover), then click Clone again. Builds are e7ccd2c (this PR) and its parent 1c5e215 (base), using a sample VM with no drives.

Version Where Build Second Clone after Cancel
macOS 27.2 VM base ❌ no dialog (bug reproduced)
macOS 27.2 VM PR ✅ dialog shown
macOS 26.6.2 VM PR ✅
macOS 15.6.1 VM PR ✅
macOS 14.6.1 VM PR ✅
macOS 13.6 VM PR ✅
macOS 12.6 VM PR ✅
iOS 27.0, iPad Pro 13" simulator PR ✅
iOS 16.4, iPad Pro 11" simulator PR ✅
iOS 15.5, iPad Air simulator PR + #8055 ✅

Notes

Before / after (macOS 27, after the second Clone)

Base This PR
After the second Clone on the other versions (PR build)
macOS 26 macOS 15
macOS 14 macOS 13
macOS 12 iOS 27 (iPad)
iOS 16.4 (iPad) iOS 15.5 (iPad, + #8055)

@osy
osy merged commit 8527789 into utmapp:main Nov 12, 2026
109 of 135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants