Исправить edit/delete сообщений, упростить вкладки каналов и улучшить автоскролл DM

This commit is contained in:
AidarKC
2026-05-19 21:00:29 +03:00
parent 7986184111
commit f3262c2d64
18 changed files with 845 additions and 104 deletions
+7
View File
@@ -172,8 +172,11 @@ function scrollToLatestMessage(list) {
};
apply();
window.requestAnimationFrame(apply);
window.requestAnimationFrame(() => window.requestAnimationFrame(apply));
window.setTimeout(apply, 0);
window.setTimeout(apply, 60);
window.setTimeout(apply, 120);
window.setTimeout(apply, 260);
}
function renderLog(list, chatId, { onOpenActions } = {}) {
@@ -416,6 +419,9 @@ export function render({ navigate, route }) {
const input = form.elements.message;
autoResizeComposer(input);
input?.addEventListener('input', () => autoResizeComposer(input));
input?.addEventListener('focus', () => {
scrollToLatestMessage(log);
});
input?.addEventListener('keydown', async (event) => {
if (event.key !== 'Enter') return;
if (event.ctrlKey) {
@@ -480,6 +486,7 @@ export function render({ navigate, route }) {
}),
});
window.requestAnimationFrame(() => scrollToLatestMessage(log));
window.setTimeout(() => scrollToLatestMessage(log), 180);
void sendReadReceiptsForVisible(chatId);
return screen;
}