SimpleChatTC:Show: Cleanup

Update existing flow so that next Tool Role message is handled
directly from within
This commit is contained in:
hanishkvc 2025-10-28 17:05:58 +05:30
parent aa17edfa78
commit 62bce9ebfb
1 changed files with 8 additions and 8 deletions

View File

@ -493,16 +493,16 @@ class SimpleChat {
div.replaceChildren(); div.replaceChildren();
} }
let last = undefined; let last = undefined;
for(const x of this.recent_chat(gMe.chatProps.iRecentUserMsgCnt)) { for(const [i, x] of this.recent_chat(gMe.chatProps.iRecentUserMsgCnt).entries()) {
if (x.ns.role != Roles.ToolTemp) { if (x.ns.role === Roles.ToolTemp) {
if (i == (this.xchat.length - 1)) {
elInUser.value = x.ns.content;
}
continue
}
let entry = ui.el_create_append_p(`${x.ns.role}: ${x.content_equiv()}`, div); let entry = ui.el_create_append_p(`${x.ns.role}: ${x.content_equiv()}`, div);
entry.className = `role-${x.ns.role}`; entry.className = `role-${x.ns.role}`;
last = entry; last = entry;
} else {
if (elInUser) {
elInUser.value = x.ns.content;
}
}
} }
if (last !== undefined) { if (last !== undefined) {
last.scrollIntoView(false); last.scrollIntoView(false);