UI: исправить автообновление и хронологию диалогов; обновить деплой-цели

This commit is contained in:
AidarKC
2026-04-23 18:04:14 +03:00
parent f213e9aa43
commit 93aef6e18b
7 changed files with 457 additions and 35 deletions
+15 -3
View File
@@ -68,6 +68,17 @@ function resolveDeliveryStatus(msg) {
return '…';
}
function scrollToLatestMessage(list) {
if (!list) return;
const apply = () => {
list.scrollTop = list.scrollHeight;
};
apply();
window.requestAnimationFrame(apply);
window.setTimeout(apply, 0);
window.setTimeout(apply, 120);
}
function renderLog(list, chatId) {
list.innerHTML = '';
const messages = getChatMessages(chatId);
@@ -110,7 +121,7 @@ function renderLog(list, chatId) {
bubble.append(textNode, metaNode);
list.append(bubble);
});
list.scrollTop = list.scrollHeight;
scrollToLatestMessage(list);
markChatRead(chatId);
}
@@ -240,10 +251,11 @@ export function render({ navigate, route }) {
}
});
renderLog(log, chatId);
void sendReadReceiptsForVisible(chatId);
wrap.append(log, form);
screen.append(wrap);
renderLog(log, chatId);
window.requestAnimationFrame(() => scrollToLatestMessage(log));
void sendReadReceiptsForVisible(chatId);
return screen;
}
async function sendReadReceiptsForVisible(chatId) {