Collapse byre-sent prompts in the transcript like tool calls
This commit is contained in:
Vendored
+3
-5
@@ -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":
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+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",
|
||||
|
||||
+10
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user