Merge pull request #6658 from Kilo-Org/fix/6621-permission-prompt-auto-scroll

This commit is contained in:
Igor Šćekić
2026-03-05 13:29:30 +01:00
committed by GitHub
4 changed files with 20 additions and 4 deletions
@@ -87,7 +87,7 @@ export const AssistantMessage: Component<AssistantMessageProps> = (props) => {
/>
<Show when={perm()} keyed>
{(p) => (
<div data-component="permission-prompt">
<div data-component="permission-prompt" onClick={(e: MouseEvent) => e.stopPropagation()}>
<Show when={p.patterns.length > 0}>
<div class="permission-dock-patterns">
<For each={p.patterns}>
@@ -3,7 +3,7 @@
* Main chat container that combines all chat components
*/
import { Component, For, Show, createSignal, onCleanup, onMount } from "solid-js"
import { Component, For, Show, createSignal, createEffect, on, onCleanup, onMount } from "solid-js"
import { Button } from "@kilocode/kilo-ui/button"
import { BasicTool } from "@kilocode/kilo-ui/basic-tool"
import { TaskHeader } from "./TaskHeader"
@@ -32,6 +32,17 @@ export const ChatView: Component<ChatViewProps> = (props) => {
const permissionRequest = () => sessionPermissions().find((p) => !p.tool)
const blocked = () => sessionPermissions().length > 0 || sessionQuestions().length > 0
// When a bottom-dock permission/question disappears while the session is busy,
// the scroll container grows taller. Dispatch a custom event so MessageList can
// resume auto-scroll.
createEffect(
on(blocked, (isBlocked, wasBlocked) => {
if (wasBlocked && !isBlocked && !idle()) {
window.dispatchEvent(new CustomEvent("resumeAutoScroll"))
}
}),
)
const [responding, setResponding] = createSignal(false)
onMount(() => {
@@ -7,7 +7,7 @@
* Shows recent sessions in the empty state for quick resumption.
*/
import { Component, For, Show, createEffect, createMemo, JSX } from "solid-js"
import { Component, For, Show, createEffect, createMemo, onCleanup, JSX } from "solid-js"
import { Spinner } from "@kilocode/kilo-ui/spinner"
import { Button } from "@kilocode/kilo-ui/button"
import { useDialog } from "@kilocode/kilo-ui/context/dialog"
@@ -48,6 +48,11 @@ export const MessageList: Component<MessageListProps> = (props) => {
overflowAnchor: "dynamic",
})
// Resume auto-scroll when a bottom-dock permission/question is dismissed
const onResumeAutoScroll = () => autoScroll.resume()
window.addEventListener("resumeAutoScroll", onResumeAutoScroll)
onCleanup(() => window.removeEventListener("resumeAutoScroll", onResumeAutoScroll))
let loaded = false
createEffect(() => {
if (!loaded && server.isConnected() && session.sessions().length === 0) {
@@ -148,7 +148,7 @@ export const QuestionDock: Component<{ request: QuestionRequest }> = (props) =>
}
return (
<div data-component="tool-part-wrapper" data-question="true">
<div data-component="tool-part-wrapper" data-question="true" onClick={(e: MouseEvent) => e.stopPropagation()}>
<div data-component="question-prompt">
<div data-slot="question-body">
<div data-slot="question-header">