Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 5e049a4

Browse files
authored
Force Cody panel repaint only for meaningful events (#8215)
Fixes https://linear.app/sourcegraph/issue/QA-790/jb-specificmac-specific-chat-scroll-jumps-to-up-and-cody-ui-flickers ## Test plan 1. Launch any JetBrains IDE (e.g., IntelliJ IDEA, PyCharm) with the Cody plugin installed. 2. Sign in to Cody using valid Enterprise account credentials. 3. In the Cody chat panel, prompt: "Write a Java/Python program" and wait for the response. 4. Once the code is generated, scroll down to the bottom of the chat output. 5. Hover your cursor over side panels icons next to Cody icon **Expected behaviour:** The Cody chat panel should maintain its current scroll position when hovering over system UI elements. There should be no flicker, movement, or unintended scroll jumps when the cursor hovers over external system elements. <!-- Required. See https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles. -->
1 parent a0fce11 commit 5e049a4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

jetbrains/src/main/kotlin/com/sourcegraph/cody/ui/web/WebviewView.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.sourcegraph.cody.agent.protocol_generated.Webview_ResolveWebviewViewP
99
import java.awt.AWTEvent
1010
import java.awt.Toolkit
1111
import java.awt.event.AWTEventListener
12+
import java.awt.event.PaintEvent
1213

1314
/// A view that can host a browser component.
1415
private interface WebviewHost {
@@ -30,7 +31,12 @@ internal class CodyToolWindowContentWebviewHost(private val owner: CodyToolWindo
3031
var proxy: WebUIProxy? = null
3132
private set
3233

33-
private var displayChangeListener = AWTEventListener { proxy?.forceRepaint() }
34+
private var displayChangeListener = AWTEventListener { event ->
35+
val updateRectSize = (event as? PaintEvent)?.updateRect?.size
36+
if (updateRectSize == null || updateRectSize.height > 0 || updateRectSize.width > 0) {
37+
proxy?.forceRepaint()
38+
}
39+
}
3440

3541
override val viewDelegate =
3642
object : WebviewViewDelegate {

0 commit comments

Comments
 (0)