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 | 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 | } |
| 3167 | 3168 | ||
| 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 | } |
| 3172 | 3174 | ||
| 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 | } |
| 3269 | 3271 | ||
| 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}"]`)); |
| 3274 | 3276 | ||
| @@ -3313,7 +3315,7 @@ class StreamingProcessor { | |||
| 3313 | this.abortController.abort(); | 3315 | this.abortController.abort(); |
| 3314 | this.isStopped = true; | 3316 | this.isStopped = true; |
| 3315 | 3317 | ||
| 3316 | this.hideMessageButtons(this.messageId); | 3318 | this.markUIGenStopped(); |
| 3317 | generatedPromptCache = ''; | 3319 | generatedPromptCache = ''; |
| 3318 | unblockGeneration(); | 3320 | unblockGeneration(); |
| 3319 | 3321 | ||
| @@ -4331,6 +4331,11 @@ input[type="range"]::-webkit-slider-thumb { | |||
| 4331 | field-sizing: content; | 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 | #anchor_order { | 4339 | #anchor_order { |
| 4335 | margin-bottom: 15px; | 4340 | margin-bottom: 15px; |
| 4336 | } | 4341 | } |