feat(Splitter): defer drag collapse/expand to release with pending intent#457
Draft
johnleider wants to merge 3 commits into
Draft
feat(Splitter): defer drag collapse/expand to release with pending intent#457johnleider wants to merge 3 commits into
johnleider wants to merge 3 commits into
Conversation
…tent Dragging a collapsible panel past minSize previously collapsed it instantly mid-drag, and reopening required accumulating a large fixed delta before the panel popped open. Both feel abrupt. The panel now pins at minSize (or collapsedSize when opening) while dragging and arms a pending intent; collapse/expand commits only on pointer release, and dragging back cancels it. SplitterHandle exposes the armed state via a 'pending' slot prop and data-pending attribute. Keyboard and programmatic resize keep the existing instant behavior.
|
commit: |
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.
Summary
Dragging a collapsible
Splitterpanel past itsminSizepreviously collapsed it instantly mid-drag, and reopening a collapsed panel silently swallowed the drag until a fixed 10%-of-root delta accumulated, then popped open. Both feel abrupt.This defers the commit to pointer release:
minSizewhile dragging (resists going smaller) and arms a pending intent once dragged a little past the edge. It only hides on release; dragging back out cancels.API
SplitterHandlenow exposes the armed state so consumers can render a "release to hide / open" affordance:pending: 'collapse' | 'expand' | nulldata-pending="collapse" | "expand"New exported types:
SplitterPendingIntent,SplitterIntentMode.The playground's files-panel handle uses this to accent the handle and show a "Release to hide" / "Release to open" label, replacing the previous instant-collapse feel.