Add data attribute during generation - Fix reasoning buttons still appearing - Allow easier customization of HTML elements via CSS that appear during gen
| @@ -3160,14 +3160,16 @@ class StreamingProcessor { | ||
| 3160 | 3160 | } |
| 3161 | 3161 | } |
| 3162 | 3162 | |
| 3163 | 3163 | showMessageButtonsmarkUIGenStarted(messageId) { |
| 3164 | 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 | } |
| 3167 | 3168 | |
| 3168 | 3169 | hideMessageButtonsmarkUIGenStopped(messageId) { |
| 3169 | 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 | } |
| 3172 | 3174 | |
| 3173 | 3175 | async onStartStreaming(text) { |
| @@ -3180,7 +3182,7 @@ class StreamingProcessor { | ||
| 3180 | 3182 | await saveReply(this.type, text, true, '', [], ''); |
| 3181 | 3183 | messageId = chat.length - 1; |
| 3182 | 3184 | this.#checkDomElements(messageId); |
| 3183 | 3185 | this.showMessageButtonsmarkUIGenStarted(messageId); |
| 3184 | 3186 | } |
| 3185 | 3187 | hideSwipeButtons(); |
| 3186 | 3188 | scrollChatToBottom(); |
| @@ -3268,7 +3270,7 @@ class StreamingProcessor { | ||
| 3268 | 3270 | } |
| 3269 | 3271 | |
| 3270 | 3272 | async onFinishStreaming(messageId, text) { |
| 3271 | 3273 | this.hideMessageButtonsmarkUIGenStopped(this.messageId); |
| 3272 | 3274 | await this.onProgressStreaming(messageId, text, true); |
| 3273 | 3275 | addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`)); |
| 3274 | 3276 | |
| @@ -3313,7 +3315,7 @@ class StreamingProcessor { | ||
| 3313 | 3315 | this.abortController.abort(); |
| 3314 | 3316 | this.isStopped = true; |
| 3315 | 3317 | |
| 3316 | 3318 | this.hideMessageButtonsmarkUIGenStopped(this.messageId); |
| 3317 | 3319 | generatedPromptCache = ''; |
| 3318 | 3320 | unblockGeneration(); |
| 3319 | 3321 | |
| @@ -4331,6 +4331,11 @@ input[type="range"]::-webkit-slider-thumb { | ||
| 4331 | 4331 | field-sizing: content; |
| 4332 | 4332 | } |
| 4333 | 4333 | |
| 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 | 4339 | #anchor_order { |
| 4335 | 4340 | margin-bottom: 15px; |
| 4336 | 4341 | } |