microsoft / microsoft/vscode-pull-request-github
Option to *not* close file marked as viewed via keybinding
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 795
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 46
Description
When you mark a file as viewed through the active editor menu bar or through a keybinding, the file will close. When you mark it as viewed through the tree view then it will not close. If a setting is needed I'll add one, but my hope is that this behavior is better for almost everyone.
Originally posted by @alexr00 in https://github.com/microsoft/vscode-pull-request-github/issues/3513#issuecomment-1284469843
Per this comment, it seems the default behavior for keybindings (or editor menu bar) calling pr.markFileAsViewed is to close the file, but for my workflow I'd prefer it didn't. Is it possible to add either a config setting, new command, or allow "args" in the keybinding to disable closing the active editor when this command is executed?
If it would be accepted, I could also attempt a PR for whichever of those options seems preferable. Thanks!
Edit: as a workaround (at least for keybindings) I found this seems to work okay - although the visual effect of closing and immediately reopening the editor is a bit jarring:
{
"key": "alt+j",
"command": "runCommands",
"args": {
"commands": [
"pr.markFileAsViewed",
"workbench.action.reopenClosedEditor",
]
},
"when": "editorTextFocus && github:inReviewMode && isInDiffEditor",
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the pr.markFileAsViewed command from its keybinding and active editor menu-bar entry points, comparing them with the tree-view behavior described in the issue. No source files or tests are named; done means providing an accepted way to invoke the command without closing the active editor while preserving the existing behavior by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100