feat: Improve styling for collapsed non interactive state#88
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines how SplitPanel exposes and applies interaction-state styling, with the goal of avoiding resize/toggle visual cues (cursor + divider hit-area affordances) when the panel is collapsed and non-interactive.
Changes:
- Adds a root-level
sp-drag-toggleclass tied to thedragToToggleprop to enable more targeted styling. - Restricts root cursor styling (
ew-resize/ns-resize) to only apply while dragging and when drag-to-toggle is enabled or the panel is not collapsed. - Reworks divider
::afterhit-area styling selectors so they only apply when interaction should be possible (root is drag-toggle-enabled or not collapsed) and when the divider is not disabled (.sp-disabled).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request updates the drag-to-toggle functionality and refines the styling logic for the
SplitPanelcomponent. The main focus is on improving how drag and toggle states are handled and styled, especially for collapsed panels and when toggling via drag. The changes ensure that visual cues and cursor styles are only applied in the correct interaction states.Improved drag-to-toggle and collapsed state handling:
sp-drag-toggleclass dynamically based on thedragToTogglestate, allowing for more precise styling when toggling panels via drag.ew-resizeandns-resizecursors are only shown when dragging is active and either drag-to-toggle is enabled or the panel is not collapsed. [1] [2]Refined divider and root styling:
sp-drag-toggleor is not collapsed, and the divider is not disabled. This prevents visual artifacts in inappropriate states. [1] [2]These changes collectively enhance the user experience by ensuring that drag and toggle interactions behave and appear consistently and intuitively.