workspaces panel swap

This commit is contained in:
2026-02-19 12:14:02 +00:00
parent 111d4c86eb
commit 8b1bccab7a
6 changed files with 140 additions and 23 deletions
@@ -3,11 +3,19 @@ import { createContext, useContext } from 'react';
type WorkspaceContextValue = {
workspaceId: string | null;
cwd: string;
swapSourceId: string | null;
setSwapSourceId: (id: string | null) => void;
onSwap: (sourceId: string, targetId: string) => void;
};
const noop = () => {};
const WorkspaceContext = createContext<WorkspaceContextValue>({
workspaceId: null,
cwd: '~',
swapSourceId: null,
setSwapSourceId: noop,
onSwap: noop,
});
export const WorkspaceProvider = WorkspaceContext.Provider;