Skip to content

feat(Splitter): defer drag collapse/expand to release with pending intent#457

Draft
johnleider wants to merge 3 commits into
masterfrom
worktree-splitter-collapse-intent
Draft

feat(Splitter): defer drag collapse/expand to release with pending intent#457
johnleider wants to merge 3 commits into
masterfrom
worktree-splitter-collapse-intent

Conversation

@johnleider

Copy link
Copy Markdown
Member

Summary

Dragging a collapsible Splitter panel past its minSize previously 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:

  • Collapsing — the panel pins at minSize while 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.
  • Opening — mirror behavior from the collapsed rail: stays pinned closed while dragging, arms a pending intent, and expands on release.
  • Keyboard and programmatic resize keep their existing instant behavior (the new path is gated on active pointer drag).

API

SplitterHandle now exposes the armed state so consumers can render a "release to hide / open" affordance:

  • slot prop pending: 'collapse' | 'expand' | null
  • attribute data-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.

…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.
@johnleider johnleider added this to the v1.1.0 milestone Jul 1, 2026
@johnleider johnleider added enhancement New feature or request C: Splitter labels Jul 1, 2026
@johnleider johnleider self-assigned this Jul 1, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: b6e73bc

@johnleider johnleider marked this pull request as draft July 1, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: Splitter enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant