feat:输入框居中展示

- 点击历史记录和发起对话之后回到底部
This commit is contained in:
Roe-xin
2026-01-05 15:18:03 +08:00
parent de3e84aa4e
commit 27e3351b55
2 changed files with 74 additions and 1 deletions

View File

@ -662,6 +662,10 @@ export function getWebviewContent(
if (messagesContainer) {
messagesContainer.innerHTML = '';
}
// 重置输入框布局到居中
if (typeof window.resetInputAreaLayout === 'function') {
window.resetInputAreaLayout();
}
break;
case 'addUserMessage':
@ -669,6 +673,10 @@ export function getWebviewContent(
if (message.text) {
addMessage(message.text, 'user');
}
// 检查并更新输入框布局
if (typeof window.checkMessagesAndUpdateLayout === 'function') {
window.checkMessagesAndUpdateLayout();
}
break;
case 'addAiMessage':
@ -676,6 +684,10 @@ export function getWebviewContent(
if (message.text) {
addMessage(message.text, 'bot');
}
// 检查并更新输入框布局
if (typeof window.checkMessagesAndUpdateLayout === 'function') {
window.checkMessagesAndUpdateLayout();
}
break;
case 'switchMode':