Add data attribute during generation - Fix reasoning buttons still appearing - Allow easier customization of HTML elements via CSS that appear during gen

58b8e7908d3e26128f813a7a38ed7caec68f4792

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +14 -7Ignore whitespace
public/script.js+9 -7
@@ -3160,14 +3160,16 @@ class StreamingProcessor {
3160 }3160 }
3161 }3161 }
31623162
3163 showMessageButtons(messageId) {3163 markUIGenStarted() {
3164 showStopButton();3164 showStopButton();
3165 $(`#chat .mes[mesid="${messageId}"] .mes_buttons`).css({ 'display': 'none' });3165 const chatElement = document.getElementById('chat');
3166 chatElement.dataset.generating = 'true';
3166 }3167 }
31673168
3168 hideMessageButtons(messageId) {3169 markUIGenStopped() {
3169 hideStopButton();3170 hideStopButton();
3170 $(`#chat .mes[mesid="${messageId}"] .mes_buttons`).css({ 'display': 'flex' });3171 const chatElement = document.getElementById('chat');
3172 delete chatElement.dataset.generating;
3171 }3173 }
31723174
3173 async onStartStreaming(text) {3175 async onStartStreaming(text) {
@@ -3180,7 +3182,7 @@ class StreamingProcessor {
3180 await saveReply(this.type, text, true, '', [], '');3182 await saveReply(this.type, text, true, '', [], '');
3181 messageId = chat.length - 1;3183 messageId = chat.length - 1;
3182 this.#checkDomElements(messageId);3184 this.#checkDomElements(messageId);
3183 this.showMessageButtons(messageId);3185 this.markUIGenStarted();
3184 }3186 }
3185 hideSwipeButtons();3187 hideSwipeButtons();
3186 scrollChatToBottom();3188 scrollChatToBottom();
@@ -3268,7 +3270,7 @@ class StreamingProcessor {
3268 }3270 }
32693271
3270 async onFinishStreaming(messageId, text) {3272 async onFinishStreaming(messageId, text) {
3271 this.hideMessageButtons(this.messageId);3273 this.markUIGenStopped();
3272 await this.onProgressStreaming(messageId, text, true);3274 await this.onProgressStreaming(messageId, text, true);
3273 addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`));3275 addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`));
32743276
@@ -3313,7 +3315,7 @@ class StreamingProcessor {
3313 this.abortController.abort();3315 this.abortController.abort();
3314 this.isStopped = true;3316 this.isStopped = true;
33153317
3316 this.hideMessageButtons(this.messageId);3318 this.markUIGenStopped();
3317 generatedPromptCache = '';3319 generatedPromptCache = '';
3318 unblockGeneration();3320 unblockGeneration();
33193321
public/style.css+5 -0
@@ -4331,6 +4331,11 @@ input[type="range"]::-webkit-slider-thumb {
4331 field-sizing: content;4331 field-sizing: content;
4332}4332}
43334333
4334#chat[data-generating="true"] .last_mes .mes_buttons,
4335#chat[data-generating="true"] .last_mes .mes_reasoning_actions {
4336 display: none;
4337}
4338
4334#anchor_order {4339#anchor_order {
4335 margin-bottom: 15px;4340 margin-bottom: 15px;
4336}4341}