Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-canyon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Prevent the JetBrains session scrollbar from covering transcript content.
5 changes: 5 additions & 0 deletions .changeset/stellar-wolf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---

Improve mouse wheel scrolling speed in the JetBrains session view.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SessionMessageListPanel(
SessionUiStyle.SessionLayout.TRANSCRIPT_PADDING,
SessionUiStyle.SessionLayout.TRANSCRIPT_PADDING,
SessionUiStyle.SessionLayout.TRANSCRIPT_PADDING,
SessionUiStyle.SessionLayout.TRANSCRIPT_PADDING,
SessionUiStyle.SessionLayout.TRANSCRIPT_PADDING + SessionUiStyle.SessionLayout.TRANSCRIPT_SCROLLBAR_PADDING,
),
), Disposable, SessionEditorStyleTarget {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ object SessionUiStyle {
object SessionLayout {
const val GAP = 4
const val TRANSCRIPT_PADDING = 12
const val TRANSCRIPT_SCROLLBAR_PADDING = 10
const val USER_PROMPT_INDENT = 100
const val SCROLL_INCREMENT = 16
const val SCROLL_INCREMENT = 48
}

/** Shared tokens for individual transcript views and session views. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ai.kilocode.client.session

import ai.kilocode.client.session.ui.SessionMessageListPanel
import ai.kilocode.client.session.ui.style.SessionUiStyle
import ai.kilocode.rpc.dto.ChatEventDto
import ai.kilocode.rpc.dto.MessageErrorDto
import ai.kilocode.rpc.dto.PermissionRequestDto
Expand All @@ -12,11 +13,14 @@ import ai.kilocode.rpc.dto.ToolRefDto
import ai.kilocode.client.session.ui.prompt.PromptPanel
import ai.kilocode.client.plugin.KiloBundle
import com.intellij.ui.EditorTextField
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.components.JBRadioButton
import com.intellij.util.ui.JBUI
import java.awt.Container
import javax.swing.AbstractButton
import javax.swing.JButton
import javax.swing.Scrollable
import javax.swing.SwingConstants
import javax.swing.JTextArea
import kotlinx.coroutines.CompletableDeferred

Expand Down Expand Up @@ -161,6 +165,22 @@ class SessionScrollTest : SessionUiTestBase() {
assertFalse(jumpButton().isVisible)
}

fun `test physical mouse wheel uses accelerated transcript unit distance`() {
showMessages()
fillTranscript(48)
val bar = scrollBar()
setValue(bar, 0)
drainScroll()
val amount = 3
val expected = JBUI.scale(SessionUiStyle.SessionLayout.SCROLL_INCREMENT * amount)
assertTrue("bottom=${bottom(bar)} expected=$expected", bottom(bar) >= expected * 2)

val view = scrollView() as Scrollable
val unit = view.getScrollableUnitIncrement(scrollComponent().visibleRect, SwingConstants.VERTICAL, 1)

assertEquals(expected, unit * amount)
}

fun `test part delta follows bottom after height growth`() {
showMessages()
fillTranscript(24)
Expand Down Expand Up @@ -476,11 +496,12 @@ class SessionScrollTest : SessionUiTestBase() {
assertBottom(scrollBar())
}

fun `test scroll owns the session viewport`() {
fun `test scroll owns the session viewport without overlapping content`() {
settle()

assertSame(scrollComponent(), scrollView()?.parent?.parent)
assertFalse(scrollView() is SessionMessageListPanel)
assertFalse((scrollComponent() as JBScrollPane).isOverlappingScrollBar)
}

// ------ question/login-required autoscroll ------
Expand Down
Loading