From 15a3e3f0727a98d19bc144fcf04501a3178218b0 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Mon, 20 Apr 2026 01:11:42 +0200 Subject: [PATCH] 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. --- public/scripts/chats.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/chats.js b/public/scripts/chats.js index fff15a63f..9105f3f8b 100644 --- a/public/scripts/chats.js +++ b/public/scripts/chats.js @@ -2288,11 +2288,14 @@ export function initChatUtilities() { await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true }); }); - $(document).on('click', 'body .mes .mes_text', function () { + $(document).on('click', 'body .mes .mes_text, body .mes .mes_reasoning', function (event) { if (!power_user.click_to_edit) return; if (window.getSelection().toString()) return; if ($('.edit_textarea').length) return; $(this).closest('.mes').find('.mes_edit').trigger('click'); + if ($(event.target).closest('.mes_reasoning').length) { + $('.reasoning_edit_textarea').trigger('focus'); + } }); $(document).on('click', '.open_media_overrides', openExternalMediaOverridesDialog);