-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix behaviors of gui.sidePanelWidth: 1
#4583
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
base: master
Are you sure you want to change the base?
Fix behaviors of gui.sidePanelWidth: 1
#4583
Conversation
Previously we were relying on setting just the sideSectionWeight in order to ensure the main panel was fully focused. This can cause a problem if the user had their `gui.sidePanelWidth` set to 1. Such a value make the mainPanelWidth = 0 by default. By just setting the sideSectionWeight, you then communicate to the UI that you want _both_ halves of the screen to have 0 width! No good! This change seems like it won't impact users of more standard `gui.sidePanelWidth` values, so it's just a free win!
Any time that we are on the `currentWindow == "main"` it makes sense for it to be visible, and this will ensure that
gui.sidePanelWidth: 1
The changes make sense to me. I guess there are some more weirdnesses around focusing the main view in half or full screen mode, but I don't use these modes much, and can't be bothered right now to explore this more. 😄 We have fancy tests for this kind of stuff in |
I was unable to test the full flow that caused the crash from the initial bug report inside of window_arrangement_helper_test.go, so I created a full integration test.
Sure, just added! Those tests don't end up exercising the crash point that created this PR, so I also made an integration test for that behavior in particular. I also realized I had inadvertently duplicated the logic of "make the main view full screen", so I added a fixup to simply that logic. |
Looks great. Just one last question about the integration test: I verified that it crashes when I revert the production code changes, but only if I run it with |
We have technically allowed
sidePanelWidth = 1
in the schema for forever. But it seems it never worked! #4582This PR fixes 2 behaviors:
gui.sidePanelWidth
set to 1. Such a value make the mainPanelWidth = 0 by default. By just setting the sideSectionWeight, you then communicate to the UI that you want both halves of the screen to have 0 width! No good! Crash!These changes seem like they won't impact users of more standard
gui.sidePanelWidth
values, so it's just a free win!Fixes #4582
go generate ./...
)