From 2c6656ee4c821bc63a90ad2099722532a41a0915 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:31:06 +0000 Subject: [PATCH 1/2] Initial plan From 277421c612778d2ab0d8af1853698dd987541ec6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:39:10 +0000 Subject: [PATCH 2/2] Add _switchedToPullRequest to track explicitly switched PRs Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/view/reviewManager.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/view/reviewManager.ts b/src/view/reviewManager.ts index 6260047828..b9c31fac14 100644 --- a/src/view/reviewManager.ts +++ b/src/view/reviewManager.ts @@ -75,6 +75,11 @@ export class ReviewManager extends Disposable { * explicit user action from something like reloading on an existing PR branch. */ private justSwitchedToReviewMode: boolean = false; + /** + * The last pull request the user explicitly switched to via the switch method. + * Used to enter review mode for this PR regardless of its state (open/closed/merged). + */ + private _switchedToPullRequest?: PullRequestModel; public get switchingToReviewMode(): boolean { return this._switchingToReviewMode; @@ -481,13 +486,16 @@ export class ReviewManager extends Disposable { const useReviewConfiguration = getReviewMode(); - if (pr.isClosed && !useReviewConfiguration.closed) { + // If this is the PR the user explicitly switched to, always use review mode regardless of state + const isSwitchedToPullRequest = this._switchedToPullRequest?.number === pr.number; + + if (pr.isClosed && !useReviewConfiguration.closed && !isSwitchedToPullRequest) { Logger.appendLine('This PR is closed', this.id); await this.clear(true); return; } - if (pr.isMerged && !useReviewConfiguration.merged) { + if (pr.isMerged && !useReviewConfiguration.merged && !isSwitchedToPullRequest) { Logger.appendLine('This PR is merged', this.id); await this.clear(true); return; @@ -1090,6 +1098,7 @@ export class ReviewManager extends Disposable { this.statusBarItem.command = undefined; this.statusBarItem.show(); this.switchingToReviewMode = true; + this._switchedToPullRequest = pr; try { await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (progress) => { @@ -1243,6 +1252,7 @@ export class ReviewManager extends Disposable { this._prNumber = undefined; this._folderRepoManager.activePullRequest = undefined; + this._switchedToPullRequest = undefined; if (this._statusBarItem) { this._statusBarItem.hide();