diff --git a/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts b/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts index 0bfe5f89aa2..d80b474ea9b 100644 --- a/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts +++ b/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts @@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' const setTabGroupSplitRatioMock = vi.fn() const recordFeatureInteractionMock = vi.fn() +const setDragRootNodeMock = vi.fn() const useAppStoreMock = vi.fn( ( selector: (state: { @@ -37,7 +38,8 @@ vi.mock('./useTabDragSplit', () => ({ onDragMove: vi.fn(), onDragOver: vi.fn(), onDragStart: vi.fn(), - sensors: [] + sensors: [], + setDragRootNode: setDragRootNodeMock }) })) @@ -47,6 +49,7 @@ describe('TabGroupSplitLayout', () => { beforeEach(() => { setTabGroupSplitRatioMock.mockClear() recordFeatureInteractionMock.mockClear() + setDragRootNodeMock.mockClear() useAppStoreMock.mockClear() }) @@ -101,6 +104,19 @@ describe('TabGroupSplitLayout', () => { ) }) + it('wires the split layout root to drag cleanup ownership', () => { + const element = TabGroupSplitLayout({ + layout: { type: 'leaf', groupId: 'group-1' }, + worktreeId: 'wt-1', + focusedGroupId: 'group-1', + isWorktreeActive: true + }) + + const layoutWrapper = element.props.children[0] + + expect(layoutWrapper.props.ref).toBe(setDragRootNodeMock) + }) + it('only reserves top-right header space for the floating explorer toggle', () => { const element = TabGroupSplitLayout({ layout: { diff --git a/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx b/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx index 5cc911cad95..2bbf85f153a 100644 --- a/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx +++ b/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx @@ -238,7 +238,10 @@ export default function TabGroupSplitLayout({ state. The leftmost pane suppresses its own `border-l` via `touchesLeftEdge`, so the seam is always exactly 1px — previously both painted and stacked into a 2px bar below the drag strip. */} -