Confirm before discarding pull request description on Cancel#8796
Draft
Copilot wants to merge 3 commits into
Draft
Confirm before discarding pull request description on Cancel#8796Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…ail wording Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add confirmation popup for Cancel button in pull request creation
Confirm before discarding pull request description on Cancel
Jun 16, 2026
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.
Clicking Cancel in the PR creation view immediately discards any typed description. This is easy to trigger accidentally (e.g. tabbing from the description field and hitting Space/Enter), losing significant work.
Cancel now shows a modal confirmation when the description is non-empty, mirroring VS Code's standard discard-changes prompt.
githubPullRequests.showPullRequestCancelConfirmation(boolean, defaulttrue) as the persistent "never show again" state.cancel()increatePRViewProvider.tsshowsvscode.window.showWarningMessage({ modal: true, detail: ... }, 'Discard', 'Don\'t Ask Again')whenbodyis non-empty and the setting is enabled. Choosing Don't Ask Again flips the setting tofalse; dismissing the modal aborts the cancel. The handler replies with{ cancelled: boolean }.cancelCreateincreateContextNew.tsno longer clears persisted state eagerly. It awaits the reply and only resets state oncancelled === true, so a declined dialog (or missing reply) preserves the in-progress title and description.Empty-description cancels still proceed immediately with no prompt.