Skip to content

SplitPane: collapse state + onCollapse double-click#25

Merged
RtlZeroMemory merged 1 commit into
mainfrom
feat/splitpane-collapse
Feb 11, 2026
Merged

SplitPane: collapse state + onCollapse double-click#25
RtlZeroMemory merged 1 commit into
mainfrom
feat/splitpane-collapse

Conversation

@RtlZeroMemory

Copy link
Copy Markdown
Owner

Fixes P1 API inconsistency: SplitPane collapsible/collapsed/onCollapse were documented/typed but unused.

Changes:

  • Layout applies collapsed indices when collapsible: true (collapsed panels clamp to minSizes[index] or 0).
  • WidgetRenderer: double-click near a divider invokes onCollapse(index, collapsed) (click left/top vs right/bottom to choose panel).
  • Divider hit-testing + rendering now use panel boundaries derived from adjacent child positions (works even when child widgets don't naturally fill).

Tests:

  • npm run lint
  • npm run typecheck -- --force
  • npm test

Note: npm run test:e2e is linux-only by design.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 395c59f277

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +649 to +653
this.splitPaneLastDividerDown = Object.freeze({
id,
dividerIndex: i,
timeMs: event.timeMs,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear divider double-click state before starting a drag

This records a double-click candidate on every divider mouse-down, but that state is not cleared when the interaction turns into a drag, so a quick second resize attempt on the same divider (within 500ms) is interpreted as a double-click and fires onCollapse unexpectedly. In collapsible panes this causes unintended panel collapse during rapid consecutive drag adjustments; the double-click tracker should be invalidated on drag/mouse-up or armed only for click-like interactions.

Useful? React with 👍 / 👎.

Comment on lines +44 to +45
if (delta <= 0) {
out[idx] = minSize;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep collapsed panels within the available panel budget

When constraints are tight (sum(minSizes) > available), panel sizing can intentionally push a panel below its min to stay within bounds, but this branch always bumps collapsed panels back up to minSize without shrinking another panel. In that case total panel cells can exceed available space (e.g. available=20, minSizes=[15,15], collapsed panel at index 1), causing child rects to overflow the container and desynchronize divider rendering/hit-testing from the actual viewport.

Useful? React with 👍 / 👎.

- Apply collapsed indices in layout (collapse to minSizes)

- Add double-click divider routing to invoke onCollapse

- Fix divider hit testing/rendering to use panel boundaries
@RtlZeroMemory
RtlZeroMemory force-pushed the feat/splitpane-collapse branch from 395c59f to 61e8a08 Compare February 11, 2026 07:51
@RtlZeroMemory
RtlZeroMemory merged commit b818419 into main Feb 11, 2026
14 checks passed
@RtlZeroMemory
RtlZeroMemory deleted the feat/splitpane-collapse branch February 11, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant