feat: add click-to-edit support for reasoning blocks and auto-focus reasoning textarea (#5487) Extend click-to-edit functionality to reasoning blocks in addition to message text. When clicking on a reasoning block, automatically focus the reasoning textarea after entering edit mode.

15a3e3f0727a98d19bc144fcf04501a3178218b0

Wolfsblvt <wolfsblvt@gmail.com>

Signed
1 files changed, +4 -1Ignore whitespace
public/scripts/chats.js+4 -1
@@ -2288,11 +2288,14 @@ export function initChatUtilities() {
22882288 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
22892289 });
22902290
22912291 $(document).on('click', 'body .mes .mes_text, body .mes .mes_reasoning', function (event) {
22922292 if (!power_user.click_to_edit) return;
22932293 if (window.getSelection().toString()) return;
22942294 if ($('.edit_textarea').length) return;
22952295 $(this).closest('.mes').find('.mes_edit').trigger('click');
2296+ if ($(event.target).closest('.mes_reasoning').length) {
2297+ $('.reasoning_edit_textarea').trigger('focus');
2298+ }
22962299 });
22972300
22982301 $(document).on('click', '.open_media_overrides', openExternalMediaOverridesDialog);