mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 14:44:21 +01:00
fix: goose recipe prompt is not shown again when switch the view from settings to chat (#2870)
This commit is contained in:
1
ui/desktop/.gitignore
vendored
1
ui/desktop/.gitignore
vendored
@@ -8,3 +8,4 @@ src/bin/goose-npm/
|
||||
/playwright-report/
|
||||
/test-results/
|
||||
/src/bin/temporal-service
|
||||
src/bin/temporal.db
|
||||
|
||||
@@ -105,7 +105,6 @@ const getInitialView = (): ViewConfig => {
|
||||
export default function App() {
|
||||
const [fatalError, setFatalError] = useState<string | null>(null);
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [appInitialized, setAppInitialized] = useState(false);
|
||||
const [pendingLink, setPendingLink] = useState<string | null>(null);
|
||||
const [modalMessage, setModalMessage] = useState<string>('');
|
||||
const [extensionConfirmLabel, setExtensionConfirmLabel] = useState<string>('');
|
||||
@@ -207,15 +206,10 @@ export default function App() {
|
||||
toastService.configure({ silent: false });
|
||||
};
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await initializeApp();
|
||||
setAppInitialized(true);
|
||||
} catch (error) {
|
||||
console.error('Unhandled error in initialization:', error);
|
||||
setFatalError(`${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
}
|
||||
})();
|
||||
initializeApp().catch((error) => {
|
||||
console.error('Unhandled error in initialization:', error);
|
||||
setFatalError(`${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
});
|
||||
}, [read, getExtensions, addExtension]);
|
||||
|
||||
const [isGoosehintsModalOpen, setIsGoosehintsModalOpen] = useState(false);
|
||||
@@ -515,7 +509,6 @@ export default function App() {
|
||||
)}
|
||||
{view === 'chat' && !isLoadingSession && (
|
||||
<ChatView
|
||||
readyForAutoUserPrompt={appInitialized}
|
||||
chat={chat}
|
||||
setChat={setChat}
|
||||
setView={setView}
|
||||
|
||||
@@ -56,13 +56,11 @@ const isUserMessage = (message: Message): boolean => {
|
||||
};
|
||||
|
||||
export default function ChatView({
|
||||
readyForAutoUserPrompt,
|
||||
chat,
|
||||
setChat,
|
||||
setView,
|
||||
setIsGoosehintsModalOpen,
|
||||
}: {
|
||||
readyForAutoUserPrompt: boolean;
|
||||
chat: ChatType;
|
||||
setChat: (chat: ChatType) => void;
|
||||
setView: (view: View, viewOptions?: ViewOptions) => void;
|
||||
@@ -71,7 +69,6 @@ export default function ChatView({
|
||||
return (
|
||||
<ChatContextManagerProvider>
|
||||
<ChatContent
|
||||
readyForAutoUserPrompt={readyForAutoUserPrompt}
|
||||
chat={chat}
|
||||
setChat={setChat}
|
||||
setView={setView}
|
||||
@@ -87,7 +84,6 @@ function ChatContent({
|
||||
setView,
|
||||
setIsGoosehintsModalOpen,
|
||||
}: {
|
||||
readyForAutoUserPrompt: boolean;
|
||||
chat: ChatType;
|
||||
setChat: (chat: ChatType) => void;
|
||||
setView: (view: View, viewOptions?: ViewOptions) => void;
|
||||
@@ -628,7 +624,7 @@ function ChatContent({
|
||||
isLoading={isLoading}
|
||||
onStop={onStopGoose}
|
||||
commandHistory={commandHistory}
|
||||
initialValue={_input || initialPrompt}
|
||||
initialValue={_input || (hasMessages ? _input : initialPrompt)}
|
||||
setView={setView}
|
||||
hasMessages={hasMessages}
|
||||
numTokens={sessionTokenCount}
|
||||
|
||||
Reference in New Issue
Block a user