Skip to content

feat: cross-container tab dragging in split-pane layout - #128

Merged
aterrylu merged 1 commit into
mainfrom
terry/tab-drag
Apr 13, 2026
Merged

feat: cross-container tab dragging in split-pane layout#128
aterrylu merged 1 commit into
mainfrom
terry/tab-drag

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

  • Enable dragging tabs between leaf containers in the split-pane layout
  • Tabs can be dropped on another container's center (add as tab) or edges (create new split)
  • When the source container's last tab is dragged away, the container collapses automatically
  • Works for all tab types: session tabs, preview panes, org chart, templates

How it works

The implementation is minimal (single file change) because it leverages the existing drag infrastructure:

graph LR
    A[TabBar<br/>onDragStart] -->|startDrag| B[DragContext<br/>isDragging=true]
    B --> C[SessionMountLayer<br/>pointerEvents=none]
    B --> D[DropZoneOverlay<br/>shows drop zones]
    D -->|existing pane| E[movePaneToLeaf<br/>removes from source<br/>adds to target]
    D -->|new pane| F[splitLeafWithPane<br/>or addTabToLeaf]
Loading

The same DragContextDropZoneOverlaymovePaneToLeaf pipeline used by sidebar drag now also handles tab drag. No new components or store actions needed.

Changes

  • packages/dashboard/src/layout/TabBar.tsx — Add draggable, onDragStart, onDragEnd handlers to tab elements. Wire into existing DragContext. Visual feedback: dimmed opacity on dragged tab, grab cursor.

Test plan

  • Open two panes in a split layout
  • Drag a tab from one container to the other (center = add as tab)
  • Drag a tab to the edge of another container (creates new split)
  • Drag the last tab from a container (container should collapse)
  • Open a markdown preview (ctrl-click), drag it to the other side for side-by-side view
  • Verify no terminal flickering or WebSocket drops during drag
  • Verify same-leaf drag shows no drop zones (correct suppression)

🤖 Generated with Claude Code

Enable dragging tabs between leaf containers in the split-pane layout.
Tabs are now draggable via the existing DragContext + DropZoneOverlay
infrastructure — drop on center to add as tab, drop on edges to split.

- Add draggable + onDragStart/onDragEnd handlers to TabBar tabs
- Reuse sidebar's DragContext pattern (startDrag/endDrag)
- Dim only the dragged tab (0.5 opacity) during drag
- DropZoneOverlay already handles existing-pane moves via movePaneToLeaf
- Same-leaf drops correctly suppressed by DropZoneOverlay

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu marked this pull request as ready for review April 13, 2026 04:15
@aterrylu
aterrylu merged commit 82f35c2 into main Apr 13, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/tab-drag branch April 13, 2026 04:15
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