Skip to content

feat(tab-drag): VS Code-style blue insertion bar + cross-group drag ghost - #872

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/drag-tabs-across-groups
Apr 23, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/drag-tabs-across-groups

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two UX improvements to tab drag-and-drop, backed by pure-logic unit tests.

  • Blue insertion bar at the hovered tab's left/right edge during a drag. Pseudo-element bars (before:/after:) on the two tabs adjacent to the insertion slot render as one continuous 2px cue, matching VS Code's tab.dragAndDropBorder without shifting layout.
  • Drag ghost (DragOverlay) that follows the cursor across tab groups. The source tab strip is overflow-hidden, which clipped the sortable element the moment the cursor crossed into another group — the overlay chip (icon + label + optional color dot) keeps the drag visible everywhere. Sibling tabs are frozen during the drag (no SortableContext strategy, no transform/transition/opacity on the active tab) so only the insertion bar and ghost respond to movement.

Test plan

  • Drag a tab left/right within the same group — blue insertion bar appears at the correct edge, drop lands at that index.
  • Drag a tab out of its group — ghost chip follows the cursor past the tab strip's clip boundary.
  • Drag across groups and over another tab — insertion bar renders in the target group; drop moves the tab there.
  • Drag onto the same tab — no indicator (self-drop suppressed).
  • Cursor exactly at a tab's midpoint — lands on the right side (boundary behavior).
  • pnpm test — 962 renderer unit tests pass, including the new drop-indicator.test.ts (4 tests) and expanded tab-insertion.test.ts (16 tests covering resolveTabInsertion and resolveTabIndicatorEdges edge cases).

Notes for reviewers

  • tests/e2e/AGENTS.md (new) documents the electron-vite build --mode e2e requirement for window.__store and guidance to prefer store-slice unit tests over E2E specs that just invoke store actions via page.evaluate.
  • Pure-logic modules (drop-indicator.ts, tab-insertion.ts) are fully unit-tested. No E2E test was added: the new behavior is pointer-driven UI that a store-level E2E could not meaningfully verify, and real-pointer headful coverage is out of scope here.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/drag-tabs-across-groups branch from 798d61f to 92328ed Compare April 20, 2026 22:31
@brennanb2025 brennanb2025 changed the title Drag tabs across groups feat(tab-drag): cross-group tab drag, gated on terminal daemon Apr 21, 2026
Adds a blue vertical bar at the hovered tab's left/right edge during a tab
drag, matching VS Code's tab.dragAndDropBorder cue. The pre-existing
dnd-kit sortable animation slides neighbors apart; the bar is the final
snap indicator that shows exactly where the tab will land.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/drag-tabs-across-groups branch from ef21966 to d4389cc Compare April 23, 2026 05:21
…oups

Adds a DragOverlay chip (icon + label + optional color dot) so a tab
being dragged stays visible under the cursor after it leaves its source
tab strip. The source tab strip uses overflow-hidden, which clipped the
sortable element the moment the cursor crossed into another group.

Also freezes sibling tabs during a drag (no SortableContext strategy,
no transform/transition/opacity on the active tab), so only the blue
insertion bar and the overlay chip respond to drag movement.
Adds unit coverage for the new pure logic in the tab-drag feature:

- drop-indicator: verify before:/after: pseudo-element class output for
  each indicator side, and that null returns ''.
- tab-insertion: cover resolveTabInsertion's null-result branches
  (no over, non-tab data, self-drop, no cursor center), left/right
  midpoint selection, and edge cases for resolveTabIndicatorEdges
  (null input, empty list, unknown tab id, single-tab strip).

Also adds tests/e2e/AGENTS.md documenting the --mode e2e build
requirement for window.__store, and guidance to prefer store-slice
unit tests over E2E specs that just call store actions via
page.evaluate (they pay an Electron-launch tax for no extra
coverage).
…s-across-groups

# Conflicts:
#	src/renderer/src/components/tab-bar/EditorFileTab.tsx
@brennanb2025 brennanb2025 changed the title feat(tab-drag): cross-group tab drag, gated on terminal daemon feat(tab-drag): VS Code-style blue insertion bar + cross-group drag ghost Apr 23, 2026
@brennanb2025
brennanb2025 merged commit 8922b18 into main Apr 23, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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