Repository navigation
feat(tabs): redesign tab splits and terminal pane discoverability - #5927
Conversation
|
Ready to review this PR? Stage has broken it down into 11 individual chapters for you: Chapters generated by Stage for commit 8664e25 on Jun 22, 2026 5:56am UTC. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request refactors tab interaction chrome and pointer activation across 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b8d2d242-fb42-4ce5-accd-034febf90dc1
📥 Commits
Reviewing files that changed from the base of the PR and between c3bff64 and 0a5a47fa351d5d731d3f78b91376e4477e2d82c1.
📒 Files selected for processing (12)
src/renderer/src/components/tab-bar/BrowserTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/drop-indicator.test.tssrc/renderer/src/components/tab-bar/drop-indicator.tssrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.tssrc/renderer/src/components/tab-group/TabGroupSplitLayout.tsxsrc/renderer/src/components/tab-group/tab-drag-context.tsxsrc/renderer/src/components/tab-group/tab-drag-preview-activation.test.tssrc/renderer/src/components/tab-group/tab-drag-preview-activation.tssrc/renderer/src/components/tab-group/tab-drag-preview-target.tssrc/renderer/src/components/tab-group/useTabDragSplit.ts
Move Level 1 splits off tab context menus onto a per-column split button, defer tab activation until pointer-up for drag-to-split, and add pointer-based pane-edge drop targets with a portal overlay above terminals. Tab drags can reorder tabs, move across panes, and create new columns via edge drops; empty source panes auto-collapse. Tab-strip overflow chevrons scroll continuously while dragging. Co-authored-by: Cursor <[email protected]>
0a5a47f to
db158b1
Compare
Expose terminal splits from tab menus and an always-on active-pane header, share split/CWD logic across entry points, and suppress misleading pane-drag drop previews when reorder would be a no-op. Co-authored-by: Cursor <[email protected]>
…drops Dragging the only tab onto an adjacent sibling's matching edge creates a transient column that collapses back to the current layout, so hide the "New pane column" affordance and reject the drop in the store. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts (1)
319-331: 💤 Low valueConsider passing
getManagerfor consistency with keyboard handler.The keyboard handler at
keyboard-handlers.ts:414-423passesgetManager: () => managerRef.currentto ensure the async CWD-resolution path uses a fresh manager reference. This call omits it, meaning the async path uses the capturedmanagervalue. If the manager changes during resolution (e.g., tab unmount/remount), the stale reference would be used.The helper handles null gracefully via optional chaining, so this isn't a functional bug, but adding
getManagerwould align the two call sites:♻️ Suggested alignment
splitTerminalPaneWithInheritedCwd({ manager, + getManager: () => managerRef.current, paneTransports: paneTransportsRef.current,
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 03a32c44-c94e-48d8-bfbf-1ec537894013
📥 Commits
Reviewing files that changed from the base of the PR and between 0a5a47fa351d5d731d3f78b91376e4477e2d82c1 and 9028232.
📒 Files selected for processing (65)
src/renderer/src/assets/terminal.csssrc/renderer/src/components/contextual-tours/ContextualTourOverlay.tsxsrc/renderer/src/components/tab-bar/BrowserTab.test.tsxsrc/renderer/src/components/tab-bar/BrowserTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.test.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsxsrc/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.tsxsrc/renderer/src/components/tab-bar/TabBar.context-menu.test.tssrc/renderer/src/components/tab-bar/TabBar.tsxsrc/renderer/src/components/tab-bar/TabBar.windows-shell-launch.test.tssrc/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsxsrc/renderer/src/components/tab-bar/drop-indicator.test.tssrc/renderer/src/components/tab-bar/drop-indicator.tssrc/renderer/src/components/tab-bar/request-active-terminal-pane-split.tssrc/renderer/src/components/tab-bar/tab-move-to-pane-column.test.tssrc/renderer/src/components/tab-bar/tab-move-to-pane-column.tssrc/renderer/src/components/tab-bar/tab-strip-drag-scroll.tssrc/renderer/src/components/tab-bar/tab-strip-overflow-navigation.test.tssrc/renderer/src/components/tab-bar/tab-strip-overflow-navigation.tssrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.tssrc/renderer/src/components/tab-bar/tab-title-tooltip.test.tsxsrc/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsxsrc/renderer/src/components/tab-group/TabGroupDropOverlay.tsxsrc/renderer/src/components/tab-group/TabGroupPanel.tsxsrc/renderer/src/components/tab-group/TabGroupSplitLayout.test.tssrc/renderer/src/components/tab-group/TabGroupSplitLayout.tsxsrc/renderer/src/components/tab-group/TabPaneColumnSplitDragOverlay.tsxsrc/renderer/src/components/tab-group/tab-drag-context.tsxsrc/renderer/src/components/tab-group/tab-drag-pointer.test.tssrc/renderer/src/components/tab-group/tab-drag-pointer.tssrc/renderer/src/components/tab-group/tab-drag-preview-activation.test.tssrc/renderer/src/components/tab-group/tab-drag-preview-activation.tssrc/renderer/src/components/tab-group/tab-drag-preview-target.tssrc/renderer/src/components/tab-group/tab-drop-zone.test.tssrc/renderer/src/components/tab-group/tab-drop-zone.tssrc/renderer/src/components/tab-group/tab-group-panel-split-target.test.tssrc/renderer/src/components/tab-group/tab-group-panel-split-target.tssrc/renderer/src/components/tab-group/tab-insertion.test.tssrc/renderer/src/components/tab-group/tab-insertion.tssrc/renderer/src/components/tab-group/useTabDragSplit.test.tssrc/renderer/src/components/tab-group/useTabDragSplit.tssrc/renderer/src/components/tab-group/useTabGroupWorkspaceModel.focus.test.tssrc/renderer/src/components/tab-group/useTabGroupWorkspaceModel.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/session-restored-banner-pane-state.test.tsxsrc/renderer/src/components/terminal-pane/session-restored-banner-pane-state.tssrc/renderer/src/components/terminal-pane/terminal-pane-split-icon.tsxsrc/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.tssrc/renderer/src/lib/pane-manager/pane-drag-pointer.tssrc/renderer/src/lib/pane-manager/pane-drag-reorder.test.tssrc/renderer/src/lib/pane-manager/pane-drag-reorder.tssrc/renderer/src/lib/pane-manager/pane-drop-no-op.test.tssrc/renderer/src/store/slices/pane-column-split-drop-no-op.test.tssrc/renderer/src/store/slices/pane-column-split-drop-no-op.tssrc/renderer/src/store/slices/tabs.test.tssrc/renderer/src/store/slices/tabs.tstests/e2e/terminal-panes.spec.ts
✅ Files skipped from review due to trivial changes (5)
- src/renderer/src/components/tab-bar/tab-strip-overflow-navigation.test.ts
- src/renderer/src/components/tab-group/tab-drag-pointer.test.ts
- src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx
- src/renderer/src/components/tab-bar/tab-move-to-pane-column.test.ts
- src/renderer/src/components/tab-group/tab-drop-zone.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/renderer/src/components/tab-group/tab-drag-context.tsx
- src/renderer/src/components/tab-bar/drop-indicator.ts
- src/renderer/src/components/tab-bar/drop-indicator.test.ts
- src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
- src/renderer/src/components/tab-bar/SortableTab.tsx
- Fix SortableTabContextMenu test prop name and restore drag surface state - Escape tab-group selector IDs and use styleguide tokens for drop label - Patch active surface from the resolved group after cross-group moves Co-authored-by: Cursor <[email protected]>
Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 38ff0701-327c-4ad3-82f1-ecc340434508
📒 Files selected for processing (10)
src/renderer/src/assets/terminal.csssrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsxsrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.test.tsxsrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx
- src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
- src/renderer/src/assets/terminal.css
Co-authored-by: Orca <[email protected]>
|
Pushed a maintainer follow-up for review fixes:
Validated with focused unit tests, localization verification, typecheck, lint, and Electron screenshots for the visible split/menu flows. |
Co-authored-by: Orca <[email protected]>
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Maintainer validation update for 6b61a92:
Notes: PR description intentionally left unchanged. GitHub reports no checks on this branch. CodeRabbit was manually triggered after the push and acknowledged the trigger without posting new actionable feedback. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/tab-group/useTabDragSplit.test.ts (1)
94-110: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider using
@testing-library/react'srenderHookutility.The custom
renderDragHookimplementation is functionally correct for React 19, but@testing-library/reactprovides a standardrenderHookutility that handles the container/root lifecycle and is more widely recognized in the testing community.Current pattern works fine, but the standard library would reduce maintenance surface.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7fdb29c1-f934-46c8-bf60-3e556b0d7684
📒 Files selected for processing (19)
src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/tab-move-to-pane-column.test.tssrc/renderer/src/components/tab-bar/tab-move-to-pane-column.tssrc/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.tssrc/renderer/src/components/tab-group/TabGroupPanel.tsxsrc/renderer/src/components/tab-group/tab-group-panel-split-target.test.tssrc/renderer/src/components/tab-group/tab-group-panel-split-target.tssrc/renderer/src/components/tab-group/useTabDragSplit.test.tssrc/renderer/src/components/tab-group/useTabDragSplit.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsxsrc/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.tssrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
✅ Files skipped from review due to trivial changes (3)
- src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts
- src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
- src/renderer/src/i18n/locales/ja.json
🚧 Files skipped from review as they are similar to previous changes (14)
- src/renderer/src/components/tab-bar/tab-move-to-pane-column.test.ts
- src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
- src/renderer/src/components/tab-bar/tab-move-to-pane-column.ts
- src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx
- src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
- src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
- src/renderer/src/components/tab-group/tab-group-panel-split-target.test.ts
- src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
- src/renderer/src/components/tab-group/useTabDragSplit.ts
- src/renderer/src/components/terminal-pane/TerminalPane.tsx
- src/renderer/src/components/tab-group/TabGroupPanel.tsx
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/es.json
Use a platform-neutral cwd fixture in TerminalPaneHeaderOverlay tests. Co-authored-by: Cursor <[email protected]>
|
Reviewing this right now and will land it! |
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
…-fix # Conflicts: # src/renderer/src/i18n/locales/es.json # src/renderer/src/i18n/locales/ja.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
…-fix # Conflicts: # src/cli/handlers/agent-hooks.test.ts
|
Thanks for the PR! Just made a few small tweaks. |
…ablyai#5927) Co-authored-by: Cursor <[email protected]> Co-authored-by: Orca <[email protected]> Co-authored-by: brennanb2025 <[email protected]> (cherry picked from commit bfb7785)
* fix(tabs): restore deferred tab activation so dragging a terminal tab doesn't switch panes mid-gesture PR #5927 shipped terminal-pane drag (reorder tabs, move a tab into another pane, edge-split into a new column). It deliberately DEFERRED tab activation to pointer-up and suppressed it during a drag, so pressing a tab to drag it never switched the active tab or stole terminal focus mid-gesture. PR #6395 (d32d62a) deleted tab-strip-pointer-activation.ts and made SortableTab/EditorFileTab/BrowserTab activate eagerly on pointerdown — fixing click-to-switch-after-reorder but regressing the drag: grabbing a tab now flips the active tab + focused pane and yanks xterm keyboard focus before the drag is even recognized (aggravated by PR #6210 raising the dnd-kit threshold 5px->12px). The move itself still lands, but the gesture feels broken. Restore the deferred-activation hook, but gate it on measured pointer DISPLACEMENT instead of the drag-active context ref the old hook used — that ref clears asynchronously relative to the drop's pointerup, which is exactly what made #6395's click-after-reorder misfire. Displacement mirrors dnd-kit's own activation threshold: a release within TAB_DRAG_ACTIVATION_DISTANCE_PX is a click (activate); crossing it is a drag (suppress). Because each press measures its own gesture, a click after a reorder always activates. - Recreate src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts (displacement-gated) + unit tests, incl. an explicit #6395 regression case. - Rewire onPointerDown in SortableTab, EditorFileTab, BrowserTab to use it. - BrowserTab.test.tsx shallow-renders via mocked React hooks; add useRef/ useCallback stubs so the new hook works under that harness. Verified end-to-end in a dev build via CDP: pressing a tab no longer activates/steals focus on pointerdown; a click still activates on release; dragging a tab into another pane still moves it; clicking tabs after a drag still switches (the #6395 guard in tests/e2e/tabs.spec.ts stays green because it uses zero-displacement clicks). 233 unit tests pass; oxlint + renderer typecheck clean. * fix: restore pane detach tab placement
…ablyai#5927) Co-authored-by: Cursor <[email protected]> Co-authored-by: Orca <[email protected]> Co-authored-by: brennanb2025 <[email protected]>
* fix(tabs): restore deferred tab activation so dragging a terminal tab doesn't switch panes mid-gesture PR stablyai#5927 shipped terminal-pane drag (reorder tabs, move a tab into another pane, edge-split into a new column). It deliberately DEFERRED tab activation to pointer-up and suppressed it during a drag, so pressing a tab to drag it never switched the active tab or stole terminal focus mid-gesture. PR stablyai#6395 (04713f5) deleted tab-strip-pointer-activation.ts and made SortableTab/EditorFileTab/BrowserTab activate eagerly on pointerdown — fixing click-to-switch-after-reorder but regressing the drag: grabbing a tab now flips the active tab + focused pane and yanks xterm keyboard focus before the drag is even recognized (aggravated by PR stablyai#6210 raising the dnd-kit threshold 5px->12px). The move itself still lands, but the gesture feels broken. Restore the deferred-activation hook, but gate it on measured pointer DISPLACEMENT instead of the drag-active context ref the old hook used — that ref clears asynchronously relative to the drop's pointerup, which is exactly what made stablyai#6395's click-after-reorder misfire. Displacement mirrors dnd-kit's own activation threshold: a release within TAB_DRAG_ACTIVATION_DISTANCE_PX is a click (activate); crossing it is a drag (suppress). Because each press measures its own gesture, a click after a reorder always activates. - Recreate src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts (displacement-gated) + unit tests, incl. an explicit stablyai#6395 regression case. - Rewire onPointerDown in SortableTab, EditorFileTab, BrowserTab to use it. - BrowserTab.test.tsx shallow-renders via mocked React hooks; add useRef/ useCallback stubs so the new hook works under that harness. Verified end-to-end in a dev build via CDP: pressing a tab no longer activates/steals focus on pointerdown; a click still activates on release; dragging a tab into another pane still moves it; clicking tabs after a drag still switches (the stablyai#6395 guard in tests/e2e/tabs.spec.ts stays green because it uses zero-displacement clicks). 233 unit tests pass; oxlint + renderer typecheck clean. * fix: restore pane detach tab placement
Summary
Splitting the workspace and splitting terminals inside a tab used to feel like two unrelated, hard-to-discover gestures. Tab drags switched panes on mouse down, so drag-to-split often looked like an accidental tab switch. Terminal splits lived behind right-click menus and keyboard shortcuts, and reordering panes could show a drop preview even when the layout would not change.
This PR makes both levels of splitting predictable: workspace pane columns are created from clearer tab-strip and menu affordances, and in-tab terminal splits are reachable from tab context menus plus a minimal active-pane header. Tab activation is deferred to pointer up with drag preview, and pane reorder drags no longer flash misleading drop targets for no-op moves.
What changed
splitTerminalPaneWithInheritedCwdfor header, context menu, keyboard, tourWalkthrough
CleanShot.2026-06-21.at.01.21.10.mp4
Test plan