mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add data attribute during generation
- Fix reasoning buttons still appearing - Allow easier customization of HTML elements via CSS that appear during gen
This commit is contained in:
@ -3160,14 +3160,16 @@ class StreamingProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showMessageButtons(messageId) {
|
markUIGenStarted() {
|
||||||
showStopButton();
|
showStopButton();
|
||||||
$(`#chat .mes[mesid="${messageId}"] .mes_buttons`).css({ 'display': 'none' });
|
const chatElement = document.getElementById('chat');
|
||||||
|
chatElement.dataset.generating = 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
hideMessageButtons(messageId) {
|
markUIGenStopped() {
|
||||||
hideStopButton();
|
hideStopButton();
|
||||||
$(`#chat .mes[mesid="${messageId}"] .mes_buttons`).css({ 'display': 'flex' });
|
const chatElement = document.getElementById('chat');
|
||||||
|
delete chatElement.dataset.generating;
|
||||||
}
|
}
|
||||||
|
|
||||||
async onStartStreaming(text) {
|
async onStartStreaming(text) {
|
||||||
@ -3180,7 +3182,7 @@ class StreamingProcessor {
|
|||||||
await saveReply(this.type, text, true, '', [], '');
|
await saveReply(this.type, text, true, '', [], '');
|
||||||
messageId = chat.length - 1;
|
messageId = chat.length - 1;
|
||||||
this.#checkDomElements(messageId);
|
this.#checkDomElements(messageId);
|
||||||
this.showMessageButtons(messageId);
|
this.markUIGenStarted();
|
||||||
}
|
}
|
||||||
hideSwipeButtons();
|
hideSwipeButtons();
|
||||||
scrollChatToBottom();
|
scrollChatToBottom();
|
||||||
@ -3268,7 +3270,7 @@ class StreamingProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onFinishStreaming(messageId, text) {
|
async onFinishStreaming(messageId, text) {
|
||||||
this.hideMessageButtons(this.messageId);
|
this.markUIGenStopped();
|
||||||
await this.onProgressStreaming(messageId, text, true);
|
await this.onProgressStreaming(messageId, text, true);
|
||||||
addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`));
|
addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`));
|
||||||
|
|
||||||
@ -3313,7 +3315,7 @@ class StreamingProcessor {
|
|||||||
this.abortController.abort();
|
this.abortController.abort();
|
||||||
this.isStopped = true;
|
this.isStopped = true;
|
||||||
|
|
||||||
this.hideMessageButtons(this.messageId);
|
this.markUIGenStopped();
|
||||||
generatedPromptCache = '';
|
generatedPromptCache = '';
|
||||||
unblockGeneration();
|
unblockGeneration();
|
||||||
|
|
||||||
|
@ -4331,6 +4331,11 @@ input[type="range"]::-webkit-slider-thumb {
|
|||||||
field-sizing: content;
|
field-sizing: content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chat[data-generating="true"] .last_mes .mes_buttons,
|
||||||
|
#chat[data-generating="true"] .last_mes .mes_reasoning_actions {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#anchor_order {
|
#anchor_order {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user