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.
This commit is contained in:
2026-10-19 23:08:47 +01:00
parent cc452e575a
commit 13af293c53
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -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; }
+7
View File
@@ -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(