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() {
2288 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });2288 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
2289 });2289 });
22902290
2291 $(document).on('click', 'body .mes .mes_text', function () {2291 $(document).on('click', 'body .mes .mes_text, body .mes .mes_reasoning', function (event) {
2292 if (!power_user.click_to_edit) return;2292 if (!power_user.click_to_edit) return;
2293 if (window.getSelection().toString()) return;2293 if (window.getSelection().toString()) return;
2294 if ($('.edit_textarea').length) return;2294 if ($('.edit_textarea').length) return;
2295 $(this).closest('.mes').find('.mes_edit').trigger('click');2295 $(this).closest('.mes').find('.mes_edit').trigger('click');
2296 if ($(event.target).closest('.mes_reasoning').length) {
2297 $('.reasoning_edit_textarea').trigger('focus');
2298 }
2296 });2299 });
22972300
2298 $(document).on('click', '.open_media_overrides', openExternalMediaOverridesDialog);2301 $(document).on('click', '.open_media_overrides', openExternalMediaOverridesDialog);