docs(jetbrains): document session style helpers

This commit is contained in:
kirillk
2026-04-30 15:44:34 -04:00
parent fcfd9e6eed
commit d522dfde7c
3 changed files with 41 additions and 16 deletions
+8 -8
View File
@@ -5,16 +5,16 @@
"packages": {
"": {
"dependencies": {
"@kilocode/plugin": "7.2.24"
"@kilocode/plugin": "7.2.31"
}
},
"node_modules/@kilocode/plugin": {
"version": "7.2.24",
"resolved": "https://registry.npmjs.org/@kilocode/plugin/-/plugin-7.2.24.tgz",
"integrity": "sha512-b2Xh3N/KaGdYj9hZbzZLKlDHXUsdMey0zL8G+RsnxDQCuhNm46LPyixtlJQhbCyir/zEEvy3uJI9kqKCsOWmQg==",
"version": "7.2.31",
"resolved": "https://registry.npmjs.org/@kilocode/plugin/-/plugin-7.2.31.tgz",
"integrity": "sha512-KmKTTIly7hRlJdXKhqZ/j/brvTPh0z0UTjWSjJWq5fqf4pATgYGn7G0g3ZjILnN7MUkkZXuljgqExTEeQJHGkQ==",
"license": "MIT",
"dependencies": {
"@kilocode/sdk": "7.2.24",
"@kilocode/sdk": "7.2.31",
"effect": "4.0.0-beta.48",
"zod": "4.1.8"
},
@@ -32,9 +32,9 @@
}
},
"node_modules/@kilocode/sdk": {
"version": "7.2.24",
"resolved": "https://registry.npmjs.org/@kilocode/sdk/-/sdk-7.2.24.tgz",
"integrity": "sha512-Yos6WeyvMl86OGXLQqQ9YWDm/geAC77xetoptEsS3DLtPVgvz1Nqkvas77fAuAqwkSfGL2mLIiHUTqJUTVflOw==",
"version": "7.2.31",
"resolved": "https://registry.npmjs.org/@kilocode/sdk/-/sdk-7.2.31.tgz",
"integrity": "sha512-Sx05yv+3TIlc6M4Ze+YGgKCLoIg8B0WRE15JXDriVncT+wz7M6+e+4mjNWkwfsuywdeOTYPfeFViqX8iO7ckKA==",
"license": "MIT",
"dependencies": {
"cross-spawn": "7.0.6"
+25
View File
@@ -836,6 +836,31 @@ RelativeFont.BOLD.install(label)
Avoid `Font("...")`, raw font sizes, and `deriveFont(14f)` style examples.
## Kilo Session Styling
For session/chat UI under `packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/`, keep general UI chrome separate from transcript styling.
- Use `ai.kilocode.client.ui.UiStyle` for general UI helpers: `Colors`, `Borders`, `Insets`, `Gap`, `Space`, `Size`, and `Buttons`.
- Use `ai.kilocode.client.session.ui.SessionStyle` for session transcript/content styling that follows editor settings or live transcript configuration.
- `SessionStyle` is for user/assistant transcript text, reasoning text, tool output, prompt editor text, and markdown renderer fields such as `font`, `codeFont`, and future link/code-block styles.
- Long-lived session components should implement or propagate `SessionStyleTarget.applyStyle(style)` instead of reading editor globals once in constructors.
- Do not call `EditorColorsManager.getInstance().globalScheme` directly from individual views unless extending `SessionStyle.current()`.
- New transcript renderers must apply the current `SessionStyle` snapshot and ensure child parts created after a style change receive the queued style.
- Keep non-transcript IDE chrome on platform/UI style unless it is intentionally part of the transcript reading experience.
Use `UiStyle` for the surrounding card chrome and `SessionStyle` for transcript content inside it:
```kotlin
class ExamplePartView : PartView() {
override fun applyStyle(style: SessionStyle) {
md.font = style.transcriptFont
md.codeFont = style.editorFamily
revalidate()
repaint()
}
}
```
## Borders, Insets, and Spacing
- Always create borders via `JBUI.Borders.empty(top, left, bottom, right)` and insets via `JBUI.insets()` so they are DPI-aware and auto-update on zoom.
+8 -8
View File
@@ -5,16 +5,16 @@
"packages": {
"": {
"dependencies": {
"@kilocode/plugin": "7.2.24"
"@kilocode/plugin": "7.2.31"
}
},
"node_modules/@kilocode/plugin": {
"version": "7.2.24",
"resolved": "https://registry.npmjs.org/@kilocode/plugin/-/plugin-7.2.24.tgz",
"integrity": "sha512-b2Xh3N/KaGdYj9hZbzZLKlDHXUsdMey0zL8G+RsnxDQCuhNm46LPyixtlJQhbCyir/zEEvy3uJI9kqKCsOWmQg==",
"version": "7.2.31",
"resolved": "https://registry.npmjs.org/@kilocode/plugin/-/plugin-7.2.31.tgz",
"integrity": "sha512-KmKTTIly7hRlJdXKhqZ/j/brvTPh0z0UTjWSjJWq5fqf4pATgYGn7G0g3ZjILnN7MUkkZXuljgqExTEeQJHGkQ==",
"license": "MIT",
"dependencies": {
"@kilocode/sdk": "7.2.24",
"@kilocode/sdk": "7.2.31",
"effect": "4.0.0-beta.48",
"zod": "4.1.8"
},
@@ -32,9 +32,9 @@
}
},
"node_modules/@kilocode/sdk": {
"version": "7.2.24",
"resolved": "https://registry.npmjs.org/@kilocode/sdk/-/sdk-7.2.24.tgz",
"integrity": "sha512-Yos6WeyvMl86OGXLQqQ9YWDm/geAC77xetoptEsS3DLtPVgvz1Nqkvas77fAuAqwkSfGL2mLIiHUTqJUTVflOw==",
"version": "7.2.31",
"resolved": "https://registry.npmjs.org/@kilocode/sdk/-/sdk-7.2.31.tgz",
"integrity": "sha512-Sx05yv+3TIlc6M4Ze+YGgKCLoIg8B0WRE15JXDriVncT+wz7M6+e+4mjNWkwfsuywdeOTYPfeFViqX8iO7ckKA==",
"license": "MIT",
"dependencies": {
"cross-spawn": "7.0.6"