Skip to content

fix(jetbrains): fill session dialog cards with a raised surface - #13797

Merged
kirillk merged 2 commits into
mainfrom
humble-thunder
Sep 5, 2026
Merged

fix(jetbrains): fill session dialog cards with a raised surface#13797
kirillk merged 2 commits into
mainfrom
humble-thunder

Conversation

@kirillk

@kirillk kirillk commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue — direct UI feedback from the JetBrains session dialog styling.

Context

Session dialog cards in the JetBrains plugin (question, permission, login-required, outcome, revert banner, onboarding) filled with SessionUiStyle.View.Surface.bgColor(), which is exactly the session backdrop color. So the card had no visible fill of its own — only the border read as a card, which looked flat/outline-only against the chat transcript.

Implementation

  • Added SessionUiStyle.View.Dialog:
    • bgColor() — the card fill, a contrast shift off the session backdrop (DIALOG_DELTA = 24), so the card reads as its own raised panel in every theme, including Islands Dark/Darcula where the backdrop and editor surface are identical.
    • outlineColor() — the card border, the midpoint blend between the backdrop and bgColor(), so the edge is a soft transition between the two surfaces instead of a hard delineating line.
  • DialogView.contentColor() now returns the new dialog surface while outlined is true, and falls back to the plain backdrop when setOutlined(false) — keeping chrome-free states (e.g. SessionOutcomeView's interrupted-run note) visually unchanged.
  • Added a getBackground() override on DialogView. The RoundedContentPanel super constructor assigns background = contentColor() before the outlined field is initialized, so the reported background property could go stale relative to what the card actually paints (notably after setOutlined() toggles). Deriving it dynamically keeps the two in sync.
  • PermissionView's rule-toggle chip blended its active fill over the session backdrop while sitting nested inside the dialog card; switched it to blend over the new dialog surface it actually paints on.
  • Documented the new surface/border pair in packages/kilo-jetbrains/AGENTS.md's Session UI Background Strategy section.

Screenshots / Video

Screen Shot 2026-09-04 at 11 04 06 AM

How to Test

Manual/local verification

  • Agent: ran ./gradlew typecheck and ./gradlew :frontend:test :backend:test from packages/kilo-jetbrains/ after each change — 4635 tests, 0 failures.
  • Agent: computed the resulting hex values for New UI Light, New UI Dark, and Islands Dark to confirm the border sits at the midpoint between backdrop and card fill in each (documented in code comments).

Reviewer test steps

  1. ./gradlew --no-configuration-cache runIde from packages/kilo-jetbrains/.
  2. Trigger a question card (ask the agent something that needs a question tool), a permission request, and an interrupted/failed run outcome.
  3. Confirm each dialog card renders as a filled panel with a soft border, distinct from the transcript backdrop, in a light theme, a dark theme, and Islands Dark.
  4. Confirm the interrupted-run note (a stop, not a failure) still renders as a plain muted line with no card chrome.

Blocked checks and substitute verification

  • Manual runIde visual verification across themes was not performed by the agent in this session (no interactive IDE session available); substitute verification was computing exact resulting hex values per theme from the color formulas and confirming via DialogViewTest that the border channel values fall strictly between the backdrop and fill channel values.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

Session dialog cards (question, permission, login-required, outcome,
revert banner, onboarding) filled with SessionUiStyle.View.Surface.bgColor(),
which is the session backdrop itself, so only the outline was visible.

Add SessionUiStyle.View.Dialog with a card fill derived as a contrast
shift off the backdrop, and a border derived as the midpoint between
the backdrop and that fill, so the card reads as a raised panel with a
soft edge in every theme instead of an outline-only shape.

DialogView.contentColor() now returns the new surface while outlined
and falls back to the backdrop when setOutlined(false), keeping
chrome-free states (e.g. an interrupted-run note) unchanged. Override
getBackground() so the reported background always matches what the
card actually paints, since the super constructor reads contentColor()
before the outlined field is initialized.

PermissionView's rule-toggle chip blended its active fill over the
session backdrop while nested inside the dialog card; switch it to
blend over the card surface it actually paints on.
@kilo-code-bot

kilo-code-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • .changeset/jetbrains-session-dialog-surface.md
  • packages/kilo-jetbrains/AGENTS.md
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionUiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/base/DialogView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/permission/PermissionView.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/base/DialogViewTest.kt
Previous Review Summary (commit 13ca51d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 13ca51d)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • .changeset/jetbrains-session-dialog-surface.md
  • packages/kilo-jetbrains/AGENTS.md
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionUiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/base/DialogView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/permission/PermissionView.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/base/DialogViewTest.kt

Reviewed by grok-4.6 · Input: 75.6K · Output: 5.3K · Cached: 230K

Review guidance: REVIEW.md from base branch main

DIALOG_DELTA=24 made the card fill too bright/prominent in dark
themes, drowning out the button outlines nested on it. Halve it to
12 so the card sits closer to the transcript backdrop while staying
visibly distinct, and the border (already derived as the midpoint
between backdrop and fill) softens along with it.
* which the code/diff bodies nested inside these cards paint.
*/
fun bgColor(): Color = JBColor.lazy {
UiStyle.Colors.contrast(Colors.sessionBackground(), DIALOG_DELTA)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bot: The dialog fill can still equal the independently configured code-block surface.

Suggested fix: After deriving the candidate from sessionBackground(), compare it with Colors.codeBlockBackground() and choose an alternate contrast/fallback when their RGB values match. Add a test with a session background whose 12-step contrast equals a configured code-block background, asserting the dialog fill remains distinct from both surfaces.

@kirillk
kirillk merged commit 978cc3a into main Sep 5, 2026
24 checks passed
@kirillk
kirillk deleted the humble-thunder branch September 5, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants