Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When moving to source view full screen please allow left arrow to go back #1729

Open
Kamilcuk opened this issue Jun 21, 2023 · 9 comments · May be fixed by #1755
Open

When moving to source view full screen please allow left arrow to go back #1729

Kamilcuk opened this issue Jun 21, 2023 · 9 comments · May be fixed by #1755
Labels
feature-request help wanted Extra attention is needed

Comments

@Kamilcuk
Copy link

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
image

now I click "right arrow"

image

Now I can't go back left with left arrow. Only with Escape I can go back.

Thank you for gitui it is amazing.

@raphCode
Copy link

raphCode commented Jul 5, 2023

I believe that worked prior to v0.23.0.

@holly-hacker
Copy link

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.

@holly-hacker holly-hacker linked a pull request Jul 11, 2023 that will close this issue
4 tasks
@extrawurst
Copy link
Owner

extrawurst commented Aug 14, 2023

I am also not a fan of the current solution but the big UX fail that comes with allowing arrow-left is visualised here:

Screenflick.Movie.5.mp4

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

@extrawurst extrawurst added the help wanted Extra attention is needed label Aug 14, 2023
@holly-hacker
Copy link

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.

@ShrykeWindgrace
Copy link

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.

@holly-hacker
Copy link

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.

@extrawurst
Copy link
Owner

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

@gxt-kt
Copy link

gxt-kt commented Oct 8, 2023

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.

@smammy
Copy link

smammy commented Nov 23, 2023

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:

  1. 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.

  2. 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.)

  3. (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants