Skip to content

fix: restore tab drag-and-drop pane splitting#76

Merged
gnoviawan merged 1 commit intodevfrom
worktree-fix-tab-dnd-pane-splitting
Mar 12, 2026
Merged

fix: restore tab drag-and-drop pane splitting#76
gnoviawan merged 1 commit intodevfrom
worktree-fix-tab-dnd-pane-splitting

Conversation

@gnoviawan
Copy link
Owner

@gnoviawan gnoviawan commented Mar 12, 2026

Summary

  • Disabled Tauri's native dragDropEnabled so HTML5 DnD events reach the WebView2 DOM on Windows
  • Reunified split PaneDndProvider into a single instance wrapping both PaneRenderer and FileExplorer, restoring shared isDragging state
  • Added onDragOver handler to tab bar container to prevent no-drop cursor in gaps between tabs

Root Cause

Three separate issues combined to break tab drag-and-drop:

  1. Tauri intercept: dragDropEnabled defaults to true, which blocks all HTML5 drag events at the native level
  2. Split provider (PR feat: codex inspired dark theme ui redesign with layout fixes #75 regression): Two separate PaneDndProvider instances meant isDragging set in one was invisible to the other
  3. Missing handler: Tab bar container lacked onDragOver, causing no-drop cursor between tabs

Test plan

  • Drag a tab from one pane to another pane's content area — DropZoneOverlay appears with split zones
  • Drop on a zone (left/right/top/bottom) — tab moves to new split pane
  • Drop on center zone — tab moves to target pane
  • Drag tab across tab bar gaps — cursor shows move indicator, never no-drop
  • Tab reorder within same pane still works
  • File explorer drag to pane shows DropZoneOverlay
  • Drag cancel (Escape / drop outside) resets cleanly

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Improved drag-and-drop handling in the workspace interface.
    • Enhanced empty state screen with better visual presentation and a "Create Your First Project" button for easier project creation.
  • Chores

    • Updated workspace configuration for improved stability.

Three issues prevented tab DnD from working:

1. Tauri's dragDropEnabled defaults to true, which intercepts all drag
   events at the native WebView2 level on Windows, preventing HTML5 DnD
   events from reaching the DOM. Set to false in tauri.conf.json.

2. PR #75 split PaneDndProvider into two separate instances (one for
   PaneRenderer, one for FileExplorer), so isDragging state set in one
   provider was invisible to children of the other. Reunified into a
   single provider wrapping both.

3. The tab bar container div lacked an onDragOver handler, causing the
   browser to show a no-drop cursor when dragging over gaps between tabs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 819f7ba0-853c-4025-bf0f-d34b3b9ac171

📥 Commits

Reviewing files that changed from the base of the PR and between f66cf47 and 199a2d5.

📒 Files selected for processing (3)
  • src-tauri/tauri.conf.json
  • src/renderer/components/workspace/WorkspaceTabBar.tsx
  • src/renderer/layouts/WorkspaceLayout.tsx

📝 Walkthrough

Walkthrough

Introduces drag-and-drop infrastructure for the workspace. Disables OS-level drag-drop in Tauri config, adds drag-over handler to tab bar, wraps layout in PaneDndProvider, and enhances the empty state with improved UI components.

Changes

Cohort / File(s) Summary
Tauri Configuration
src-tauri/tauri.conf.json
Added dragDropEnabled: false to Windows main configuration to control OS-level drag-and-drop behavior.
Tab Bar Drag Handling
src/renderer/components/workspace/WorkspaceTabBar.tsx
Added onDragOver handler to top-level container div to prevent default drag-over behavior and set dropEffect to 'move'.
Layout Restructuring & Empty State
src/renderer/layouts/WorkspaceLayout.tsx
Wrapped main layout in PaneDndProvider, reorganized conditional rendering around content sections, and redesigned the No Projects empty state with icon, heading, description, and action button.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

phase-1

Poem

🐰 With whiskers twitching, I hop with glee,
Dragging, dropping, wild and free!
Tabs now glide through panes divine,
Configuration set—the workspace shines! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: restore tab drag-and-drop pane splitting' directly describes the primary change: restoring drag-and-drop functionality for tab pane splitting. It aligns with all three key changes: disabling Tauri's dragDropEnabled, reunifying PaneDndProvider, and adding the onDragOver handler.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch worktree-fix-tab-dnd-pane-splitting

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.

@gnoviawan gnoviawan added phase-1 Phase 1: Stability & Polish (v0.3.1) v0.3.1 labels Mar 12, 2026
@gnoviawan gnoviawan merged commit 9fc535a into dev Mar 12, 2026
6 checks passed
This was referenced Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase-1 Phase 1: Stability & Polish (v0.3.1) v0.3.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant