mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat: Update layout management in TerminalGrid to use updateLayoutSizes for size changes
This commit is contained in:
@@ -31,6 +31,7 @@ export interface TerminalGridState {
|
||||
|
||||
export interface TerminalGridActions {
|
||||
setLayout: (layout: AllotmentLayoutGroup) => void;
|
||||
updateLayoutSizes: (sizes: number[]) => void;
|
||||
splitPane: (paneId: PaneId, direction: 'horizontal' | 'vertical') => PaneId;
|
||||
closePane: (paneId: PaneId) => void;
|
||||
assignSession: (paneId: PaneId, sessionId: string | null) => void;
|
||||
@@ -82,6 +83,14 @@ export const useTerminalGridStore = create<TerminalGridStore>()(
|
||||
set({ layout }, false, 'terminalGrid/setLayout');
|
||||
},
|
||||
|
||||
updateLayoutSizes: (sizes) => {
|
||||
const currentLayout = get().layout;
|
||||
// Only update if sizes actually changed
|
||||
if (JSON.stringify(currentLayout.sizes) !== JSON.stringify(sizes)) {
|
||||
set({ layout: { ...currentLayout, sizes } }, false, 'terminalGrid/updateLayoutSizes');
|
||||
}
|
||||
},
|
||||
|
||||
splitPane: (paneId, direction) => {
|
||||
const state = get();
|
||||
const newPaneId = generatePaneId(state.nextPaneIdCounter);
|
||||
|
||||
Reference in New Issue
Block a user