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/question-output-font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Match answered question text to other tool output and respect the Kilo font size setting.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ai.kilocode.client.onboarding.FakeOnboardingController
import ai.kilocode.client.session.SessionManager
import ai.kilocode.client.session.SessionRef
import ai.kilocode.client.session.SessionUi
import ai.kilocode.client.session.SessionUiFactory
import ai.kilocode.client.session.controller.SessionController
import ai.kilocode.client.testing.FakeAppRpcApi
import ai.kilocode.client.testing.FakeSessionRpcApi
Expand Down Expand Up @@ -173,6 +174,8 @@ class WorktreeSessionEditorManagerTest : BasePlatformTestCase() {
}

fun `test deleting shown session removes it and falls back to next session`() {
val gate = CompletableDeferred<Unit>()
rpc.deleteGate = gate
val first = session("ses_1", updated = 3.0)
val second = session("ses_2", updated = 2.0)
rpc.listed += first
Expand All @@ -186,8 +189,11 @@ class WorktreeSessionEditorManagerTest : BasePlatformTestCase() {
flush()

assertEquals(listOf(DIR to "ses_1", DIR to "ses_2"), created)
assertEquals(setOf(first.id), edt { manager.deleting() })
gate.complete(Unit)
waitUntil { manager.deleting().isEmpty() }
assertEquals(listOf(first.id to DIR), rpc.deletes.toList())
assertTrue(notified.toString(), notified.isEmpty())
}

fun `test deleting middle shown session falls back to next visible session`() {
Expand Down Expand Up @@ -406,7 +412,7 @@ class WorktreeSessionEditorManagerTest : BasePlatformTestCase() {
workspace,
sessions,
app,
coroutines.scope,
SessionUiFactory(coroutines.scope).scope(),
ref = ref,
manager = owner,
workspaces = workspaces,
Expand Down Expand Up @@ -450,7 +456,8 @@ class WorktreeSessionEditorManagerTest : BasePlatformTestCase() {
private fun flush() = coroutines.drain()

private fun waitUntil(block: () -> Boolean) {
assertTrue(coroutines.pumpUntil { edt(block) })
val done = coroutines.pumpUntil { edt(block) }
assertTrue("created=$created, deletes=${rpc.deletes}, notified=$notified", done)
}

private fun useInactiveDisposeTimeout() {
Expand Down
3 changes: 2 additions & 1 deletion packages/kilo-ui/src/components/message-part.css
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,11 @@ html[data-theme="kilo-vscode"] [data-component="todos"] {
gap: 8px;
padding: 8px;
font-family: var(--font-family-sans);
font-size: var(--kilo-font-size-13);
font-size: var(--kilo-font-size-12);
line-height: var(--line-height-large);

[data-slot="question-answer-item"] {
font-size: inherit;
display: flex;
flex-direction: column;
gap: 2px;
Expand Down
9 changes: 9 additions & 0 deletions packages/kilo-vscode/tests/unit/font-size-arch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ describe("webview font-size architecture", () => {
).toEqual([])
})

it("scales answered questions with the tool output font", () => {
const css = fs.readFileSync(path.join(REPO, "packages/kilo-ui/src/components/message-part.css"), "utf-8")
const block = css.slice(css.indexOf('[data-component="question-answers"]'))
expect(block.slice(0, block.indexOf('[data-slot="question-answer-item"]'))).toContain(
"font-size: var(--kilo-font-size-12)",
)
expect(block.match(/\[data-slot="question-answer-item"\]\s*\{([^}]+)\}/)?.[1]).toContain("font-size: inherit")
})

it("uses scalable line heights in polished tool previews", () => {
const files = [
path.join(REPO, "packages/kilo-ui/src/components/basic-tool.css"),
Expand Down
Loading