Confirm before discarding pull request creation with unsaved changes#8796
Draft
Copilot wants to merge 4 commits into
Draft
Confirm before discarding pull request creation with unsaved changes#8796Copilot wants to merge 4 commits into
Copilot wants to merge 4 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
|
Hi @copilot, a few points that may be worth considering if you read comments and react to them, otherwise these are suggestions for reviewer @alexr00:
|
Member
|
Thanks for looking at this @HebaruSan! I haven't had a chance to yet. @copilot , address these comments:
|
…eviewers, projects, milestone Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Contributor
Author
Addressed in 5b6022a. The dirty check now triggers the confirmation when any of the following has unsaved changes:
The setting description and modal detail were updated to reflect the broader scope. |
Copilot
AI
changed the title
Confirm before discarding pull request description on Cancel
Confirm before discarding pull request creation with unsaved changes
Jun 19, 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 in-progress data. 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 there are unsaved changes, mirroring VS Code's standard discard-changes prompt. Unsaved changes are detected for any of the following:
Details:
githubPullRequests.showPullRequestCancelConfirmation(boolean, defaulttrue) as the persistent "never show again" state.CancelCreatePullRequestNewincommon/views.ts, extendingCreatePullRequestNewwith ahasUnsavedChanges: booleanflag.cancelCreateincreateContextNew.tscomputeshasUnsavedChangesfrom the currentcreateParams(comparingpendingTitle/pendingDescriptionto their defaults and checking labels/assignees/reviewers/projects/milestone) and includes it in the cancel message. It no 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 data.cancel()increatePRViewProvider.tsshowsvscode.window.showWarningMessage({ modal: true, detail: 'Your unsaved changes to this pull request will be lost.' }, 'Discard', 'Don\'t Ask Again')whenhasUnsavedChangesis true 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 }.Cancels with no unsaved changes still proceed immediately with no prompt.