Skip to content

feat(tabs): redesign tab splits and terminal pane discoverability - #5927

Merged
brennanb2025 merged 16 commits into
stablyai:mainfrom
tmchow:tmchow/tab-drag-split-fix
Jun 22, 2026
Merged

brennanb2025 merged 16 commits into
stablyai:mainfrom
tmchow:tmchow/tab-drag-split-fix

Conversation

@tmchow

@tmchow tmchow commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Area Before After
Tab click vs drag Pane switched on mouse down Simple click activates on release; drag keeps source pane until hover/drop
Workspace split (Level 1) Ambiguous tab-strip split affordance Right-only pane-column split from tab strip; edge/body drop zones; move-to-pane-column in tab menus
Terminal split (Level 2) Context menu / shortcuts only Tab menu items + active-pane header split button (right split, same as workspace policy)
Pane reorder drag Drop halo on adjacent no-op moves Suppress overlay when source is already in the requested position
Split preview performance Drag hot path remeasured pane layout and animated overlay geometry Cache pane geometry once per drag; overlay uses cached bounds and snaps without geometry trailing
Split implementation Duplicated CWD/split paths Shared splitTerminalPaneWithInheritedCwd for header, context menu, keyboard, tour

Walkthrough

CleanShot.2026-06-21.at.01.21.10.mp4

Test plan

  • Click a tab in a split layout: chrome highlights on press, pane switches on release.
  • Drag a tab toward a pane edge: source pane stays visible until a valid drop target; preview follows hovered tab.
  • Drag a tab repeatedly across pane edges: split highlight tracks edge changes immediately; unit coverage asserts one geometry snapshot and no extra layout reads during repeated target resolution.
  • Right-click terminal tab → Split terminal right/down and Move to new pane column work; editor/browser tabs get workspace layout only.
  • Active terminal tab shows slim header with split icon; inactive panes reveal icons on hover; header split creates a right pane split in one click.
  • Drag right pane over left pane in a 2-up split: no misleading drop preview; 3-up reorder still works.
  • Contextual tour split action still targets the header split button.

Compound Engineering


Open in Stage

@ghost

ghost commented Jun 20, 2026 •

Copy link
Copy Markdown

@tmchow
tmchow marked this pull request as draft June 20, 2026 19:15
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request refactors tab interaction chrome and pointer activation across SortableTab, BrowserTab, and EditorFileTab using a new useTabStripPointerActivation hook that defers tab activation until pointer release. The onSplitGroup callback prop is removed from all tab components and the TabBar; split behavior is replaced by a TabWorkspaceLayoutMenuSection component and moveTabToNewPaneColumn helpers. The drag-over lifecycle in useTabDragSplit is rewritten to support pane-column split targeting via new drop-zone resolvers, panel geometry snapshots, and drag-preview activation snapshots. Terminal pane header UI is extracted into TerminalPaneHeaderOverlay, and split-with-CWD-inheritance logic is consolidated into splitTerminalPaneWithInheritedCwd. No-op detection is added for both pane drag reorder and pane-column split drops, and moveUnifiedTabToGroup now collapses empty source groups. Locale files add strings for workspace layout, terminal split controls, and AI Vault session display.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: redesigning tab splits and terminal pane discoverability, which aligns with the extensive changes throughout the codebase.
Description check ✅ Passed The PR description covers all required template sections: a clear summary of user-visible changes, detailed walkthrough of what changed, comprehensive test plan, and includes the required verification checklist items for build/test processes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/drop-indicator.test.ts
  • src/renderer/src/components/tab-bar/drop-indicator.ts
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
  • src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx
  • src/renderer/src/components/tab-group/tab-drag-context.tsx
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.test.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-target.ts
  • src/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]>
@tmchow
tmchow force-pushed the tmchow/tab-drag-split-fix branch from 0a5a47f to db158b1 Compare June 21, 2026 06:14
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]>
@tmchow tmchow changed the title fix(tabs): defer tab activation until pointer up for drag-to-split feat(tabs): redesign tab splits and terminal pane discoverability Jun 21, 2026
@tmchow
tmchow marked this pull request as ready for review June 21, 2026 08:24
…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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts (1)

319-331: 💤 Low value

Consider passing getManager for consistency with keyboard handler.

The keyboard handler at keyboard-handlers.ts:414-423 passes getManager: () => managerRef.current to ensure the async CWD-resolution path uses a fresh manager reference. This call omits it, meaning the async path uses the captured manager value. 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 getManager would 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.css
  • src/renderer/src/components/contextual-tours/ContextualTourOverlay.tsx
  • src/renderer/src/components/tab-bar/BrowserTab.test.tsx
  • src/renderer/src/components/tab-bar/BrowserTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.test.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx
  • src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/components/tab-bar/TabBar.tsx
  • src/renderer/src/components/tab-bar/TabBar.windows-shell-launch.test.ts
  • src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx
  • src/renderer/src/components/tab-bar/drop-indicator.test.ts
  • src/renderer/src/components/tab-bar/drop-indicator.ts
  • src/renderer/src/components/tab-bar/request-active-terminal-pane-split.ts
  • src/renderer/src/components/tab-bar/tab-move-to-pane-column.test.ts
  • src/renderer/src/components/tab-bar/tab-move-to-pane-column.ts
  • src/renderer/src/components/tab-bar/tab-strip-drag-scroll.ts
  • src/renderer/src/components/tab-bar/tab-strip-overflow-navigation.test.ts
  • src/renderer/src/components/tab-bar/tab-strip-overflow-navigation.ts
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
  • src/renderer/src/components/tab-bar/tab-title-tooltip.test.tsx
  • src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx
  • src/renderer/src/components/tab-group/TabGroupDropOverlay.tsx
  • src/renderer/src/components/tab-group/TabGroupPanel.tsx
  • src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts
  • src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx
  • src/renderer/src/components/tab-group/TabPaneColumnSplitDragOverlay.tsx
  • src/renderer/src/components/tab-group/tab-drag-context.tsx
  • src/renderer/src/components/tab-group/tab-drag-pointer.test.ts
  • src/renderer/src/components/tab-group/tab-drag-pointer.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.test.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-target.ts
  • src/renderer/src/components/tab-group/tab-drop-zone.test.ts
  • src/renderer/src/components/tab-group/tab-drop-zone.ts
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.test.ts
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
  • src/renderer/src/components/tab-group/tab-insertion.test.ts
  • src/renderer/src/components/tab-group/tab-insertion.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.test.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.focus.test.ts
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts
  • src/renderer/src/components/terminal-pane/session-restored-banner-pane-state.test.tsx
  • src/renderer/src/components/terminal-pane/session-restored-banner-pane-state.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-icon.tsx
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
  • src/renderer/src/lib/pane-manager/pane-drag-pointer.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.test.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.ts
  • src/renderer/src/lib/pane-manager/pane-drop-no-op.test.ts
  • src/renderer/src/store/slices/pane-column-split-drop-no-op.test.ts
  • src/renderer/src/store/slices/pane-column-split-drop-no-op.ts
  • src/renderer/src/store/slices/tabs.test.ts
  • src/renderer/src/store/slices/tabs.ts
  • tests/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

Comment thread src/renderer/src/store/slices/tabs.ts Resolved
tmchow and others added 3 commits June 21, 2026 01:46
- 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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 38ff0701-327c-4ad3-82f1-ecc340434508

📥 Commits

Reviewing files that changed from the base of the PR and between ffb1594 and aa856be.

📒 Files selected for processing (10)
  • src/renderer/src/assets/terminal.css
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.test.tsx
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
  • src/renderer/src/i18n/locales/en.json
  • 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
🚧 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

Comment thread src/renderer/src/i18n/locales/es.json Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor

Pushed a maintainer follow-up for review fixes:

  • fixed canceled tab press handling so pointer-canceled presses do not activate tabs or leave pressed state behind
  • tightened terminal pane header hit targets/styling
  • renamed the workspace layout action to “Move Tab to Split”
  • added/strengthened regression coverage for tab split context menu behavior and pointer activation
  • addressed the CodeRabbit teardown feedback; checked the locale sessionId note and verified it is not a duplicate key issue

Validated with focused unit tests, localization verification, typecheck, lint, and Electron screenshots for the visible split/menu flows.

@brennanb2025

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@brennanb2025

Copy link
Copy Markdown
Contributor

Maintainer validation update for 6b61a92:

  • Pushed review fixes to the actual PR head branch (tmchow/tab-drag-split-fix).
  • Addressed the actionable CodeRabbit/maintainer review items that were still real on current code: live manager refs for async terminal pane splits, web-runtime mirroring for menu-driven Move Tab to Split, tooltip usage for the pane actions icon button, localized strings, and regression coverage.
  • Rechecked stale CodeRabbit threads: duplicated drag type guards are already fixed on current head; es.json has no duplicate keys per a duplicate-key scan.
  • Ran pnpm vitest run --config config/vitest.config.ts for the focused split/menu/header regression set: 7 files, 33 tests passed.
  • Ran pnpm typecheck, pnpm lint, and git diff --check $(git merge-base origin/main HEAD): all passed.
  • Ran Electron validation in the PR worktree against a disposable non-Orca repo: verified Workspace layout -> Move Tab to Split -> Right moves the tab into a right split pane, and verified the split-terminal header control creates a pane split with backing layout state updated.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/src/components/tab-group/useTabDragSplit.test.ts (1)

94-110: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider using @testing-library/react's renderHook utility.

The custom renderDragHook implementation is functionally correct for React 19, but @testing-library/react provides a standard renderHook utility 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

📥 Commits

Reviewing files that changed from the base of the PR and between aa856be and 6b61a92.

📒 Files selected for processing (19)
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/tab-move-to-pane-column.test.ts
  • src/renderer/src/components/tab-bar/tab-move-to-pane-column.ts
  • src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
  • src/renderer/src/components/tab-group/TabGroupPanel.tsx
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.test.ts
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.test.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
  • 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
✅ 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]>
@brennanb2025

Copy link
Copy Markdown
Contributor

Reviewing this right now and will land it!

brennanb2025 and others added 6 commits June 21, 2026 21:07
…-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
…-fix

# Conflicts:
#	src/cli/handlers/agent-hooks.test.ts
@brennanb2025
brennanb2025 merged commit bfb7785 into stablyai:main Jun 22, 2026
3 checks passed
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for the PR! Just made a few small tweaks.

audichuang pushed a commit to audichuang/orca that referenced this pull request Jun 22, 2026
…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)
nwparker added a commit that referenced this pull request Jul 3, 2026
* 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
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* 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
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.

2 participants