Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/helpers/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ IRichContent.prototype.text;
* @typedef {Object} ConversationSenderActionModel
* @property {string} conversation_id - The conversation id.
* @property {number} sender_action - The sender action.
* @property {string} [indication] - The function indication.
*/

/**
Expand Down
4 changes: 4 additions & 0 deletions src/lib/scss/custom/pages/_chat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@
margin-top: 0px !important;
margin-bottom: 0px !important;
}

.chat-indication {
font-size: 1em;
}
}

.image-wrap {
Expand Down
14 changes: 11 additions & 3 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
let text = "";
let editText = "";
let truncateMsgId = "";
let indication = "";

/** @type {string[]} */
let prevSentMsgs = [];
Expand Down Expand Up @@ -327,8 +328,10 @@
function onSenderActionGenerated(data) {
if (data?.sender_action == SenderAction.TypingOn) {
isThinking = true;
indication = data.indication || '';
} else if (data?.sender_action == SenderAction.TypingOff) {
isThinking = false;
indication = '';
}
}

Expand Down Expand Up @@ -946,9 +949,14 @@
<div class="cicon-wrap float-start">
<img src={PUBLIC_LIVECHAT_ENTRY_ICON} class="rounded-circle avatar-xs" alt="avatar">
</div>
<div class="ctext-wrap float-start" style="display: flex;">
<div class="flex-shrink-0 align-self-center">
<LoadingDots duration={'1s'} size={10} color={'var(--bs-primary)'} />
<div class="msg-container">
<div class="ctext-wrap float-start">
<span class="chat-indication">
{indication}
</span>
<div class="flex-shrink-0 align-self-center" style="display: inline-block;">
<LoadingDots duration={'1s'} size={10} color={'var(--bs-primary)'} />
</div>
</div>
</div>
</div>
Expand Down