diff --git a/src/__tests__/renderer/components/Wizard/WizardKeyboardNavigation.test.tsx b/src/__tests__/renderer/components/Wizard/WizardKeyboardNavigation.test.tsx index 421a025c..dcfcce96 100644 --- a/src/__tests__/renderer/components/Wizard/WizardKeyboardNavigation.test.tsx +++ b/src/__tests__/renderer/components/Wizard/WizardKeyboardNavigation.test.tsx @@ -154,6 +154,12 @@ const mockMaestro = { shell: { openExternal: vi.fn(), }, + sshRemote: { + getConfigs: vi.fn().mockResolvedValue({ success: true, configs: [] }), + }, + sessions: { + getAll: vi.fn().mockResolvedValue([]), + }, }; // Mock theme diff --git a/src/__tests__/renderer/components/Wizard/WizardThemeStyles.test.tsx b/src/__tests__/renderer/components/Wizard/WizardThemeStyles.test.tsx index 74043a24..e9cbfb41 100644 --- a/src/__tests__/renderer/components/Wizard/WizardThemeStyles.test.tsx +++ b/src/__tests__/renderer/components/Wizard/WizardThemeStyles.test.tsx @@ -159,6 +159,12 @@ const mockMaestro = { fs: { readFile: vi.fn(), }, + sshRemote: { + getConfigs: vi.fn().mockResolvedValue({ success: true, configs: [] }), + }, + sessions: { + getAll: vi.fn().mockResolvedValue([]), + }, }; // Helper to render with required providers diff --git a/src/renderer/components/Wizard/screens/AgentSelectionScreen.tsx b/src/renderer/components/Wizard/screens/AgentSelectionScreen.tsx index 37c5d5a2..a8a4a89f 100644 --- a/src/renderer/components/Wizard/screens/AgentSelectionScreen.tsx +++ b/src/renderer/components/Wizard/screens/AgentSelectionScreen.tsx @@ -326,6 +326,9 @@ export function AgentSelectionScreen({ theme }: AgentSelectionScreenProps): JSX. const [loadingModels, setLoadingModels] = useState(false); const [refreshingAgent, setRefreshingAgent] = useState(false); + // Track if user has existing agents (to show/hide the note about in-tab wizard) + const [hasExistingAgents, setHasExistingAgents] = useState(false); + // SSH Remote configuration state // Initialize from wizard context if already set (e.g., when SSH was configured before opening wizard) const [sshRemotes, setSshRemotes] = useState([]); @@ -492,6 +495,27 @@ export function AgentSelectionScreen({ theme }: AgentSelectionScreenProps): JSX. }; }, []); + // Check if user has existing agents on mount + useEffect(() => { + let mounted = true; + + async function checkExistingAgents() { + try { + const sessions = await window.maestro.sessions.getAll(); + if (mounted) { + setHasExistingAgents(sessions.length > 0); + } + } catch (error) { + console.error('Failed to check existing agents:', error); + } + } + checkExistingAgents(); + + return () => { + mounted = false; + }; + }, []); + // Focus on mount - currently focus name field since only Claude is supported // TODO: When multiple agents are supported, focus the tiles instead useEffect(() => { @@ -1113,34 +1137,36 @@ export function AgentSelectionScreen({ theme }: AgentSelectionScreenProps): JSX. - {/* Section 2: Note box - centered in available space */} -
-
- - - Note: The new agent wizard captures - application inputs until complete. For a lighter touch, create a new agent then run{' '} - - /wizard - - {' '}or click the{' '} - - {' '}button in the Auto Run panel. The in-tab wizard runs alongside your other work. - + {/* Section 2: Note box - only shown if user has existing agents */} + {hasExistingAgents && ( +
+
+ + + Note: The new agent wizard captures + application inputs until complete. For a lighter touch, create a new agent then run{' '} + + /wizard + + {' '}or click the{' '} + + {' '}button in the Auto Run panel. The in-tab wizard runs alongside your other work. + +
-
+ )} {/* Section 3: Agent Grid or Connection Error */} {sshConnectionError ? (