fix(app): snap to bottom on prompt

This commit is contained in:
Adam 2026-01-22 05:45:53 -06:00
parent d9b9485019
commit ae2693425e
No known key found for this signature in database
GPG Key ID: 9CB48779AF150E75
2 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,7 @@ interface PromptInputProps {
ref?: (el: HTMLDivElement) => void ref?: (el: HTMLDivElement) => void
newSessionWorktree?: string newSessionWorktree?: string
onNewSessionWorktreeReset?: () => void onNewSessionWorktreeReset?: () => void
onSubmit?: () => void
} }
const EXAMPLES = [ const EXAMPLES = [
@ -1110,6 +1111,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
} }
if (!session) return if (!session) return
props.onSubmit?.()
const model = { const model = {
modelID: currentModel.id, modelID: currentModel.id,
providerID: currentModel.provider.id, providerID: currentModel.provider.id,

View File

@ -909,6 +909,11 @@ export default function Page() {
overflowAnchor: "dynamic", overflowAnchor: "dynamic",
}) })
const resumeScroll = () => {
setStore("messageId", undefined)
autoScroll.forceScrollToBottom()
}
// When the user returns to the bottom, treat the active message as "latest". // When the user returns to the bottom, treat the active message as "latest".
createEffect( createEffect(
on( on(
@ -1535,6 +1540,7 @@ export default function Page() {
}} }}
newSessionWorktree={newSessionWorktree()} newSessionWorktree={newSessionWorktree()}
onNewSessionWorktreeReset={() => setStore("newSessionWorktree", "main")} onNewSessionWorktreeReset={() => setStore("newSessionWorktree", "main")}
onSubmit={resumeScroll}
/> />
</Show> </Show>
</div> </div>