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

Feature Request: List if folder is marked as "viewed"

Open ClayBenson94 opened this issue 4 years ago • 3 comments

Currently, individual files can be marked as "viewed" in GitHub Pull Requests, and the extension properly shows a "check mark" icon next to those files.

It would be nice, for when reviewing larger PRs, to show if all files within a folder have been marked as viewed. The example below show that I've viewed the 2 files, but when the folder is collapsed, it's not possible to tell that I've already marked everything in that folder as viewed.

I don't think the scope of this would necessarily need to expand to being able to mark/unmark entire folders, but at least having the indicator on the folder would be nice!

image image

ClayBenson94 avatar Jan 26 '22 17:01 ClayBenson94

If I can add something on top of this, it'd be nice if also one can mark all files in a folder as viewed. For example, when reviewing a PR and a whole inlined dependencies folder has changed (Go's vendor for example).

If you don't mind, I'd love to take a stab at this. Always wanted to dive into vscode-exntesions 😀

thepalbi avatar Jul 05 '22 13:07 thepalbi

@thepalbi I would accept a PR for this, but it's going to be a large change. Here are some code pointers:

You will need to set a contextValue on DirectoryTreeNode for it have the "mark as viewed" action: https://github.com/microsoft/vscode-pull-request-github/blob/771ea78afac82966a9de4268bd2770688141dcd3/src/view/treeNodes/directoryTreeNode.ts#L10-L11

Example of what the contextValue might be. You probably only need the "viewed"/"unviewed" part: https://github.com/microsoft/vscode-pull-request-github/blob/771ea78afac82966a9de4268bd2770688141dcd3/src/view/treeNodes/fileChangeNode.ts#L85-L86

Example of how to use when to add the "mark as viewed" action with the context value: https://github.com/microsoft/vscode-pull-request-github/blob/771ea78afac82966a9de4268bd2770688141dcd3/package.json#L1372-L1381

Then the "mark as viewed" command would need to handle the incoming tree node (DirectoryTreeNode): https://github.com/microsoft/vscode-pull-request-github/blob/771ea78afac82966a9de4268bd2770688141dcd3/src/commands.ts#L875-L885

Finally, for the little "✓" decoration, you would need to update the decoration provider: https://github.com/microsoft/vscode-pull-request-github/blob/771ea78afac82966a9de4268bd2770688141dcd3/src/view/fileTypeDecorationProvider.ts#L15-L16

alexr00 avatar Jul 05 '22 14:07 alexr00

Also I would love a feature which let me toggle (hide) the files that has been marked as viewed.

sedghi avatar Aug 05 '22 21:08 sedghi

We now have this feature with the adoption of the new tree view checkbox API for marking as viewed.

alexr00 avatar Sep 22 '22 12:09 alexr00

@alexr00 Thank you for the update! Just saw it this morning after a VSCode (and plugin) update, and this looks fantastic!

ClayBenson94 avatar Dec 06 '22 13:12 ClayBenson94