Reasoning inline edit improvements + style
| @@ -7306,6 +7306,11 @@ async function messageEditDone(div) { | ||
| 7306 | 7306 | appendMediaToMessage(mes, div.closest('.mes')); |
| 7307 | 7307 | addCopyToCodeBlocks(div.closest('.mes')); |
| 7308 | 7308 | |
| 7309 | + const reasoningEditDone = mesBlock.find('.mes_reasoning_edit_done:visible'); | |
| 7310 | + if (reasoningEditDone.length > 0) { | |
| 7311 | + reasoningEditDone.trigger('click'); | |
| 7312 | + } | |
| 7313 | + | |
| 7309 | 7314 | await eventSource.emit(event_types.MESSAGE_UPDATED, this_edit_mes_id); |
| 7310 | 7315 | this_edit_mes_id = undefined; |
| 7311 | 7316 | await saveChatConditional(); |
| @@ -10813,6 +10818,12 @@ jQuery(async function () { | ||
| 10813 | 10818 | var edit_mes_id = $(this).closest('.mes').attr('mesid'); |
| 10814 | 10819 | this_edit_mes_id = edit_mes_id; |
| 10815 | 10820 | |
| 10821 | + // Also edit reasoning, if it exists | |
| 10822 | + const reasoningEdit = $(this).closest('.mes_block').find('.mes_reasoning_edit:visible'); | |
| 10823 | + if (reasoningEdit.length > 0) { | |
| 10824 | + reasoningEdit.trigger('click'); | |
| 10825 | + } | |
| 10826 | + | |
| 10816 | 10827 | var text = chat[edit_mes_id]['mes']; |
| 10817 | 10828 | if (chat[edit_mes_id]['is_user']) { |
| 10818 | 10829 | this_edit_mes_chname = name1; |
| @@ -10946,6 +10957,11 @@ jQuery(async function () { | ||
| 10946 | 10957 | appendMediaToMessage(chat[this_edit_mes_id], $(this).closest('.mes')); |
| 10947 | 10958 | addCopyToCodeBlocks($(this).closest('.mes')); |
| 10948 | 10959 | |
| 10960 | + const reasoningEditDone = $(this).closest('.mes_block').find('.mes_reasoning_edit_cancel:visible'); | |
| 10961 | + if (reasoningEditDone.length > 0) { | |
| 10962 | + reasoningEditDone.trigger('click'); | |
| 10963 | + } | |
| 10964 | + | |
| 10949 | 10965 | await eventSource.emit(event_types.MESSAGE_UPDATED, this_edit_mes_id); |
| 10950 | 10966 | this_edit_mes_id = undefined; |
| 10951 | 10967 | }); |
| @@ -11400,6 +11416,11 @@ jQuery(async function () { | ||
| 11400 | 11416 | } |
| 11401 | 11417 | }); |
| 11402 | 11418 | |
| 11419 | + $(document).on('click', '.mes_reasoning_summary', function () { | |
| 11420 | + // If you toggle summary header while editing reasoning, yup - we just cancel it | |
| 11421 | + $(this).closest('.mes').find('.mes_reasoning_edit_cancel:visible').trigger('click'); | |
| 11422 | + }); | |
| 11423 | + | |
| 11403 | 11424 | $(document).keyup(function (e) { |
| 11404 | 11425 | if (e.key === 'Escape') { |
| 11405 | 11426 | const isEditVisible = $('#curEditTextarea').is(':visible') || $('.reasoning_edit_textarea').length > 0; |
| @@ -106,6 +106,8 @@ | ||
| 106 | 106 | --tool-cool-color-picker-btn-bg: transparent; |
| 107 | 107 | --tool-cool-color-picker-btn-border-color: transparent; |
| 108 | 108 | |
| 109 | + --mes-right-spacing: 30px; | |
| 110 | + | |
| 109 | 111 | --avatar-base-height: 50px; |
| 110 | 112 | --avatar-base-width: 50px; |
| 111 | 113 | --avatar-base-border-radius: 2px; |
| @@ -345,12 +347,18 @@ input[type='checkbox']:focus-visible { | ||
| 345 | 347 | border-left: 2px solid var(--SmartThemeEmColor); |
| 346 | 348 | border-radius: 2px; |
| 347 | 349 | padding: 5px; |
| 348 | - padding-left: 14px; | |
| 349 | 350 | margin-bottom: 0.5rem; |
| 350 | 351 | overflow-y: auto; |
| 351 | 352 | color: var(--SmartThemeEmColor); |
| 352 | 353 | } |
| 353 | 354 | |
| 355 | +.mes_reasoning_details { | |
| 356 | + margin-right: var(--mes-right-spacing); | |
| 357 | +} | |
| 358 | +.mes_reasoning_details .mes_reasoning_summary { | |
| 359 | + margin-right: calc(var(--mes-right-spacing) * -1); | |
| 360 | +} | |
| 361 | + | |
| 354 | 362 | .mes_reasoning *:last-child { |
| 355 | 363 | margin-bottom: 0; |
| 356 | 364 | } |
| @@ -391,7 +399,6 @@ input[type='checkbox']:focus-visible { | ||
| 391 | 399 | .mes_bias:empty, |
| 392 | 400 | .mes_reasoning:empty, |
| 393 | 401 | .mes_reasoning_details:has(.mes_reasoning:empty), |
| 394 | -.mes_block:has(.edit_textarea) .mes_reasoning_details, | |
| 395 | 402 | .mes_reasoning_details:not([open]) .mes_reasoning_actions, |
| 396 | 403 | .mes_reasoning_details:has(.reasoning_edit_textarea) .mes_reasoning, |
| 397 | 404 | .mes_reasoning_details:not(:has(.reasoning_edit_textarea)) .mes_reasoning_actions .edit_button, |
| @@ -1123,12 +1130,11 @@ body .panelControlBar { | ||
| 1123 | 1130 | } |
| 1124 | 1131 | |
| 1125 | 1132 | .last_mes:has(.mes_text:empty):has(.mes_reasoning_details[open]) .mes_reasoning:not(:empty) { |
| 1126 | 1133 | margin-bottom: 30pxvar(--mes-right-spacing); |
| 1127 | 1134 | } |
| 1128 | 1135 | |
| 1129 | -.last_mes .mes_reasoning, | |
| 1130 | 1136 | .last_mes .mes_text { |
| 1131 | 1137 | padding-right: 30pxvar(--mes-right-spacing); |
| 1132 | 1138 | } |
| 1133 | 1139 | |
| 1134 | 1140 | /* SWIPE RELATED STYLES*/ |