fix: Prevent black flash when switching workspaces to split view #11966
+10
−1
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.
Summary
Fixes #11965
Problem
When switching from a regular workspace to a workspace containing a split view, there is a brief black flash around the split view area. This flash does not occur when switching between two workspaces that both have split views.
Solution
The black flash was caused by a timing issue in how CSS attributes are applied during split view activation. The CSS rules hide containers that have
is-zen-splitbut notzen-splitattribute when the parent haszen-split-viewattribute.The fix reorders the attribute setting in
activateSplitView():applyGridToTabs()first to setzen-splitattribute on containerszen-split-viewattribute on parent elementsThis ensures containers have their
zen-splitattribute set before the parentzen-split-viewCSS rules take effect, preventing the visibility flash.Changes
src/zen/split-view/ZenViewSplitter.mjs: ReorderedapplyGridToTabs()call inactivateSplitView()to run before setting parent attributes, and addedzen-splitattribute setting inapplyGridToTabs()for consistencyTesting
Checklist