pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.24k stars 124 forks source link

Less jumping around due to folds when opening comment threads during review #536

Open GuillaumeLagrange opened 2 months ago

GuillaumeLagrange commented 2 months ago

Issue Description

Type: feature request

Describe what happened (or what feature you want)

When reviewing a PR, in the file diff view, I find it a bit hard to follow all the jumping around that folds are causing when moving cursor over a line which has a comment thread.
The root cause for this is that the other window of the split (most often the left window in my case) is replaced by the comment thread view, so the diff view stops showing its colors + the folds are automatically open, causing a lot of visual noise IMO.

There is also the annoyance of the thread window going away if I move around the file, when sometimes I am writing/reading a comment and want to check something 20 lines above.

Describe what you expected to happen

  1. First, I would like an option to only trigger comment thread display through a dedicated command, to prevent jumps when just moving around the file. Inside the comment thread buffer, q in normal mode would close the buffer and go back to diff view (this could/should be bindable to let users chose their keybinds)

  2. To go even further, we could maybe make use of nvim's floating windows ? Something like lsp hover windows where hovering over a line with comments, to avoid covering up the other part of the diff. I am less sure about this.

I have a more or less working version of step 1 that disables the autocommand that shows threads and adds support for manually opening/closing the thread buffer. I could open a PR, I am opening this issue to gauge interest.

Cheers