From e695fee172804b2ab7735154a2fc017869ad8a35 Mon Sep 17 00:00:00 2001 From: gitikavj Date: Thu, 3 Sep 2026 23:20:04 +0000 Subject: [PATCH] fix(tui): wrap long JSON values in detail views --- src/components/JsonDetail.tsx | 1 + src/handlers/harness/get/get.screen.test.tsx | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/components/JsonDetail.tsx b/src/components/JsonDetail.tsx index acc79464a..1cd49409b 100644 --- a/src/components/JsonDetail.tsx +++ b/src/components/JsonDetail.tsx @@ -77,6 +77,7 @@ export function JsonDetail({ language="json" showLineNumbers={false} showBorder={false} + wrap code={JSON.stringify(data, null, 2)} /> diff --git a/src/handlers/harness/get/get.screen.test.tsx b/src/handlers/harness/get/get.screen.test.tsx index 61a82c157..5a54a28ee 100644 --- a/src/handlers/harness/get/get.screen.test.tsx +++ b/src/handlers/harness/get/get.screen.test.tsx @@ -169,6 +169,19 @@ describe("harness hub screen", () => { }); describe("harness JSON detail screen", () => { + test("wraps long JSON values instead of truncating them", async () => { + const longPrompt = `${"reply sarcastically but accurately and concisely ".repeat(5)}WRAP_SENTINEL`; + const response = getResponse(); + response.harness!.systemPrompt = [{ text: longPrompt }]; + + const core = new TestCoreClient(); + core.harness.setGetResponse(response); + const r = renderScreen("/agentcore/harness/get/MyHarness-abc123/json", { core }); + + await waitForText(r.lastFrame, "WRAP_SENTINEL"); + r.unmount(); + }); + test("renders the harness JSON and scrolls without crashing", async () => { const core = new TestCoreClient(); core.harness.setGetResponse(getResponse());