Smooth scrolling begone

This commit is contained in:
SillyLossy
2023-04-12 23:51:58 +03:00
parent 888a1037cd
commit 99a8afc2c8
2 changed files with 5 additions and 4 deletions

View File

@ -1139,10 +1139,12 @@ function isStreamingEnabled() {
class StreamingProcessor { class StreamingProcessor {
showStopButton(messageId) { showStopButton(messageId) {
$(`#chat .mes[mesid="${messageId}"] .mes_stop`).css({'display': 'block'}); $(`#chat .mes[mesid="${messageId}"] .mes_stop`).css({'display': 'block'});
$(`#chat .mes[mesid="${messageId}"] .mes_edit`).css({'display': 'none'});
} }
hideStopButton(messageId) { hideStopButton(messageId) {
$(`#chat .mes[mesid="${messageId}"] .mes_stop`).css({'display': 'none'}); $(`#chat .mes[mesid="${messageId}"] .mes_stop`).css({'display': 'none'});
$(`#chat .mes[mesid="${messageId}"] .mes_edit`).css({'display': 'block'});
} }
onStartStreaming(text) { onStartStreaming(text) {
@ -1150,6 +1152,7 @@ class StreamingProcessor {
const messageId = count_view_mes - 1; const messageId = count_view_mes - 1;
hideSwipeButtons(); hideSwipeButtons();
this.showStopButton(messageId); this.showStopButton(messageId);
scrollChatToBottom();
return messageId; return messageId;
} }
@ -1167,8 +1170,7 @@ class StreamingProcessor {
let formattedText = messageFormating(processedText, chat[messageId].name, chat[messageId].is_system, chat[messageId].force_avatar); let formattedText = messageFormating(processedText, chat[messageId].name, chat[messageId].is_system, chat[messageId].force_avatar);
const mesText = $(`#chat .mes[mesid="${messageId}"] .mes_text`); const mesText = $(`#chat .mes[mesid="${messageId}"] .mes_text`);
mesText.empty(); mesText.html(formattedText);
mesText.append(formattedText);
scrollChatToBottom(); scrollChatToBottom();
} }
@ -1215,6 +1217,7 @@ class StreamingProcessor {
async generate() { async generate() {
if (this.messageId == -1) { if (this.messageId == -1) {
this.messageId = this.onStartStreaming('...'); this.messageId = this.onStartStreaming('...');
await delay(1); // delay for message to be rendered
} }
// for multigen // for multigen

View File

@ -63,12 +63,10 @@
box-sizing: border-box; box-sizing: border-box;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
scroll-behavior: smooth;
text-shadow: 0 0 3px black; text-shadow: 0 0 3px black;
} }
html { html {
scroll-behavior: smooth;
/*fix for chrome flickering on blurred divs*/ /*fix for chrome flickering on blurred divs*/
-webkit-transform: translateZ(0); -webkit-transform: translateZ(0);
-webkit-backface-visibility: hidden; -webkit-backface-visibility: hidden;