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
+3 -5
View File
@@ -608,11 +608,9 @@ function renderEvent(ev, ctx) {
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", { class: "msg user" }, h("div", { class: "who" }, ev.actor, " ", when), messageImages(p["images"]), String(p["text"] ?? "").trim() ? markdown(String(p["text"]), "text md") : null);
case "agent.message":
+1 -1
View File
File diff suppressed because one or more lines are too long
+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",
+10 -1
View File
@@ -713,11 +713,20 @@ button.compact.danger {
color: var(--accent);
}
.note time {
.note time,
.byre-prompt time {
float: right;
margin-left: 12px;
}
.byre-prompt time {
color: var(--muted);
}
.byre-prompt .md {
padding: 6px 0;
}
details.note summary {
cursor: pointer;
}