mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move typing indicator to an extension
https://github.com/SillyTavern/Extension-TypingIndicator
This commit is contained in:
@ -4830,6 +4830,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="extensions_settings" class="flex1 wide50p">
|
<div id="extensions_settings" class="flex1 wide50p">
|
||||||
<div id="assets_container" class="extension_container"></div>
|
<div id="assets_container" class="extension_container"></div>
|
||||||
|
<div id="typing_indicator_container" class="extension_container"></div>
|
||||||
<div id="expressions_container" class="extension_container"></div>
|
<div id="expressions_container" class="extension_container"></div>
|
||||||
<div id="sd_container" class="extension_container"></div>
|
<div id="sd_container" class="extension_container"></div>
|
||||||
<div id="tts_container" class="extension_container"></div>
|
<div id="tts_container" class="extension_container"></div>
|
||||||
@ -6473,9 +6474,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- chat and input bar -->
|
<!-- chat and input bar -->
|
||||||
<div id="typing_indicator_template" class="template_element">
|
|
||||||
<div class="typing_indicator"><span class="typing_indicator_name">CHAR</span> is typing</div>
|
|
||||||
</div>
|
|
||||||
<div id="message_file_template" class="template_element">
|
<div id="message_file_template" class="template_element">
|
||||||
<div class="mes_file_container">
|
<div class="mes_file_container">
|
||||||
<div class="fa-lg fa-solid fa-file-alt mes_file_icon"></div>
|
<div class="fa-lg fa-solid fa-file-alt mes_file_icon"></div>
|
||||||
|
@ -8738,11 +8738,6 @@ const swipe_right = () => {
|
|||||||
easing: animation_easing,
|
easing: animation_easing,
|
||||||
queue: false,
|
queue: false,
|
||||||
complete: async function () {
|
complete: async function () {
|
||||||
/*if (!selected_group) {
|
|
||||||
var typingIndicator = $("#typing_indicator_template .typing_indicator").clone();
|
|
||||||
typingIndicator.find(".typing_indicator_name").text(characters[this_chid].name);
|
|
||||||
} */
|
|
||||||
/* $("#chat").append(typingIndicator); */
|
|
||||||
const is_animation_scroll = ($('#chat').scrollTop() >= ($('#chat').prop('scrollHeight') - $('#chat').outerHeight()) - 10);
|
const is_animation_scroll = ($('#chat').scrollTop() >= ($('#chat').prop('scrollHeight') - $('#chat').outerHeight()) - 10);
|
||||||
//console.log(parseInt(chat[chat.length-1]['swipe_id']));
|
//console.log(parseInt(chat[chat.length-1]['swipe_id']));
|
||||||
//console.log(chat[chat.length-1]['swipes'].length);
|
//console.log(chat[chat.length-1]['swipes'].length);
|
||||||
|
@ -818,7 +818,6 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
|
|
||||||
/** @type {any} Caution: JS war crimes ahead */
|
/** @type {any} Caution: JS war crimes ahead */
|
||||||
let textResult = '';
|
let textResult = '';
|
||||||
let typingIndicator = $('#chat .typing_indicator');
|
|
||||||
const group = groups.find((x) => x.id === selected_group);
|
const group = groups.find((x) => x.id === selected_group);
|
||||||
|
|
||||||
if (!group || !Array.isArray(group.members) || !group.members.length) {
|
if (!group || !Array.isArray(group.members) || !group.members.length) {
|
||||||
@ -834,14 +833,6 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
setCharacterId(undefined);
|
setCharacterId(undefined);
|
||||||
const userInput = String($('#send_textarea').val());
|
const userInput = String($('#send_textarea').val());
|
||||||
|
|
||||||
if (typingIndicator.length === 0 && !isStreamingEnabled()) {
|
|
||||||
typingIndicator = $(
|
|
||||||
'#typing_indicator_template .typing_indicator',
|
|
||||||
).clone();
|
|
||||||
typingIndicator.hide();
|
|
||||||
$('#chat').append(typingIndicator);
|
|
||||||
}
|
|
||||||
|
|
||||||
// id of this specific batch for regeneration purposes
|
// id of this specific batch for regeneration purposes
|
||||||
group_generation_id = Date.now();
|
group_generation_id = Date.now();
|
||||||
const lastMessage = chat[chat.length - 1];
|
const lastMessage = chat[chat.length - 1];
|
||||||
@ -919,14 +910,6 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
}
|
}
|
||||||
await eventSource.emit(event_types.GROUP_MEMBER_DRAFTED, chId);
|
await eventSource.emit(event_types.GROUP_MEMBER_DRAFTED, chId);
|
||||||
|
|
||||||
if (type !== 'swipe' && type !== 'impersonate' && !isStreamingEnabled()) {
|
|
||||||
// update indicator and scroll down
|
|
||||||
typingIndicator
|
|
||||||
.find('.typing_indicator_name')
|
|
||||||
.text(characters[chId].name);
|
|
||||||
typingIndicator.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait for generation to finish
|
// Wait for generation to finish
|
||||||
textResult = await Generate(generateType, { automatic_trigger: by_auto_mode, ...(params || {}) });
|
textResult = await Generate(generateType, { automatic_trigger: by_auto_mode, ...(params || {}) });
|
||||||
let messageChunk = textResult?.messageChunk;
|
let messageChunk = textResult?.messageChunk;
|
||||||
@ -943,8 +926,6 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
typingIndicator.hide();
|
|
||||||
|
|
||||||
is_group_generating = false;
|
is_group_generating = false;
|
||||||
setSendButtonState(false);
|
setSendButtonState(false);
|
||||||
setCharacterId(undefined);
|
setCharacterId(undefined);
|
||||||
|
@ -4602,23 +4602,6 @@ body .ui-widget-content li:hover {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.typing_indicator {
|
|
||||||
position: sticky;
|
|
||||||
bottom: 10px;
|
|
||||||
margin: 10px;
|
|
||||||
opacity: 0.85;
|
|
||||||
text-shadow: 0px 0px calc(var(--shadowWidth) * 1px) var(--SmartThemeShadowColor);
|
|
||||||
order: 9999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.typing_indicator:after {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: bottom;
|
|
||||||
animation: ellipsis steps(4, end) 1500ms infinite;
|
|
||||||
content: "";
|
|
||||||
width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#group_avatar_preview .missing-avatar {
|
#group_avatar_preview .missing-avatar {
|
||||||
display: inline;
|
display: inline;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
Reference in New Issue
Block a user