Skip to content

fix(desktop): enable drag-and-drop for single pane tabs#1271

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/single-pane-draggable
Feb 7, 2026
Merged

fix(desktop): enable drag-and-drop for single pane tabs#1271
Kitenite merged 1 commit into
mainfrom
kitenite/single-pane-draggable

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 7, 2026

Summary

  • Fixes single-pane tabs not being draggable to other tabs
  • react-mosaic-component skips connecting the drag source for root panes (path=[]), which prevents cross-tab drag-and-drop when a tab has only one pane
  • Uses MosaicWindowContext.connectDragSource to manually connect the drag source for root panes while preserving the library's default behavior for multi-pane layouts

Test plan

  • Open a tab with a single pane and drag it to another tab — should work
  • Open a tab with multiple panes and drag between panes — should still work as before
  • Drag a pane from a multi-pane tab to another tab — should still work as before

Summary by CodeRabbit

  • New Features
    • Workspace panes can now be dragged and dropped across tabs, enabling more flexible layout reorganization.

react-mosaic-component skips connecting the drag source for root panes
(path=[]), preventing single-pane tabs from being dragged to other tabs.
Use MosaicWindowContext.connectDragSource to manually connect the drag
source for root panes while preserving the library's default behavior
for multi-pane layouts.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 7, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The change modifies BasePaneWindow component to enable cross-tab drag-and-drop for root panes by introducing a RootDraggable internal component that connects to the Mosaic drag source via MosaicWindowContext. Root panes are identified using an isRoot flag based on path.length === 0.

Changes

Cohort / File(s) Summary
Root Pane Drag-and-Drop Support
apps/desktop/src/renderer/.../BasePaneWindow/BasePaneWindow.tsx
Introduces RootDraggable wrapper component and isRoot flag to enable cross-tab drag-and-drop for root panes via MosaicWindowContext integration, while preserving existing behavior for non-root panes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Root panes now waltz with grace across the tabs,
MosaicWindowContext weaves their dragging dance,
No longer bound by borders, they gracefully prance,
RootDraggable's magic makes layouts expand! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/single-pane-draggable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite merged commit f651189 into main Feb 7, 2026
5 of 6 checks passed
@Kitenite Kitenite deleted the kitenite/single-pane-draggable branch February 7, 2026 01:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 7, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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