Add description generation for existing pull requests
Description generation was only available during PR creation. Users editing existing PR descriptions had no way to invoke AI-generated descriptions.
Changes
UI
- Added sparkle icon to PR description edit textarea (appears when description provider available)
- Icon toggles to stop-circle during generation with cancellation support
- CSS positioning matches create PR view pattern
Backend
-
PullRequestOverviewPanel.generateDescription(): Collects commits, file patches, and template; invokes provider - Message handlers for
pr.generate-descriptionandpr.cancel-generate-description - Reuses existing
getTitleAndDescriptionProvider()infrastructure
Types
-
DescriptionResultinterface for webview messaging -
PullRequest.generateDescriptionTitleoptional property to signal feature availability
Context Collection
const [commits, rawFileChanges] = await Promise.all([
this._item.getCommits(),
this._item.getRawFileChangesInfo()
]);
const patches = rawFileChanges
.filter(file => file.patch !== undefined)
.map(file => ({
patch: file.patch!,
fileUri: vscode.Uri.joinPath(..., file.filename).toString(),
previousFileUri: file.previous_filename ? ... : undefined
}));
Feature only displays when a description provider (Copilot, etc.) is registered.
Original prompt
This section details on the original issue you should resolve
<issue_title>Enhancement Request: Enable Description Generation for Existing Pull Requests</issue_title> <issue_description>## Issue:
Currently, the GitHub support for auto-generating descriptions is available only during the creation of a new pull request. Unfortunately, this feature is not extended to existing pull requests. It would be highly beneficial to incorporate this functionality for pre-existing pull requests as well.
Proposal:
To enhance the user experience and streamline the contribution process, we suggest implementing a feature that allows users to generate descriptions for already existing pull requests. This addition would not only save time but also ensure consistency in documentation across all stages of the pull request lifecycle.
Benefits:
Consistency:
Provides a uniform approach to documentation for both new and existing pull requests. Time-Saving:
Saves contributors time by eliminating the need to manually create or update pull request descriptions. Improved Workflow:
Enhances the overall workflow by simplifying the documentation process and reducing potential errors. Implementation:
Consider adding a button or option within the GitHub interface that triggers the description generation for existing pull requests. This feature could utilize similar logic to the one employed during the creation of new pull requests.
Note:
This improvement aligns with the goal of creating a more efficient and user-friendly environment for collaboration within the GitHub platform.
![]()
Comments on the Issue (you are @copilot in this section)
@alexr00 Closing as there's not enough interest in this feature.@alexr00 By "not enough interest" I mean that I haven't heard from other users (either from upvotes/comments here, in other GitHub issues, or from folks on the VS Code team) that this is something they want.If you want to contribute to it, that would be great! However, given that there's limited interested I would not be able to provide a lot of guidance on where to get started. We did discus this a bit, and the UX that sounded good was to have a sparkle that shows in the PR description input box when you use the "Edit Comment" action on the PR description. I think the bulk of the work would actually be to add this UI for a sparkle icon in the PR description input box. </comment_new> <comment_new>
Sure, happy to reopen and see if there's more interest.</comment_new>@alexr00
- Fixes microsoft/vscode-pull-request-github#5548
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.