web: render a turn's input and output as their markdown bodies

The stage pane stringified the step's single-key {markdown} map, so a turn's
output appeared under a literal "markdown:" line inside a code card. The pane now
shows that body as the document it is, with "(no output)" for an empty turn; an
ordinary value map still shows its keys.
This commit is contained in:
2026-10-19 23:32:51 +01:00
parent b1482b554b
commit 793b62f53e
4 changed files with 47 additions and 2 deletions
+14
View File
@@ -311,6 +311,20 @@ test("runStepFields skips blanks and formats the visit", () => {
assert.ok(fields.every((f) => f.value.trim() !== ""));
});
test("a turn's input and output render as the document they carry", () => {
const body = "# Composition\n\n- one\n- two\n";
const fields = runStepFields({ input: { markdown: body }, output: { markdown: body } });
const input = fields.find((field) => field.label === "Input");
const output = fields.find((field) => field.label === "Output");
assert.equal(input.value, body);
assert.equal(output.value, body);
assert.equal(input.block, true);
const empty = runStepFields({ output: { markdown: "" } }).find((f) => f.label === "Output");
assert.equal(empty.value, "_(no output)_");
const map = runStepFields({ output: { summary: "ok", changed: "a.go" } }).find((f) => f.label === "Output");
assert.match(map.value, /summary: ok/);
});
test("runStepFields carries every evidence kind the timeline dropped", () => {
const fields = runStepFields({
status: "completed",