Switched even more to "generating" CSS
| @@ -3161,15 +3161,11 @@ class StreamingProcessor { | |||
| 3161 | } | 3161 | } |
| 3162 | 3162 | ||
| 3163 | markUIGenStarted() { | 3163 | markUIGenStarted() { |
| 3164 | showStopButton(); | 3164 | deactivateSendButtons(); |
| 3165 | const chatElement = document.getElementById('chat'); | ||
| 3166 | chatElement.dataset.generating = 'true'; | ||
| 3167 | } | 3165 | } |
| 3168 | 3166 | ||
| 3169 | markUIGenStopped() { | 3167 | markUIGenStopped() { |
| 3170 | hideStopButton(); | 3168 | activateSendButtons(); |
| 3171 | const chatElement = document.getElementById('chat'); | ||
| 3172 | delete chatElement.dataset.generating; | ||
| 3173 | } | 3169 | } |
| 3174 | 3170 | ||
| 3175 | async onStartStreaming(text) { | 3171 | async onStartStreaming(text) { |
| @@ -6133,20 +6129,21 @@ function extractImageFromMessage(getMessage) { | |||
| 6133 | return { getMessage, image, title }; | 6129 | return { getMessage, image, title }; |
| 6134 | } | 6130 | } |
| 6135 | 6131 | ||
| 6132 | /** | ||
| 6133 | * A function mainly used to switch 'generating' state - setting it to false and activating the buttons again | ||
| 6134 | */ | ||
| 6136 | export function activateSendButtons() { | 6135 | export function activateSendButtons() { |
| 6137 | is_send_press = false; | 6136 | is_send_press = false; |
| 6138 | $('#send_but').removeClass('displayNone'); | ||
| 6139 | $('#mes_continue').removeClass('displayNone'); | ||
| 6140 | $('#mes_impersonate').removeClass('displayNone'); | ||
| 6141 | $('.mes_buttons:last').show(); | ||
| 6142 | hideStopButton(); | 6137 | hideStopButton(); |
| 6138 | delete document.body.dataset.generating; | ||
| 6143 | } | 6139 | } |
| 6144 | 6140 | ||
| 6141 | /** | ||
| 6142 | * A function mainly used to switch 'generating' state - setting it to true and deactivating the buttons | ||
| 6143 | */ | ||
| 6145 | export function deactivateSendButtons() { | 6144 | export function deactivateSendButtons() { |
| 6146 | $('#send_but').addClass('displayNone'); | ||
| 6147 | $('#mes_continue').addClass('displayNone'); | ||
| 6148 | $('#mes_impersonate').addClass('displayNone'); | ||
| 6149 | showStopButton(); | 6145 | showStopButton(); |
| 6146 | document.body.dataset.generating = 'true'; | ||
| 6150 | } | 6147 | } |
| 6151 | 6148 | ||
| 6152 | export function resetChatState() { | 6149 | export function resetChatState() { |
| @@ -8786,7 +8783,6 @@ const swipe_right = () => { | |||
| 8786 | if (run_generate && !is_send_press && parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) { | 8783 | if (run_generate && !is_send_press && parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) { |
| 8787 | console.debug('caught here 2'); | 8784 | console.debug('caught here 2'); |
| 8788 | is_send_press = true; | 8785 | is_send_press = true; |
| 8789 | $('.mes_buttons:last').hide(); | ||
| 8790 | await Generate('swipe'); | 8786 | await Generate('swipe'); |
| 8791 | } else { | 8787 | } else { |
| 8792 | if (parseInt(chat[chat.length - 1]['swipe_id']) !== chat[chat.length - 1]['swipes'].length) { | 8788 | if (parseInt(chat[chat.length - 1]['swipe_id']) !== chat[chat.length - 1]['swipes'].length) { |
| @@ -434,7 +434,7 @@ input[type='checkbox']:focus-visible { | |||
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | /** Show "Thinking..." during generation, even if the reasoning is hidden by default */ | 436 | /** Show "Thinking..." during generation, even if the reasoning is hidden by default */ |
| 437 | #chat[data-generating="true"] .mes.reasoning[data-reasoning-state="hidden"] .mes_reasoning_details { | 437 | body[data-generating="true"] .last_mes.reasoning[data-reasoning-state="hidden"] .mes_reasoning_details { |
| 438 | display: block; | 438 | display: block; |
| 439 | } | 439 | } |
| 440 | 440 | ||
| @@ -4336,8 +4336,11 @@ input[type="range"]::-webkit-slider-thumb { | |||
| 4336 | field-sizing: content; | 4336 | field-sizing: content; |
| 4337 | } | 4337 | } |
| 4338 | 4338 | ||
| 4339 | #chat[data-generating="true"] .last_mes .mes_buttons, | 4339 | body[data-generating="true"] #send_but, |
| 4340 | #chat[data-generating="true"] .last_mes .mes_reasoning_actions { | 4340 | body[data-generating="true"] #mes_continue, |
| 4341 | body[data-generating="true"] #mes_impersonate, | ||
| 4342 | body[data-generating="true"] #chat .last_mes .mes_buttons, | ||
| 4343 | body[data-generating="true"] #chat .last_mes .mes_reasoning_actions { | ||
| 4341 | display: none; | 4344 | display: none; |
| 4342 | } | 4345 | } |
| 4343 | 4346 | ||