jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.07k stars 1.82k forks source link

Option to disable "navigate Block sub-menus with same key (1 .. 5)" #3995

Open TimShilov opened 3 hours ago

TimShilov commented 3 hours ago

Is your feature request related to a problem? Please describe. Recently the logic of 1-5 hotkeys was changed (here's the discussion: https://github.com/jesseduffield/lazygit/issues/3789).

I find this change frustrating and counter-productive. I would argue that this was a mistake and the previous defaults were superior in every way and would suggest reverting the change.

I believe this change is bad for both "typical users" and "advanced users".

Imagine a"typical user" that never switches tabs, so he/she is probably not "aware" of "Worktrees" tab or tabs in general. That user might hit "1" key while already being on the first panel and he/she will end up on the "Worktrees" tab which might be confusing and disorienting. 🤷‍♂️

"advanced users", on the other hand, suffer from unpredictable behavior. The new behavior now forces such users to either:

  1. Look at the screen to figure out which panel is active and whether or not anything needs to be pressed or not
  2. To hit "2", realize that you was already on a correct panel and now you're on the wrong tab, then press "2" a couple more times until you get where you need to be.

IMO both cases are unnecessary mental overhead.

Before this change, pressing 2 always did the same one thing ("Go to branches panel, regardless of where you are") and pressing ] did the same one thing ("Go to next tab"). That's IMO straightforward and simple, each button does just one thing. I'm really struggling to see why that was changed. What was the problem with that? 🤔

The OP said:

I'm always frustrated when I want to navigate to a sub-panel like Remotes or Worktrees and I have to Press '1-5' followed by ']' some number of times.

And I don't really see the problem with that. If you want to perform 2 different actions (go to panel and then switch tab) it is expected to have to press 2 different hotkeys, isn't it? Why would having to press 2 separate keys to do 2 separate actions be frustrating? 🤔

Describe the solution you'd like I would argue that we need to revert that change because I'm really struggling to see how complicating a single hotkey is better than having 2 separate hotkeys each doing one predictable thing. This does not even result in less keypresses (I would argue it causes more due to the confusion). At the very least, I would like to have an option to revert to previous behavior.

Separately, I would argue that the OP probably didn't wanted to be able to press 2 mutliple times, that was just a "workaround". I would assume that what he really wanted to do was to get where he needed faster or with fewer keystrokes, so why don't we address that instead of worsening defaults? Can't we just have built-in or allow to create custom hotkeys to jump to "Worktrees" tab or "Reflog" tab from anywhere with a single hotkey?

Describe alternatives you've considered Just like the OP of https://github.com/jesseduffield/lazygit/issues/3789, I don't believe it is possible to achieve with custom commands.

TimShilov commented 3 hours ago

Btw, looking some more on this, I realized that [ and ] are not always doing the same thing. 😬

This is a separate issue of course but decided to note here as it is sort of related. If you go to "Branches" panel and hit "Enter" to look at commits of a specific branch - hitting [ or ] just goes one level up (just like hitting Esc does). This is so weird and unexpected IMO. 🫣 Why would hotkeys described as "Previous tab" and "Next tab" in the help do something other than that? The commits list doesn't even have tabs, so I would expect them to do nothing.