fix(ui): prevent empty chat bubbles when message content is empty
This commit is contained in:
parent
68bb516ec2
commit
785187868e
2 changed files with 32 additions and 45 deletions
|
|
@ -1198,8 +1198,10 @@
|
|||
streamingMessageId = null;
|
||||
currentStreamingContent = "";
|
||||
} else {
|
||||
if (r.content && r.content.trim() !== "") {
|
||||
addMessage("assistant", r.content, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isStreaming) {
|
||||
isStreaming = true;
|
||||
|
|
|
|||
|
|
@ -14,34 +14,21 @@
|
|||
<div class="suggestions-container" id="suggestions"></div>
|
||||
<div class="mention-dropdown" id="mentionDropdown">
|
||||
<div class="mention-header">
|
||||
<span class="mention-title" data-i18n="chat-mention-title"
|
||||
>Reference Entity</span
|
||||
>
|
||||
<span class="mention-title" data-i18n="chat-mention-title">Reference Entity</span>
|
||||
</div>
|
||||
<div class="mention-results" id="mentionResults"></div>
|
||||
</div>
|
||||
<form class="input-container" id="chatForm">
|
||||
<input
|
||||
name="content"
|
||||
id="messageInput"
|
||||
type="text"
|
||||
placeholder="Message... (type @ to mention)"
|
||||
data-i18n-placeholder="chat-placeholder"
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
id="sendBtn"
|
||||
title="Send"
|
||||
data-i18n-title="chat-send"
|
||||
>
|
||||
<input name="content" id="messageInput" type="text" placeholder="Message... (type @ to mention)"
|
||||
data-i18n-placeholder="chat-placeholder" autofocus autocomplete="off" />
|
||||
<button type="submit" id="sendBtn" title="Send" data-i18n-title="chat-send">
|
||||
↑
|
||||
</button>
|
||||
</form>
|
||||
</footer>
|
||||
<button class="scroll-to-bottom" id="scrollToBottom" title="Scroll to bottom">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
|
|
@ -55,11 +42,7 @@
|
|||
<div class="entity-card-title"></div>
|
||||
<div class="entity-card-details"></div>
|
||||
<div class="entity-card-actions">
|
||||
<button
|
||||
class="entity-card-btn"
|
||||
data-action="view"
|
||||
data-i18n="action-view"
|
||||
>
|
||||
<button class="entity-card-btn" data-action="view" data-i18n="action-view">
|
||||
View
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -737,8 +720,10 @@
|
|||
if (isStreaming) {
|
||||
finalizeStreaming();
|
||||
} else {
|
||||
if (data.content && data.content.trim() !== "") {
|
||||
addMessage("bot", data.content);
|
||||
}
|
||||
}
|
||||
isStreaming = false;
|
||||
|
||||
// Render suggestions when message is complete
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue