Keep quiet lead signal turns off-screen until they show something

This commit is contained in:
Ian Gulliver
2026-10-16 23:17:44 -07:00
parent 35184dc081
commit 9a24e1c9b7
4 changed files with 24 additions and 12 deletions
+10 -4
View File
@@ -233,11 +233,13 @@ export function mountChat(root, src, makeHead) {
};
const syncRunning = () => setRunning(src.session()?.state === "running" && ctx.open);
const release = () => {
if (!ctx.held) {
const buffered = ctx.held;
if (!buffered) {
return;
}
ctx.held = undefined;
ctx.open = true;
putBefore(buffered, pending[0]?.el);
syncRunning();
};
const put = (el, keepHeld = false) => {
@@ -249,6 +251,10 @@ export function mountChat(root, src, makeHead) {
release();
}
ctx.drawn?.push(el);
if (ctx.held) {
ctx.held.append(el);
return;
}
putBefore(el, pending[0]?.el);
};
const fold = () => {
@@ -327,7 +333,7 @@ export function mountChat(root, src, makeHead) {
sub.run = extendRun(sub.run, el, call, parent, (e) => sub.body.append(e));
return;
}
ctx.run = extendRun(ctx.run, el, call, parent, put);
ctx.run = extendRun(ctx.run, el, call, parent, (e) => put(e, true));
};
const extendRun = (run, el, call, parent, place) => {
if (!run || run.parent !== parent) {
@@ -456,7 +462,7 @@ export function mountChat(root, src, makeHead) {
continue;
}
ctx.run = undefined;
put(el);
put(el, true);
continue;
}
if (ev.kind === "agent.tool_call") {
@@ -501,7 +507,7 @@ export function mountChat(root, src, makeHead) {
ctx.drawn = undefined;
}
if (ev.kind === "user.message" && ev.actor === "byre" && ev.owner && p["mid_turn"] !== true && p["handoff"] !== true) {
ctx.held = el;
ctx.held = document.createDocumentFragment();
ctx.open = false;
ctx.drawn = [];
continue;
+1 -1
View File
File diff suppressed because one or more lines are too long