From 9972884d381eb97fe404c5d816ffa6cc371674ba Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Tue, 7 Jul 2026 01:43:13 +0000 Subject: [PATCH] fix(tui): align switch reminders --- packages/tui/src/routes/session/index.tsx | 6 +++++- .../tui/inline-tool-wrap-snapshot.test.tsx | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index b9cf3ad81c20..047d036ab5d2 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -1259,7 +1259,11 @@ function SessionSwitchMessageV2(props: { message: SessionMessage }) { return switchLabel(props.message.model, ctx.models(), props.message.previous) return "" } - return {text()} + return ( + + {text()} + + ) } function SessionNoticeMessageV2(props: { message: SessionMessage }) { diff --git a/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx b/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx index f9a657ecc4a1..402db8b5fe16 100644 --- a/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx +++ b/packages/tui/test/cli/tui/inline-tool-wrap-snapshot.test.tsx @@ -89,6 +89,19 @@ function FailedCompleteToolFixture() { ) } +function ReminderAlignmentFixture() { + return ( + + + Switched variant to medium + + + Instructions updated + + + ) +} + async function renderFrame(component: () => JSX.Element, options: { width: number; height: number }) { testSetup = await testRender(component, options) await testSetup.renderOnce() @@ -124,6 +137,12 @@ describe("TUI inline tool wrapping", () => { expect(frame).not.toContain("Read failed") }) + test("aligns switch reminders with instruction reminders", async () => { + expect(await renderFrame(() => , { width: 35, height: 2 })).toBe( + " Switched variant to medium\n ◈ Instructions updated", + ) + }) + test("filters malformed nested tool wire data", () => { expect( parseApplyPatchFiles([