caponetto / vscode-diff-viewer

A simple VS Code extension to easily visualize git diff files.
https://marketplace.visualstudio.com/items?itemName=caponetto.vscode-diff-viewer&ssr=false#overview
MIT License
44 stars 5 forks source link

RFC: saving of "viewed" state #40

Closed jacekkopecky closed 2 years ago

jacekkopecky commented 2 years ago

Firstly, thank you for making this extension, it's really useful since I can't find anything around VS Code that can show me whole diffs rather than file-by-file.

This pull request is really a request for comments – I don't know if you like the direction or the code style... Anyway:

With this PR, the extension can save (in the diff file itself) what files you've viewed. On reloading a diff file, it will hide those files automatically.

Small improvements also included:

I'll be happy to answer any question or explain anything that's not clear. Let me know what you think.

caponetto commented 2 years ago

Hi @jacekkopecky! Thanks for your contribution and interest! I'll take a look at the code as soon as possible. In the meantime, could you please run yarn format and commit the changes?

jacekkopecky commented 2 years ago

Sorry, of course, done. I have a new coding environment and it obviously hasn't picked up the prettier config. My bad.

jacekkopecky commented 2 years ago

@caponetto I realize that it's rather large-ish and combines multiple changes; I now also have a new addition in my fork at https://github.com/jacekkopecky/vscode-diff-viewer/tree/hyperlinks where you can click on a line number or on the file name and VSCode opens that file (on that line).

I've been thinking about it and maybe I could split my contributions like this:

  1. [x] refactor to use CustomTextEditor and automatically reload the diff file is it's changed externally #41
  2. [x] make the file header sticky so it stays at the top of the window as you scroll through a longer file #43
  3. [x] click on line number of filename to go to the file #45
  4. [x] show a count of viewed files and all files in a footer #44
  5. [ ] (and the one that may need the most discussion last) save "viewed" state in the diff file.

Would you like that? Should I do just the first one for now so you can review it and suggest which one next?

caponetto commented 2 years ago

Hey @jacekkopecky, Sounds good to me! I think splitting the code like you've said helps us moving forward faster. :)

jacekkopecky commented 2 years ago

Closing, will split into more manageable pieces.