From 13af293c530251f3e88265642a06449a17b36cec Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Mon, 19 Oct 2026 23:08:47 +0100 Subject: [PATCH] web: show a turn's markdown output as the result A turn run carries one markdown body. The Output tab now renders that body directly instead of hiding it behind a collapsed field named "markdown"; legacy field maps keep their collapsible sections. --- web/run-detail.css | 1 + web/src/views/runDetail.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/web/run-detail.css b/web/run-detail.css index 9a6fa939..7dd373bc 100644 --- a/web/run-detail.css +++ b/web/run-detail.css @@ -281,5 +281,6 @@ /* A markdown stage body (the turn protocol) is prose, not a code block: keep the app's reading measure and its natural spacing. */ .field-markdown { max-width: var(--layout-measure); padding: 2px 0; } +.run-markdown-body { max-width: var(--layout-measure); padding: 4px 0; } .field-markdown > :first-child { margin-top: 0; } .field-markdown > :last-child { margin-bottom: 0; } diff --git a/web/src/views/runDetail.js b/web/src/views/runDetail.js index 03ade594..7f4b3f89 100644 --- a/web/src/views/runDetail.js +++ b/web/src/views/runDetail.js @@ -331,6 +331,13 @@ function renderRunFieldTab(map, keyPrefix, emptyMessage) { wrap.append(h("div", { class: "run-empty muted", text: emptyMessage })); return wrap; } + // A turn's output is one markdown body: render it as the result, not as a + // collapsed field named "markdown". Legacy field maps keep their sections. + const single = sections.length === 1 ? sections[0] : null; + if (single && single.key.toLowerCase() === "markdown") { + wrap.append(h("div", { class: "run-markdown-body" }, renderFieldValue(single.value))); + return wrap; + } for (const section of sections) { const key = `${keyPrefix}-${section.key}`; wrap.append(