gitui
gitui copied to clipboard
When moving to source view full screen please allow left arrow to go back
Is your feature request related to a problem? Please describe. In "Status [1]" tab, you can navigate right to the source code with right arrow. But then you have to hit escape to navigate back left.
Describe the solution you'd like Please make left arrow navigate left.
Describe alternatives you've considered Escape.
Additional context
now I click "right arrow"
Now I can't go back left with left arrow. Only with Escape I can go back.
Thank you for gitui it is amazing.
I believe that worked prior to v0.23.0.
I recently updated to v0.23 and this feels very frustrating to me. I'll try to take up this issue later today and temporarily roll back to v0.22.x on my machine until a new release is made.
I am also not a fan of the current solution but the big UX fail that comes with allowing arrow-left
is visualised here:
https://github.com/extrawurst/gitui/assets/776816/caac6503-29bc-4917-972b-fdbc5c9dd007
hope someone has an idea how to solve this.
one idea (also not great) is to open the full-screen diff with a separate key press and not via arrow-right
and then one has to naturally escape that fullscreen view via esc
and can freely scroll left/right by holding down the arrow keys
To me, restoring the old functionality but allowing a full-screen diff with a dedicated keybind sounds like a good solution. I've been using the v0.23 release lately but I still find the old behavior of resizing the diff view more ergonomic.
Another solution would be to allow word-wrapping which removes the need for scrolling altogether. Wrapped lines could be shown by putting a ↩
(U+21A9) at the end of the wrapped lines. I don't think this needs to be mutually exclusive with the other option though.
Word-wrapping seems to be a good solution. Another possible approach - scroll the diff viewer only with vim-like hjkl
and use arrows only for pane navigation.
I'm not a big fan of hjkl
because it assume a qwerty-like keyboard layout and it's not very intuitive. However, I'll take it over the current behavior which I find more confusing.
Perhaps we can only allow key-repeat when scrolling and require a new keypress to exit out of the view.
Perhaps we can only allow key-repeat when scrolling and require a new keypress to exit out of the view.
unfortunately terminals do not allow that distinction
I want to discuss the initial question about this issue.
I meet the same problem like the beginning.
But i found that if i open the same view of Log[2] > Files: > Diff
, i can use q
to exit the preview of difference.
So maybe we can use the same way for the Status > Unstaged Changes > Diff
to exit the preview with q
.
It seems like #1955 is relevant here — the distinction between diff-as-pane (in the status view) and fullscreen diff seems important for usability.
In my opinion a good usability guideline for arrow key navigation is: If you can ENTER a mode with right arrow, you should be able to EXIT it with left arrow.
It seems like there are a few ways to fix this:
-
Restore pre-0.23 behavior. Add a keybinding to "zoom" into fullscreen diff, where left/right-arrows scroll and Esc exits back to status view.
-
Restore pre-0.23 behavior. Add new keybindings for horizontal scrolling. (Maybe
<
and>
by default? They're near the arrow keys in a lot of layouts.) -
(This is kinda wild but hear me out.) Keep the current behavior, but add a guard time after which left-arrow will exit the fullscreen diff. Could be a good proxy for whether the user is just holding down the left arrow to scroll or not. Idk, just a thought.
Pseudocode for option 3:
put 666ms into guardTime
on leftArrow
if can scroll left
put current time into lastLeftArrowTime
scroll left
else
if current time > lastLeftArrowTime + guardTime
exit diff view
else
do nothing
end if
end if
end leftArrow