Skip to content

Conversation

@stefanhaller
Copy link
Collaborator

  • PR Description

When gui.expandFocusedSidePanel is set, the commits panel should be expanded while building a custom patch. However, the files panel was expanded in this case. This PR fixes that.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go run scripts/cheatsheet/main.go generate)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • Docs (specifically docs/Config.md) have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

if ctx.GetKind() == types.SIDE_CONTEXT {
return ctx.GetWindowName()
} else if ctx.GetKey() == context.PATCH_BUILDING_MAIN_CONTEXT_KEY {
return "commits"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea if this is an appropriate way to fix it, to be honest. It seems to work for me. 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised the original code isn't working: there should be some side context in the context stack, and I'd expect to see the a context in there belonging to the commits window, given you had to go through the commits window to reach the patch building window. I'd like to find the root cause of the issue before we add something this specific to this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I dropped this and pushed a new commit that looks more like the appropriate fix to me. Please have a look.

I still don't have enough overview over how things play together to tell whether this might have broken something else.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've got enough integration tests for these things that I'm pretty confident we haven't broken anything, and if we stumble across a problem we can add a test for it and revisit

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

Uffizzi Preview Environment deployment-17829

☁️ https://app.uffizzi.com/github.com/jesseduffield/lazygit/pull/2481

📄 View Application Logs etc.

What is Uffizzi? Learn more

This fixes accordion mode for the commit files panel. When entering a file, the
commit files panel should stay expanded.
@stefanhaller stefanhaller force-pushed the fix-accordion-mode-for-custom-patch branch from 3cf458d to 723504a Compare March 4, 2023 14:08
@jesseduffield
Copy link
Owner

Nice, this is a much better fix. Great work

@jesseduffield jesseduffield merged commit 3791b50 into jesseduffield:master Mar 6, 2023
@stefanhaller stefanhaller deleted the fix-accordion-mode-for-custom-patch branch March 6, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants