Collapse byre-sent prompts in the transcript like tool calls

This commit is contained in:
Ian Gulliver
2026-10-14 23:40:32 -07:00
parent 51ed0a3811
commit eabfc10c8d
5 changed files with 23 additions and 13 deletions
+8 -5
View File
@@ -693,11 +693,14 @@ function renderEvent(ev: ByreEvent, ctx: Ctx): HTMLElement | null {
ctx.lastMessage = undefined;
if (ev.actor === "byre") {
const text = String(p["text"]);
const [first, ...rest] = text.split("\n");
if (rest.join("").trim() === "") {
return h("div", { class: "note" }, text, " ", when);
}
return h("details", { class: "note" }, h("summary", {}, first, " ", when), markdown(rest.join("\n"), "text md"));
const first = text.split("\n")[0] ?? "";
const brief = first.length > 120 ? `${first.slice(0, 120)}…` : first;
return h(
"details",
{ class: "tool byre-prompt" },
h("summary", {}, h("span", { class: "tool-name" }, "byre"), " ", h("span", { class: "tool-brief" }, brief), " ", when),
markdown(text, "text md"),
);
}
return h(
"div",