workspace panel drag

This commit is contained in:
2026-02-19 12:31:30 +00:00
parent 8b1bccab7a
commit ebe2321f8f
7 changed files with 235 additions and 25 deletions
@@ -1,11 +1,16 @@
import { createContext, useContext } from 'react';
import type { DropPosition } from './layout-utils';
type WorkspaceContextValue = {
workspaceId: string | null;
cwd: string;
swapSourceId: string | null;
setSwapSourceId: (id: string | null) => void;
onSwap: (sourceId: string, targetId: string) => void;
dragSourceId: string | null;
setDragSourceId: (id: string | null) => void;
onMove: (sourceId: string, targetId: string, position: DropPosition) => void;
};
const noop = () => {};
@@ -16,6 +21,9 @@ const WorkspaceContext = createContext<WorkspaceContextValue>({
swapSourceId: null,
setSwapSourceId: noop,
onSwap: noop,
dragSourceId: null,
setDragSourceId: noop,
onMove: noop,
});
export const WorkspaceProvider = WorkspaceContext.Provider;