vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Change markFileAsViewed to keep files open by default

Open laharigandrapu11 opened this issue 7 months ago • 2 comments

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 avatar Jul 17 '25 04:07 laharigandrapu11

@microsoft-github-policy-service agree

laharigandrapu11 avatar Jul 17 '25 04:07 laharigandrapu11

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.

mogelbrod avatar Jul 18 '25 10:07 mogelbrod