ux: allow interrupting in-progress push operation in dialog - #2632
Open
sdpfigueiredo wants to merge 1 commit into
Open
ux: allow interrupting in-progress push operation in dialog#2632sdpfigueiredo wants to merge 1 commit into
sdpfigueiredo wants to merge 1 commit into
Conversation
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.
Resolve #2603
Problem
When the remote server is unreachable (e.g. corporate VPN down), the
Push Changes to Remotedialog blocks for minutes on the hunggit pushprocess with no way to interrupt it — the dialog is not closable while the operation is in progress.Solution
Add an opt-in cancellation mechanism for popups and wire it up for the Push dialog:
Popupbase class gainsCanCancel(defaultfalse) andCancel(), andCleanup()becomes virtual.PushoverridesCanCancel => trueandCancel()→ cancels aCancellationTokenSourcewhose token is passed to the push command via the existing.WithCancellation(token)extension.Command.ExecAsync()already kills the git process tree on cancellation, and returnstruewhen cancelled — so the dialog closes itself once the operation is interrupted.PopupRunningStatusshows a CANCEL button next to the running indicator, visible only when the popup opts in (CanCancel).LauncherPage.CancelPopup()now forwards topopup.Cancel()when a cancellable popup is in progress, so ESC and mask-click also interrupt the running push.Behavior
git pushprocess tree is killedNotes
CanCancel == true).PushTag/PushRevisionfollow the same pattern and can opt in later if desired.Tested:
dotnet buildclean (0 warnings / 0 errors). Windowswin-x64NativeAOT publish successful.Screenshot