From f0031eac118949888c14540182e2691568925291 Mon Sep 17 00:00:00 2001 From: Lukas Parsons Date: Tue, 7 Jul 2026 12:53:03 -0400 Subject: [PATCH] fix: edit-message textarea now fills full message width .msg-user has width:fit-content which collapses when body content is replaced by a textarea. Added .msg-user.editing CSS rule with width:85% !important, and JS adds/removes 'editing' class during edit flow. --- static/js/chat.js | 3 +++ static/style.css | 1 + 2 files changed, 4 insertions(+) diff --git a/static/js/chat.js b/static/js/chat.js index 6bca955b..ec6222e3 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -4018,10 +4018,12 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer bodyEl.innerHTML = ''; bodyEl.appendChild(editor); bodyEl.appendChild(btnRow); + userMsgElement.classList.add('editing'); editor.focus(); cancelBtn.addEventListener('click', (e) => { e.stopPropagation(); + userMsgElement.classList.remove('editing'); bodyEl.innerHTML = originalHTML; }); @@ -4054,6 +4056,7 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer } catch (err) { console.error('Edit failed:', err); if (uiModule) uiModule.showError('Edit failed: ' + err.message); + userMsgElement.classList.remove('editing'); bodyEl.innerHTML = originalHTML; } }); diff --git a/static/style.css b/static/style.css index b0b6d622..f38f2348 100644 --- a/static/style.css +++ b/static/style.css @@ -3887,6 +3887,7 @@ body.bg-pattern-sparkles { min-height:80px; } .edit-textarea:focus { border-color:var(--red); } + .msg-user.editing { width: 85% !important; } .edit-save-btn, .edit-cancel-btn { background:var(--bg); color:var(--fg); border:1px solid var(--border); border-radius:6px;