Hi,
I've followed your AI integration example but I noticied that when I use the updateMessage method for some reason the chat scroll move toward the start of the message. Maybe I'm wrong but looking at the source code I think that the problem is the chat-widget.js inside this method
_refreshStandardSync(message, isOwnMessage, wasNearBottom) {
if (!message) {
return;
}
this.renderMessage(message);
if (isOwnMessage) {
this.scrollToBottom();
}
else if (wasNearBottom && message.uid) {
this.view.scrollIncomingMessage(message.uid);
}
}$("#copilotChat").kendoChat({
authorId: "user",
height: "100%",
messageBox: {
mode: "auto"
},
fileAttachment: false,
speechToText: false,
messageWidthMode: "full",
skipSanitization: true,
sendMessage: function (e) {
if (e.generating) {
//cancelling request, code omitted
}
else {
//new request, code omitted
}
}
});
//receive message via SSE (code omitted)
const chat = $("#copilotChat").data("kendoChat");
let messageObject = chat.dataSource.get(params.runId);
dashboardProposal.currentCopilotChatText += params.content;
if (messageObject) {
const markdown = markdownInstance.parse(dashboardProposal.currentCopilotChatText);
chat.updateMessage(messageObject, { text: markdown });
}
else {
chat.postMessage({
authorId: "assistant",
authorName: app.i18n("advice_dashboardProposal_authorNameCopilot"),
text: params.content,
id: params.runId
});
}