Collapse byre-sent prompts in the transcript like tool calls
This commit is contained in:
+8
-5
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user