SimpleChatTCRV:UICleanupPlus: Fix oversights with initial go

This commit is contained in:
hanishkvc 2025-11-16 13:04:43 +05:30
parent 9ddd923412
commit dda9f81d37
1 changed files with 6 additions and 6 deletions

View File

@ -676,10 +676,10 @@ class SimpleChat {
if (lastMsg.ns.role == chatMsg.ns.role) { if (lastMsg.ns.role == chatMsg.ns.role) {
console.debug(`DBUG:SC:AddSmart:Replacing:${lastMsg}:${chatMsg}`) console.debug(`DBUG:SC:AddSmart:Replacing:${lastMsg}:${chatMsg}`)
this.xchat[this.xchat.length-1] = ChatMessageEx.newFrom(chatMsg) this.xchat[this.xchat.length-1] = ChatMessageEx.newFrom(chatMsg)
this.xchat[this.xchat.length-1].uniqId = lastMsg.uniqId
this.save()
return true
} }
this.xchat[this.xchat.length-1].uniqId = lastMsg.uniqId
this.save()
return true
} }
return this.add(chatMsg) return this.add(chatMsg)
} }
@ -1411,11 +1411,11 @@ class MultiChatUI {
// TODO: MAYBE: Call toolcall related ui reset here. // TODO: MAYBE: Call toolcall related ui reset here.
//this.ui_reset_toolcall_as_needed(new ChatMessageEx()); //this.ui_reset_toolcall_as_needed(new ChatMessageEx());
for(let i=lastN; i > 0; i-=1) { for(let i=lastN; i > 0; i-=1) {
let msg = chat.xchat[chat.xchat.length-lastN] let msg = chat.xchat[chat.xchat.length-i]
let nextMsg = chat.xchat[chat.xchat.length-(lastN-1)] let nextMsg = chat.xchat[chat.xchat.length-(i-1)]
if (msg) { if (msg) {
this.chatmsg_ui_remove(msg.uniqId) this.chatmsg_ui_remove(msg.uniqId)
this.show_message(this.elDivChat, msg, (lastN-1), nextMsg) this.show_message(this.elDivChat, msg, (i-1), nextMsg)
} }
} }
if (this.elLastChatMessage != null) { if (this.elLastChatMessage != null) {