diff --git a/packages/opencode/src/cli/cmd/opentui/session.tsx b/packages/opencode/src/cli/cmd/opentui/session.tsx index 4fc76abd27..da10fce03d 100644 --- a/packages/opencode/src/cli/cmd/opentui/session.tsx +++ b/packages/opencode/src/cli/cmd/opentui/session.tsx @@ -148,12 +148,17 @@ const PART_MAPPING = { function resize(el: BoxRenderable) { const parent = el.parent if (!parent) return + if (el.height > 1) { + el.marginTop = 1 + return + } const children = parent.getChildren() const index = children.indexOf(el) const previous = children[index - 1] if (!previous) return - if (el.height > 1 || previous.height > 1) { + if (previous.height > 1) { el.marginTop = 1 + return } } @@ -163,13 +168,7 @@ function TextPart(props: { part: TextPart; message: AssistantMessage }) { const local = useLocal() return ( - resize(el!)} - > + {props.part.text.trim()} {Locale.titlecase(agent().name)}{" "} @@ -209,9 +208,10 @@ function ToolPart(props: { part: ToolPart; message: AssistantMessage }) { { + resize(this) + }, 0) }} - ref={(el) => resize(el!)} > ({ ready(props) { return ( - Grep "{props.input.pattern}" ({props.metadata.matches} matches) + Grep "{props.input.pattern}" ) },