Hide handoff continuations and NO_REPLY turns with leading text
This commit is contained in:
Vendored
+3
-5
@@ -152,7 +152,6 @@ export function mountChat(root, src, makeHead) {
|
||||
run: undefined,
|
||||
lastMessage: undefined,
|
||||
turnStart: undefined,
|
||||
keepTurnStart: false,
|
||||
quiet: false,
|
||||
handoff: undefined,
|
||||
root: src.root,
|
||||
@@ -385,7 +384,7 @@ export function mountChat(root, src, makeHead) {
|
||||
openHandoff();
|
||||
}
|
||||
if (ev.kind === "turn.ended" && ctx.quiet && ctx.turnStart?.parentNode === transcript) {
|
||||
let node = ctx.keepTurnStart ? ctx.turnStart.nextSibling : ctx.turnStart;
|
||||
let node = ctx.turnStart;
|
||||
while (node && node !== spinner) {
|
||||
const next = node.nextSibling;
|
||||
node.remove();
|
||||
@@ -398,7 +397,6 @@ export function mountChat(root, src, makeHead) {
|
||||
put(el);
|
||||
if (ev.kind === "user.message" && p["mid_turn"] !== true) {
|
||||
ctx.turnStart = el;
|
||||
ctx.keepTurnStart = p["continuation"] === true;
|
||||
}
|
||||
}
|
||||
if (contextChanged) {
|
||||
@@ -772,14 +770,14 @@ function renderEvent(ev, ctx) {
|
||||
const text = String(p["text"]);
|
||||
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", md));
|
||||
return h("details", { class: "tool byre-prompt", hidden: p["continuation"] === true }, h("summary", {}, h("span", { class: "tool-name" }, "byre"), " ", h("span", { class: "tool-brief" }, brief), " ", when), markdown(text, "text md", 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", md) : null);
|
||||
case "agent.message":
|
||||
if (parentOf(p)) {
|
||||
return h("div", { class: "msg agent subagent" }, h("div", { class: "who" }, subagentTag(parentOf(p), ctx), " ", when), markdown(String(p["text"]), "text md", md));
|
||||
}
|
||||
if (String(p["text"]).trim() === quietReply) {
|
||||
if (String(p["text"]).trim().split("\n").pop()?.trim() === quietReply) {
|
||||
ctx.quiet = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user