diff --git a/app/components/home.tsx b/app/components/home.tsx index c09de3d62..2602df540 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -130,11 +130,14 @@ export function Chat() { ); useEffect(() => { - latestMessageRef.current?.scrollIntoView(false); + latestMessageRef.current?.scrollIntoView({ + behavior: "smooth", + block: "end", + }); }); return ( -
+
{session.topic}
diff --git a/app/store.ts b/app/store.ts index e49c0f9c5..f230df23a 100644 --- a/app/store.ts +++ b/app/store.ts @@ -106,8 +106,8 @@ export const useChatStore = create()( newSession() { set((state) => ({ - currentSessionIndex: state.sessions.length, - sessions: state.sessions.concat([createEmptySession()]), + currentSessionIndex: 0, + sessions: [createEmptySession()].concat(state.sessions), })); },