Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add option to keep viewed files open#8859

Open
pratyushsinghal7 wants to merge 3 commits into
microsoft:mainmicrosoft/vscode-pull-request-github:mainfrom
pratyushsinghal7:issue-5092pratyushsinghal7/vscode-pull-request-github:issue-5092Copy head branch name to clipboard
Open

Add option to keep viewed files open#8859
pratyushsinghal7 wants to merge 3 commits into
microsoft:mainmicrosoft/vscode-pull-request-github:mainfrom
pratyushsinghal7:issue-5092pratyushsinghal7/vscode-pull-request-github:issue-5092Copy head branch name to clipboard

Conversation

@pratyushsinghal7

Copy link
Copy Markdown

Summary

  • accept a dontCloseFile option in the pr.markFileAsViewed command
  • support keybinding command arguments while preserving the existing default close behavior
  • add regression coverage for keeping the active editor tab open

Testing

  • npm run compile:test
  • npx eslint src/commands.ts
  • npm run hygiene
  • npm run check:commands
  • git diff --check

Fixes #5092

Copilot AI review requested due to automatic review settings July 23, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in command argument to prevent pr.markFileAsViewed from closing the active editor (useful for keybindings / editor menu usage), while keeping the existing default behavior, and introduces a regression test for the “don’t close” path.

Changes:

  • Extend pr.markFileAsViewed to accept a { dontCloseFile } options object and skip the tab-close behavior when requested.
  • Refactor the command’s argument handling to support keybinding-style args.
  • Add a test asserting the active tab remains open when dontCloseFile: true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/commands.ts Adds { dontCloseFile } option handling and gates the “close active tab” behavior behind it.
src/test/extension.test.ts Adds a regression test to ensure the active editor tab stays open when dontCloseFile is true.

Comment thread src/commands.ts
Comment thread src/test/extension.test.ts
Copilot AI review requested due to automatic review settings July 23, 2026 23:00
@pratyushsinghal7

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/commands.ts:1805

  • The new options parameter is only applied in the non-FileChangeNode/Uri branch (options = treeNodeOrOptions ?? options), so when the command is invoked with an explicit vscode.Uri plus an options object (e.g. executeCommand('pr.markFileAsViewed', uri, { dontCloseFile: true })), dontCloseFile is ignored and the tab will still close. Either apply the second-argument options consistently for all invocation shapes, or remove/rename the second parameter to avoid suggesting it’s supported for Uri invocations.
		vscode.commands.registerCommand('pr.markFileAsViewed', async (treeNodeOrOptions: FileChangeNode | vscode.Uri | { dontCloseFile: boolean } | undefined, options?: { dontCloseFile: boolean }) => {
			try {
				let treeNode: FileChangeNode | vscode.Uri | undefined;
				if (treeNodeOrOptions instanceof FileChangeNode || treeNodeOrOptions instanceof vscode.Uri) {
					treeNode = treeNodeOrOptions;

Copilot AI review requested due to automatic review settings July 23, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

Option to *not* close file marked as viewed via keybinding

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.