Improve code reuse in PullRequestOverviewPanel and PullRequestViewProvider#8145
Merged
Improve code reuse in PullRequestOverviewPanel and PullRequestViewProvider#8145
Conversation
alexr00
reviewed
Nov 14, 2025
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Contributor
Author
Done! I've successfully extracted the common pull request review methods into a shared utility module. Changes made (commit e9c8991):
The refactoring maintains backward compatibility and preserves class-specific behavior (like Copilot refresh callbacks and merge confirmation dialogs) through customizable hooks. |
Copilot
AI
changed the title
[WIP] Improve code reuse in PullRequestOverviewPanel and PullRequestViewProvider
Improve code reuse in PullRequestOverviewPanel and PullRequestViewProvider
Nov 14, 2025
Copilot stopped work on behalf of
alexr00 due to an error
November 14, 2025 11:28
alexr00
approved these changes
Nov 14, 2025
sandy081
approved these changes
Nov 14, 2025
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.
Code Reuse Improvements for PullRequestOverviewPanel and PullRequestViewProvider
Changes Made
Created
pullRequestReviewCommon.ts- A new utility module containing:ReviewContextinterface - Context required by review utility functionsPullRequestReviewHelpersnamespace with reusable functions:getCurrentUserReviewState()- Get current user's review stateupdateReviewers()- Update reviewers listdoReviewCommand()- Handle review command submissiondoReviewMessage()- Handle review message submissionreRequestReview()- Re-request a reviewcheckoutDefaultBranch()- Checkout default branchupdateBranch()- Update PR branch with basesetReadyForReview()- Mark PR as ready for reviewmergePullRequest()- Merge the PR with customizable optionsUpdated
pullRequestOverview.ts:getReviewContext()helper to create context for utility functionsUpdated
activityBarViewProvider.ts:getReviewContext()helperCode Reduction
Benefits
Quality Checks
Created from VS Code via the GitHub Pull Request extension.
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.