Skip to content

Confirm before discarding pull request description on Cancel#8796

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/confirmation-popup-for-cancel-button
Draft

Confirm before discarding pull request description on Cancel#8796
Copilot wants to merge 3 commits into
mainfrom
copilot/confirmation-popup-for-cancel-button

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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.

  • Setting — adds githubPullRequests.showPullRequestCancelConfirmation (boolean, default true) as the persistent "never show again" state.
  • Extensioncancel() in createPRViewProvider.ts shows vscode.window.showWarningMessage({ modal: true, detail: ... }, 'Discard', 'Don\'t Ask Again') when body is non-empty and the setting is enabled. Choosing Don't Ask Again flips the setting to false; dismissing the modal aborts the cancel. The handler replies with { cancelled: boolean }.
  • WebviewcancelCreate in createContextNew.ts no longer clears persisted state eagerly. It awaits the reply and only resets state on cancelled === true, so a declined dialog (or missing reply) preserves the in-progress title and description.

Empty-description cancels still proceed immediately with no prompt.

Copilot AI and others added 2 commits June 16, 2026 09:04
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
Copilot AI requested a review from alexr00 June 16, 2026 09:06
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.

2 participants