Skip to content

Change markFileAsViewed to keep files open by default #7319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

laharigandrapu11
Copy link

@laharigandrapu11 laharigandrapu11 commented Jul 17, 2025

Overview

When marking a file as viewed through the editor menu bar or keybinding, the file would automatically close. This behavior differed from using the tree view checkbox, which kept files open. This PR makes "keep open" the default for consistency, while providing a setting for users who prefer the old behavior.

Changes

  • Added new setting githubPullRequests.closeFileOnMarkFileAsViewed (default: false)
  • Modified the markFileAsViewed command to respect this setting
  • Default behavior now matches tree view (keeps files open)
  • Users can opt-in to the old behavior via settings

Demo

New Default Behavior

image

Default behavior: The File remains open after marking as viewed

Optional Behavior (Setting Enabled)

The screenshot below shows that the readme.md file closed when the checkmark was clicked
image
Optional behavior: File closes when setting is enabled

Configuration

image Users can control this behavior through VS Code settings

Testing

Verified:

  1. Default behavior (false) - files stay open when marked as viewed
  2. Optional behavior (true) - files close when marked as viewed
  3. Setting can be changed through VS Code settings UI
  4. Tree view behavior remains unchanged

Fixes #5092

@laharigandrapu11
Copy link
Author

@microsoft-github-policy-service agree

@mogelbrod
Copy link

I'm not a maintainer - but I'm wondering if the additional setting and change in default behavior is necessary. Given that we can pre-define arguments passed to keybinding commands it should be sufficient to only add the optional argument (changing the default to close the file to keep existing behavior intact) to the command itself while achieving the same end result.

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