mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-20 23:13:07 +00:00
chore: Fix all 246 TypeScript errors in UI
- Extended SetupAPI interface with 20+ missing methods for Cursor, Codex, OpenCode, Gemini, and Copilot CLI integrations - Fixed WorktreeInfo type to include isCurrent and hasWorktree fields - Added null checks for optional API properties across all hooks - Fixed Feature type conflicts between @automaker/types and local definitions - Added missing CLI status hooks for all providers - Fixed type mismatches in mutation callbacks and event handlers - Removed dead code referencing non-existent GlobalSettings properties - Updated mock implementations in electron.ts for all new API methods Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -310,9 +310,10 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
if (!node) return;
|
||||
if (node.type === 'terminal') {
|
||||
sessionIds.push(node.sessionId);
|
||||
} else {
|
||||
} else if (node.type === 'split') {
|
||||
node.panels.forEach(collectFromLayout);
|
||||
}
|
||||
// testRunner type has sessionId but we only collect terminal sessions
|
||||
};
|
||||
terminalState.tabs.forEach((tab) => collectFromLayout(tab.layout));
|
||||
return sessionIds;
|
||||
@@ -620,7 +621,7 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
description: data.error || 'Unknown error',
|
||||
});
|
||||
// Reset the handled ref so the same cwd can be retried
|
||||
initialCwdHandledRef.current = undefined;
|
||||
initialCwdHandledRef.current = null;
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error('Create terminal with cwd error:', err);
|
||||
@@ -628,7 +629,7 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
description: 'Could not connect to server',
|
||||
});
|
||||
// Reset the handled ref so the same cwd can be retried
|
||||
initialCwdHandledRef.current = undefined;
|
||||
initialCwdHandledRef.current = null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -791,6 +792,11 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
};
|
||||
}
|
||||
|
||||
// Handle testRunner type - skip for now as we don't persist test runner sessions
|
||||
if (persisted.type === 'testRunner') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// It's a split - rebuild all child panels
|
||||
const childPanels: TerminalPanelContent[] = [];
|
||||
for (const childPersisted of persisted.panels) {
|
||||
@@ -1094,7 +1100,8 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
const collectSessionIds = (node: TerminalPanelContent | null): string[] => {
|
||||
if (!node) return [];
|
||||
if (node.type === 'terminal') return [node.sessionId];
|
||||
return node.panels.flatMap(collectSessionIds);
|
||||
if (node.type === 'split') return node.panels.flatMap(collectSessionIds);
|
||||
return []; // testRunner type
|
||||
};
|
||||
|
||||
const sessionIds = collectSessionIds(tab.layout);
|
||||
@@ -1132,7 +1139,10 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
if (panel.type === 'terminal') {
|
||||
return [panel.sessionId];
|
||||
}
|
||||
return panel.panels.flatMap(getTerminalIds);
|
||||
if (panel.type === 'split') {
|
||||
return panel.panels.flatMap(getTerminalIds);
|
||||
}
|
||||
return []; // testRunner type
|
||||
};
|
||||
|
||||
// Get a STABLE key for a panel - uses the stable id for splits
|
||||
@@ -1141,8 +1151,12 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
if (panel.type === 'terminal') {
|
||||
return panel.sessionId;
|
||||
}
|
||||
// Use the stable id for split nodes
|
||||
return panel.id;
|
||||
if (panel.type === 'split') {
|
||||
// Use the stable id for split nodes
|
||||
return panel.id;
|
||||
}
|
||||
// testRunner - use sessionId
|
||||
return panel.sessionId;
|
||||
};
|
||||
|
||||
const findTerminalFontSize = useCallback(
|
||||
@@ -1154,6 +1168,7 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (panel.type !== 'split') return null; // testRunner type
|
||||
for (const child of panel.panels) {
|
||||
const found = findInPanel(child);
|
||||
if (found !== null) return found;
|
||||
@@ -1208,7 +1223,8 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
// Helper to get all terminal IDs from a layout subtree
|
||||
const getAllTerminals = (node: TerminalPanelContent): string[] => {
|
||||
if (node.type === 'terminal') return [node.sessionId];
|
||||
return node.panels.flatMap(getAllTerminals);
|
||||
if (node.type === 'split') return node.panels.flatMap(getAllTerminals);
|
||||
return []; // testRunner type
|
||||
};
|
||||
|
||||
// Helper to find terminal and its path in the tree
|
||||
@@ -1225,6 +1241,7 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
if (node.type === 'terminal') {
|
||||
return node.sessionId === target ? path : null;
|
||||
}
|
||||
if (node.type !== 'split') return null; // testRunner type
|
||||
for (let i = 0; i < node.panels.length; i++) {
|
||||
const result = findPath(node.panels[i], target, [
|
||||
...path,
|
||||
@@ -1354,6 +1371,11 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
);
|
||||
}
|
||||
|
||||
// Handle testRunner type - return null for now
|
||||
if (content.type === 'testRunner') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isHorizontal = content.direction === 'horizontal';
|
||||
const defaultSizePerPanel = 100 / content.panels.length;
|
||||
|
||||
@@ -1365,7 +1387,7 @@ export function TerminalView({ initialCwd, initialBranch, initialMode, nonce }:
|
||||
|
||||
return (
|
||||
<PanelGroup direction={content.direction} onLayout={handleLayoutChange}>
|
||||
{content.panels.map((panel, index) => {
|
||||
{content.panels.map((panel: TerminalPanelContent, index: number) => {
|
||||
const panelSize =
|
||||
panel.type === 'terminal' && panel.size ? panel.size : defaultSizePerPanel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user