fix(jetbrains): outline prompt bubbles

This commit is contained in:
kirillk
2026-08-12 14:29:21 -04:00
parent bf0c6c7a9e
commit ff8e470300
4 changed files with 20 additions and 12 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@kilocode/kilo-jetbrains": patch
---
Always outline JetBrains prompt bubbles and use a rounder prompt bubble shape.
@@ -155,7 +155,7 @@ object SessionUiStyle {
const val EDITOR_LINES = 1
const val EDITOR_CHROME = 16
const val SEND_BUTTON_SIZE = 24
const val CORNER_ARC = 6
const val CORNER_ARC = 10
const val FOCUS_WIDTH = 2
const val PANEL_VERTICAL_PADDING = 8
const val PANEL_HORIZONTAL_PADDING = 12
@@ -479,10 +479,16 @@ class MessageView(
val g2 = g.create() as Graphics2D
try {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)
val arc = JBUI.scale(JBUI.getInt("Button.arc", SessionUiStyle.View.Prompt.CORNER_ARC))
val arc = JBUI.scale(SessionUiStyle.View.Prompt.CORNER_ARC)
val pt = if (box === this) Point() else SwingUtilities.convertPoint(box, Point(), this)
g2.color = SessionUiStyle.View.Prompt.bgColor(style)
g2.fillRoundRect(pt.x, pt.y, box.width, box.height, arc, arc)
val w = box.width - 1
val h = box.height - 1
if (w > 0 && h > 0) {
g2.color = SessionUiStyle.View.Outline.color()
g2.drawRoundRect(pt.x, pt.y, w, h, arc, arc)
}
} finally {
g2.dispose()
}
@@ -819,16 +819,13 @@ class SessionMessageListPanelTest : BasePlatformTestCase() {
message.paint(graphics)
graphics.dispose()
// The bubble is a filled code-block surface; it only draws an outline when that fill matches
// the session background. Probing the box edges verifies it paints at the wrapped coordinates.
val bg = SessionUiStyle.View.Prompt.bgColor(SessionEditorStyle.current())
val expected = if (bg.rgb == SessionUiStyle.Colors.sessionBackground().rgb) {
SessionUiStyle.View.Outline.color().rgb
} else {
bg.rgb
}
assertEquals(expected, Color(image.getRGB(point.x + box.width / 2, point.y), true).rgb)
assertEquals(expected, Color(image.getRGB(point.x + box.width / 2, point.y + box.height - 1), true).rgb)
// The bubble always draws an outline; probing the box edges verifies it paints at the
// wrapped coordinates, while the center remains the prompt fill surface.
val outline = SessionUiStyle.View.Outline.color().rgb
val fill = SessionUiStyle.View.Prompt.bgColor(SessionEditorStyle.current()).rgb
assertEquals(outline, Color(image.getRGB(point.x + box.width / 2, point.y), true).rgb)
assertEquals(outline, Color(image.getRGB(point.x + box.width / 2, point.y + box.height - 1), true).rgb)
assertEquals(fill, Color(image.getRGB(point.x + box.width / 2, point.y + box.height / 2), true).rgb)
}
fun `test created ContentDelta is not double applied`() {