Skip to content

Status panel cycles through log commands when switching panels #4469

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

Open
HoT-1 opened this issue Apr 9, 2025 · 4 comments
Open

Status panel cycles through log commands when switching panels #4469

HoT-1 opened this issue Apr 9, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@HoT-1
Copy link

HoT-1 commented Apr 9, 2025

Describe the bug
The status panel (panel 1) allows cycling through different log commands if more than one is specified via allBranchesLogCmds configuration option.
If you switch focus between the status panel and different panel (e.g. using tab or number keys) I would expect the same log command output to come up as before.
But it seems that the output cycles through the log commands as if I had pressed the 'a' key after switching panels.

To Reproduce
Steps to reproduce the behavior:

  1. Configure two different log commands for allBranchesLogCmds configuration option in config.yml
  2. In lazygit press 1 to focus status panel
  3. In lazygit check output of log command
  4. In lazygit press 2 to focus files panel
  5. In lazygit press 1 to focus status panel
  6. In lazygit compare output of log command to previous output

Expected behavior
I expect to see the output of the same git log command after switching away from and back to the status panel.

Version info:
commit=1b571f9e6b0a9a0040654aaf99333509a74613fc, build date=2025-03-01T02:30:10Z, build source=binaryRelease, version=0.48.0, os=linux, arch=amd64, git version=2.27.0

@HoT-1 HoT-1 added the bug Something isn't working label Apr 9, 2025
@ChrisMcD1
Copy link
Contributor

I have successfully reproduced this, but it also required me to set:

gui:
  statusPanelView: allBranchesLog

Do you have that set?

@ChrisMcD1
Copy link
Contributor

I don't have a fix for this just yet, but whatever I do will touch the same areas as #4345.

@jesseduffield @stefanhaller can I get a review on that PR so I know if I should stack my changes on top of it?

@HoT-1
Copy link
Author

HoT-1 commented Apr 10, 2025

I have successfully reproduced this, but it also required me to set:

gui:
  statusPanelView: allBranchesLog

Do you have that set?

Yes, indeed I have. Sorry that I forgot to mention that.

@ChrisMcD1
Copy link
Contributor

Cool, the problem here is that we have the same code for processing a click of 1 when that setting is turned on, as we have when you click a to rotate panels. So we just need to split that behavior such that 1 doesn't rotate the active panel, but a does.

There is just one slight edge where we'll want to overload a such that when a user doesn't have allBranchesLog set, it just transitions to that view, and then begins to rotate through options on future presses. I'm not precisely sure the best way to query "Which view am I currently looking at in this panel", but I think I'll be able to find that out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants