From dff4831fefeb2012e84d91f383ad226e429afbc2 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Tue, 26 May 2026 18:34:52 +1000 Subject: [PATCH] fix(desktop): start new chat in current window from recipe param modal When cancelling the Recipe Parameters modal and choosing 'Start New Chat (No Recipe)', the handler was opening a new Electron window and hiding the current one. The expected behavior is to dismiss the recipe and continue in the current window. Replace the createChatWindow + hideWindow calls with onClose(), which the parent wires to setView('chat') and navigates the current window to a fresh chat with no recipe loaded. Fixes #8864 Signed-off-by: Michael Neale --- ui/desktop/src/components/ParameterInputModal.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ui/desktop/src/components/ParameterInputModal.tsx b/ui/desktop/src/components/ParameterInputModal.tsx index 2888efaf7697..c3fad93a0645 100644 --- a/ui/desktop/src/components/ParameterInputModal.tsx +++ b/ui/desktop/src/components/ParameterInputModal.tsx @@ -1,7 +1,6 @@ import React, { useState, useEffect } from 'react'; import { Parameter } from '../recipe'; import { Button } from './ui/button'; -import { getInitialWorkingDir } from '../utils/workingDir'; import { defineMessages, useIntl } from '../i18n'; const i18n = defineMessages({ @@ -126,14 +125,7 @@ const ParameterInputModal: React.FC = ({ const handleCancelOption = (option: 'new-chat' | 'back-to-form'): void => { if (option === 'new-chat') { - try { - const workingDir = getInitialWorkingDir(); - window.electron.createChatWindow({ dir: workingDir }); - window.electron.hideWindow(); - } catch (error) { - console.error('Error creating new window:', error); - onClose(); - } + onClose(); } else { setShowCancelOptions(false); // Go back to the parameter form }