diff --git a/app/components/home.tsx b/app/components/home.tsx index 850c51774..65a55d8f1 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -146,7 +146,7 @@ function useSubmitHandler() { }; } -export function Chat(props: { showSideBar?: () => void }) { +export function Chat(props: { showSideBar?: () => void, sideBarShowing?: boolean }) { type RenderMessage = Message & { preview?: boolean }; const [session, sessionIndex] = useChatStore((state) => [ @@ -384,7 +384,7 @@ export function Chat(props: { showSideBar?: () => void }) { onKeyDown={(e) => onInputKeyDown(e as any)} onFocus={() => setAutoScroll(true)} onBlur={() => setAutoScroll(false)} - autoFocus + autoFocus={!props?.sideBarShowing} /> } @@ -584,7 +584,7 @@ export function Home() { }} /> ) : ( - setShowSideBar(true)} /> + setShowSideBar(true)} sideBarShowing={showSideBar}/> )}