Fix launching session in new window (#3497)

This commit is contained in:
Zane
2025-07-17 19:43:45 -07:00
committed by GitHub
parent b7057b1eda
commit 8a6329f8ca
8 changed files with 54 additions and 53 deletions
@@ -449,21 +449,6 @@ const ScheduleDetailView: React.FC<ScheduleDetailViewProps> = ({ scheduleId, onN
loadAndShowSessionDetails(sessionIdFromCard);
};
const handleResumeViewedSession = () => {
if (selectedSessionDetails) {
const { session_id, metadata } = selectedSessionDetails;
if (metadata.working_dir) {
console.log(
`Resuming session ID ${session_id} in new chat window. Dir: ${metadata.working_dir}`
);
window.electron.createChatWindow(undefined, metadata.working_dir, undefined, session_id);
} else {
console.error('Cannot resume session: working directory is missing.');
toastError({ title: 'Cannot Resume Session', msg: 'Working directory is missing.' });
}
}
};
if (selectedSessionDetails) {
return (
<SessionHistoryView
@@ -474,7 +459,6 @@ const ScheduleDetailView: React.FC<ScheduleDetailViewProps> = ({ scheduleId, onN
setSelectedSessionDetails(null);
setSessionDetailsError(null);
}}
onResume={handleResumeViewedSession}
onRetry={() => loadAndShowSessionDetails(selectedSessionDetails.session_id)}
showActionButtons={true}
/>
@@ -10,7 +10,6 @@ import {
Target,
LoaderCircle,
AlertCircle,
ExternalLink,
} from 'lucide-react';
import { type SessionDetails } from '../../sessions';
import { Button } from '../ui/button';
@@ -53,7 +52,6 @@ interface SessionHistoryViewProps {
isLoading: boolean;
error: string | null;
onBack: () => void;
onResume: () => void;
onRetry: () => void;
showActionButtons?: boolean;
}
@@ -148,7 +146,6 @@ const SessionHistoryView: React.FC<SessionHistoryViewProps> = ({
isLoading,
error,
onBack,
onResume,
onRetry,
showActionButtons = true,
}) => {
@@ -271,14 +268,10 @@ const SessionHistoryView: React.FC<SessionHistoryViewProps> = ({
</>
)}
</Button>
<Button onClick={onResume} size="sm" variant="outline">
<Button onClick={handleLaunchInNewWindow} size="sm" variant="outline">
<Sparkles className="w-4 h-4" />
Resume
</Button>
<Button onClick={handleLaunchInNewWindow} size="sm" variant="outline">
<ExternalLink className="w-4 h-4" />
New Window
</Button>
</>
) : null;
@@ -63,17 +63,6 @@ const SessionsView: React.FC<SessionsViewProps> = ({ setView }) => {
setError(null);
};
const handleResumeSession = () => {
if (selectedSession) {
console.log('Resuming session in current window:', selectedSession.session_id);
// Navigate to pair view with the session data
setView('pair', {
resumedSession: selectedSession,
});
}
};
const handleRetryLoadSession = () => {
if (selectedSession) {
loadSessionDetails(selectedSession.session_id);
@@ -99,7 +88,6 @@ const SessionsView: React.FC<SessionsViewProps> = ({ setView }) => {
isLoading={isLoadingSession}
error={error}
onBack={handleBackToSessions}
onResume={handleResumeSession}
onRetry={handleRetryLoadSession}
/>
) : (
@@ -73,15 +73,25 @@ export default function ProviderSettings({ onClose, isOnboarding }: ProviderSett
getExtensions,
addExtension,
});
toastService.configure({ silent: false });
toastService.success({
title: 'Success!',
msg: `Started goose with ${model} by ${provider.metadata.display_name}. You can change the model via the lower right corner.`,
});
onClose();
} catch (error) {
console.error(`Failed to initialize with provider ${provider_name}:`, error);
// Show error toast
toastService.configure({ silent: false });
toastService.error({
title: 'Initialization Failed',
msg: `Failed to initialize with ${provider.metadata.display_name}: ${error instanceof Error ? error.message : String(error)}`,
traceback: error instanceof Error ? error.stack || '' : '',
});
}
toastService.configure({ silent: false });
toastService.success({
title: 'Success!',
msg: `Started goose with ${model} by ${provider.metadata.display_name}. You can change the model via the lower right corner.`,
});
onClose();
},
[onClose, upsert, getExtensions, addExtension]
);