Workspace change refactoring #3121
Merged
+236
−92
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.
Fix: Handle essential tabs and container-specific essentials
Refactor workspace switching logic to correctly handle
essential tabs and introduce container-specific essentials.
This change addresses issues with essential tabs not being
handled correctly during workspace switches.
The
changeWorkspace
function is refactored to improveclarity and maintainability. The logic for showing and
hiding tabs is streamlined, and tab selection is handled
more robustly. A new
_shouldShowTab
function isintroduced to centralize the logic for determining tab
visibility based on workspace and container settings. The
logic also handles pinned essential tabs in the different workspace types.
The pinned tab manager is updated to support container-
specific essentials and to refresh pinned tabs on workspace
changes. The
_shouldShowPin
function is introduced tomanage visibility of pinned tabs in different workspaces
considering essential tabs, pinned tabs and containers.
This change also fixes a bug where the selected tab would
sometimes be changed unexpectedly when switching
workspaces.
This PR also prevents creating new window for dragging pinned tab out of the window.