Exclude pending reviews from "Show Changes Since Last Review"
"Show Changes Since Last Review" was treating pending (not-yet-submitted) reviews as the reference point, causing the diff to reset when new commits arrived during an active review.
Changes
GraphQL Query (queriesShared.gql):
- Changed from
viewerLatestReviewtoreviews(last: 1, author: $author, states: [APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED]) - Explicitly excludes
PENDINGstate
Implementation (pullRequestModel.ts):
- Added
authorparameter (current user login) to query variables - Updated response parsing to access
reviews.nodes[0]instead ofviewerLatestReview
Types & Tests (graphql.ts, latestReviewCommitBuilder.ts):
- Updated
LatestReviewCommitResponseinterface to reflect new query structure - Updated test builder to match new response shape
The fix ensures only submitted reviews are considered when computing diffs since last review.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com
- Triggering command:
/opt/hostedtoolcache/node/20.19.6/x64/bin/node node ./out/src/test/runTests.js --grep getViewerLatestReviewCommit -git it s-errors/type.d.ts ndor/bin/sh it s/sourcemap-segm-c /opt/hostedtoolcgit diff --cached --name-only grep -l submodules | head -n 10 ./node_modules/memfs/lib/node/types/promises.d.ts tnet/tools/git it les/@jridgewell/-ne tnet/tools/grep grep(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
This section details on the original issue you should resolve
<issue_title>Show Changes Since Last Review should not consider pending reviews as "Last Review"</issue_title> <issue_description>- Extension version: 0.96.0
- VSCode Version: 1.93.0
- OS: Windows_NT x64 10.0.22621
- Repository Clone Configuration (single repository/fork of an upstream repository): Single Repository
- Github Product (Github.com/Github Enterprise version x.x.x): Github.com
Steps to Reproduce:
- Submit a review on a PR
- Add new commits to PR
- Use the "Show Changes Since Last Review" button to begin reviewing latest changes
- Begin a review
- Add another new commit to the PR
- Pull the new changes into the review
Expected Behavior: The union of the commits added in 2. and 5. should now be visible. Those commits represent the changes "since the last review".
Actual Behavior: Upon pulling the new changes, only the commits from 5. are visible. The pending review is considered the "last review", even though it was never submitted. In my case, the new changes were pulled automatically while I was in the midst of a review, and the change list reset to the most recent commit, with no way to go back to the state of the code I was in the middle of reviewing.
Proposal:
- Only consider submitted reviews for the "Show Changes Since Last Review" functionality.
- Support selecting a set of commits and view changes to files from those commits (similar to GitHub.com functionality), so that I can manually get back to reviewing changes since a point in time.</issue_description>
<agent_instructions>Only consider the last submitted review when choosing the "last review"</agent_instructions>
Comments on the Issue (you are @copilot in this section)
- Fixes microsoft/vscode-pull-request-github#6226
💡 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.