diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index f36ddd9da..e3758374c 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -1838,6 +1838,7 @@ function InlineTool(props: { pending: string failure?: string spinner?: boolean + separate?: boolean children: JSX.Element part: ToolPart onClick?: () => void @@ -1890,6 +1891,7 @@ function InlineTool(props: { pending={props.pending} failure={props.failure} spinner={props.spinner} + separate={props.separate} onMouseOver={() => clickable() && setHover(true)} onMouseOut={() => setHover(false)} onMouseUp={() => { @@ -1919,6 +1921,7 @@ export function InlineToolRow(props: { pending: string failure?: string spinner?: boolean + separate?: boolean children: JSX.Element onMouseOver?: () => void onMouseOut?: () => void @@ -1931,8 +1934,12 @@ export function InlineToolRow(props: { onMouseOut={props.onMouseOut} onMouseUp={props.onMouseUp} ref={(el: BoxRenderable) => { + if (props.separate) alwaysSeparate.add(el) setPreLayoutSiblingMargin(el, (previous) => { - return previous instanceof BoxRenderable && (previous.height > 1 || alwaysSeparate.has(previous)) ? 1 : 0 + return props.separate || + (previous instanceof BoxRenderable && (previous.height > 1 || alwaysSeparate.has(previous))) + ? 1 + : 0 }) }} > @@ -2281,6 +2288,7 @@ function Task(props: ToolProps) { return ( Grep "Task" (2 matches) - + Explore Task — Inspect active task spacing - + {"General Task — Confirm completed task spacing\n↳ 1 toolcall · 501ms"} @@ -134,7 +134,7 @@ function LoadedReadBeforeTaskFixture() { ↳ Loaded src/cli/cmd/tui/routes/session/tools.tsx - + {"Explore Task — Inspect active task spacing\n↳ 1 toolcall · 501ms"} @@ -312,7 +312,7 @@ describe("TUI inline tool wrapping", () => { expect(await renderFrame(() => , { width: 72, height: 10 })).toMatchSnapshot() }) - test("does not treat task rows differently from other inline rows", async () => { + test("separates a task row from a preceding inline detail", async () => { expect(await renderFrame(() => , { width: 72, height: 8 })).toMatchSnapshot() })