mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
fix(app): snap to bottom on prompt
This commit is contained in:
parent
d9b9485019
commit
ae2693425e
@ -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,
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user