Fix: The button for toggling the left pane visibility in the launcher… #1962
+37
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This condition was added by me in #1905, but I can't recall the reason for adding it and I believe it's unnecessary. In any case, it causes a bug:
In the browser, if the left pane is hidden and then you switch to another application (causing the page to lose focus), and then click the refresh button in the browser, the toggle button in the launcher appears blank.
When options.is("leftPaneVisible") changes, there are two cases to handle:
Case 1: options and currentLeftPaneVisible are inconsistent.
In this case, we need to update currentLeftPaneVisible to match options, and then call refreshIcon.
Case 2: options and currentLeftPaneVisible are the same.
This can be triggered by the toggleLeftPaneCommand.
For example, both window 1 and window 2 have visible left panes. If the user hides the left pane in window 1 (setting options to false), and then triggers the toggle command in window 2, options becomes true again, matching currentLeftPaneVisible.
In this case, we need to manually invert this.currentLeftPaneVisible in window 2 to toggle the pane visibility.
Both cases can effectively be handled by inverting this.currentLeftPaneVisible.
and fix: Incorrectly calculating rest-pane width in #1962
In vertical layout, the Split between leftPane and restPane needs to exclude the width of the launcherPane. Otherwise, the visible width of launcherPane will be compressed to less than --launcher-pane-size.
When multiple windows are open, if the leftPane is hidden and then shown again, its width should restore to the value before it was hidden in the current window, rather than retrieving it from Options. The same applies to the Split between center-pane and right-pane.