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.
This commit is contained in:
parent
c93c14ece9
commit
f0031eac11
2 changed files with 4 additions and 0 deletions
|
|
@ -4018,10 +4018,12 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||||
bodyEl.innerHTML = '';
|
bodyEl.innerHTML = '';
|
||||||
bodyEl.appendChild(editor);
|
bodyEl.appendChild(editor);
|
||||||
bodyEl.appendChild(btnRow);
|
bodyEl.appendChild(btnRow);
|
||||||
|
userMsgElement.classList.add('editing');
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|
||||||
cancelBtn.addEventListener('click', (e) => {
|
cancelBtn.addEventListener('click', (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
userMsgElement.classList.remove('editing');
|
||||||
bodyEl.innerHTML = originalHTML;
|
bodyEl.innerHTML = originalHTML;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -4054,6 +4056,7 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Edit failed:', err);
|
console.error('Edit failed:', err);
|
||||||
if (uiModule) uiModule.showError('Edit failed: ' + err.message);
|
if (uiModule) uiModule.showError('Edit failed: ' + err.message);
|
||||||
|
userMsgElement.classList.remove('editing');
|
||||||
bodyEl.innerHTML = originalHTML;
|
bodyEl.innerHTML = originalHTML;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3887,6 +3887,7 @@ body.bg-pattern-sparkles {
|
||||||
min-height:80px;
|
min-height:80px;
|
||||||
}
|
}
|
||||||
.edit-textarea:focus { border-color:var(--red); }
|
.edit-textarea:focus { border-color:var(--red); }
|
||||||
|
.msg-user.editing { width: 85% !important; }
|
||||||
.edit-save-btn, .edit-cancel-btn {
|
.edit-save-btn, .edit-cancel-btn {
|
||||||
background:var(--bg); color:var(--fg);
|
background:var(--bg); color:var(--fg);
|
||||||
border:1px solid var(--border); border-radius:6px;
|
border:1px solid var(--border); border-radius:6px;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue