.kilo/plans/1779989384508-mighty-cabin.md
When a question-like active view first appears in the JetBrains session UI, do not auto-scroll the transcript if the user is already away from the tail and the scroll-to-bottom button is visible. This applies to permission prompts and question-based views. Existing behavior should remain: if the transcript is already at the bottom, new questions/permissions keep the view at the bottom; explicit question navigation can still jump to the active card.
SessionUi wires QuestionView with:
follow = { scroll.following() }scroll = { scroll.followBottom(it) }QuestionView.show() runs on first display and calls:
val tail = follow() before rendering the cardscroll(tail) after renderingSessionScroll.following() currently returns component.viewport.view === messages && tail.SessionScroll.atBottom(), which is also what SessionController.beforeUpdate uses for normal transcript updates.SessionScrollTest already covers question and login-required middle-scroll preservation, but it does not cover permission first appearance and likely does not cover a stale-tail/live-not-at-bottom edge.Update question first-show follow sampling to use live bottom state.
SessionUi.buildUi(), change the QuestionView follow lambda from scroll.following() to scroll.atBottom().SessionScroll.following() to return component.viewport.view === messages && atBottom() and keep the SessionUi call site unchanged. Prefer the smaller, clearer call-site change unless tests show other following() behavior should change too.Add permission scroll regression tests in SessionScrollTest.
test permission appearing at bottom keeps scroll at bottom.test permission appearing while user is in middle preserves scroll position.ChatEventDto.PermissionAsked("ses_test", PermissionRequestDto(...)) using the same DTO style as the existing recovered permission test.jumpButton().isVisible stays true when initially away from bottom.Strengthen question regression coverage if needed.
test question appearing while user is in middle preserves scroll position.tail can be stale, add a targeted regression that creates the visible jump state before QuestionAsked and asserts first display does not jump.setValue, setValuePassive, drainScroll, and event helpers.Preserve intentional explicit navigation behavior.
QuestionView.goForward(), goBack(), or goReview(), which intentionally call scroll(true) and are covered by existing tests that expect navigation to jump to the active question card.Verification.
packages/kilo-jetbrains/ using Gradle test filtering for SessionScrollTest if supported../gradlew typecheck from packages/kilo-jetbrains/ if the targeted tests pass or if Gradle filtering is unavailable.packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.ktpackages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionScrollTest.kt