From 16065315a756dd0e952a1401b47c2ff93928e693 Mon Sep 17 00:00:00 2001 From: sravan Date: Tue, 7 Jul 2026 15:44:32 +0530 Subject: [PATCH] fix(chat): pull-to-refresh at top loads older history, no longer resets to bottom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull-down-at-top called reloadThread (reload newest 500 + scroll to bottom), so reaching the oldest message yanked the view to the newest — jarring, especially on a single page. Now the pull gesture calls loadOlder: it pages in older history keeping scroll position, or no-ops when there's nothing older. Never jumps to the bottom. Co-Authored-By: Claude Opus 4.8 --- server/public/home.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/public/home.html b/server/public/home.html index 609ca72..b147b33 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -790,7 +790,7 @@ - @@ -1825,7 +1825,7 @@ async function openConvo(kind,id){ if(bub && !already && !bub.classList.contains('deleted')) bub.classList.add('show-actions'); }); if(box) box.addEventListener('scroll', onMsgsScroll); - if(box) enablePullRefresh(box, reloadThread); // pull down at the top to refresh the conversation + if(box) enablePullRefresh(box, loadOlder); // pull down at the top loads OLDER history (or no-ops); never jumps to the newest/bottom const jl=document.getElementById('jumpLatest'); if(jl) jl.onclick=()=>{ const b=document.getElementById('msgs'); if(b) b.scrollTop=b.scrollHeight; }; composeMentions=new Map(); convoMembers=[]; // Synchronous render from cache (within the click's activation → paints immediately, even