mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-30 19:32:39 +08:00
fix: auto-scroll to bottom after sending a message in chat (#6815)
This commit is contained in:
@@ -885,6 +885,11 @@ export const SessionProvider: ParentComponent = (props) => {
|
||||
}
|
||||
setStore("messages", sid, (msgs = []) => [...msgs, temp])
|
||||
setStore("parts", tempId, [{ type: "text" as const, id: `${tempId}-text`, text }])
|
||||
// The optimistic message is now in the DOM but the session status is
|
||||
// still "idle" (the CLI backend hasn't started yet), so the auto-scroll
|
||||
// ResizeObserver won't scroll on its own. Force scroll to bottom so the
|
||||
// user's own message is immediately visible.
|
||||
queueMicrotask(() => window.dispatchEvent(new CustomEvent("resumeAutoScroll")))
|
||||
}
|
||||
|
||||
const agent = selectedAgentName() !== defaultAgent() ? selectedAgentName() : undefined
|
||||
|
||||
Reference in New Issue
Block a user