Sysmagine / SemanticDiff

Community support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
https://semanticdiff.com
49 stars 0 forks source link

Easy keyboard-only traversal between files #76

Open lptr opened 2 weeks ago

lptr commented 2 weeks ago

Is your feature request related to a problem? Please describe.

Currently it requires clicking on individual files to move between them while doing a review. This is tedious and breaks the flow of the review. GitHub shows the diff in a continuous stream where scrolling back-and-forth is easy.

Describe the solution you'd like

Adopting GitHub's continuous mode would be one way, perhaps as an option that can be toggled off and on.

Another option would be to add some keyboard shortcuts (j and k comes to mind) to move between files.

The two are not mutually exclusive, and indeed it would be nice to have both.

mmueller2012 commented 1 week ago

Adding another keyboard shortcut is simple if we can find a suitable key combination.

Most CTRL/⌘ based shortcuts are already registered by either the browser or the operating system. We can override most of these shortcuts but this may not provide the best user experience.

Simply using keys without modifiers has its own drawbacks. The user may be in the middle of writing a comment, click on the code and lose focus on the text area without realizing it. If they continue typing, they could easily trigger a navigation event.

It is also not easy to find two keys that are next to each other in all/most keyboard layouts.

My current proposal would be CTRL/⌘ + arrow left/right:

@slackner: What do you think about this key combination and should the behavior depend on the current sidebar tab (i.e. jump between threads if the threads tab is selected)?

slackner commented 1 week ago

@mmueller2012 No objections from my side, but I'd wait for some more feedback, especially from @lptr.

Usage of single letter shortcuts like J/K would be easier, but I also see a risk that users will type it by accident while writing a comment. If we go in such a direction, we'd have to make sure that there are confirmation dialogs if there are still any unsubmitted comments etc.

Since the sidebar is collapsed on mobile and it's not easy to see which thread is selected, I don't think the meaning of these keyboard shortcuts should change. It may be better to add separate shortcuts for jumping between threads, e.g., by using a different keyboard modifier. Most obvious would be alt+left/right, maybe? :thinking:

mmueller2012 commented 4 days ago

@lptr We deployed the change. You should be able to switch between files using CTRL/⌘ + arrow left/right. Does this work for you?

lptr commented 1 day ago

Thanks. The feature works well! Not sure about the choice of shortcut, as ⌘ + left/right collides with back/forward navigation of the browser.