From c9426d3a57e2439c4e41feac388271b4576cfe9d Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 21 May 2026 15:04:41 -0400 Subject: [PATCH] fix(tui): keep wrapped tool rows dense --- .../src/cli/cmd/tui/routes/session/index.tsx | 13 +------------ .../cli/tui/inline-tool-wrap-snapshot.test.tsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 43c0e41641..de7395f109 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1780,21 +1780,10 @@ function InlineTool(props: { if (!parent) { return } - if (el.height > 1) { - setMargin(1) - return - } const children = parent.getChildren() const index = children.indexOf(el) const previous = children[index - 1] - if (!previous) { - setMargin(0) - return - } - if (previous.height > 1 || previous.id.startsWith("text-")) { - setMargin(1) - return - } + setMargin(previous?.id.startsWith("text-") ? 1 : 0) }} > diff --git a/packages/opencode/test/cli/tui/inline-tool-wrap-snapshot.test.tsx b/packages/opencode/test/cli/tui/inline-tool-wrap-snapshot.test.tsx index 99592e9b9f..8e968bc6a5 100644 --- a/packages/opencode/test/cli/tui/inline-tool-wrap-snapshot.test.tsx +++ b/packages/opencode/test/cli/tui/inline-tool-wrap-snapshot.test.tsx @@ -1,5 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test" -import { For } from "solid-js" +import { createSignal, For } from "solid-js" import { testRender } from "@opentui/solid" let testSetup: Awaited> | undefined @@ -38,8 +38,18 @@ const tools: readonly ToolFixture[] = [ ] as const function InlineToolRow(props: { item: ToolFixture }) { + const [margin, setMargin] = createSignal(0) + return ( - + {props.item.icon} {props.item.label}