Lists open at once from what the page keeps and fetches ahead, or with a spinner (#247)
A click on a feed, All Subscriptions or a filter fetched the list and only then drew it, so nothing answered the click until the server did. The page now keeps the first page of each list (the newest 40, by view, filter, sort and search), draws a kept one at once and refreshes it behind, drawing again only if it changed. It fetches ahead: All Subscriptions and the twenty feeds with the most unread once the page is idle, two at a time, and a feed or filter when the pointer or a finger reaches it. A feed_row or a read forgets that feed's lists and All Subscriptions'; the forgotten are fetched again behind. A list with nothing kept shows a spinner if its answer takes more than 120 ms. list_shown (#246) is reported when the list first shows, so a kept one reports its few ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,7 @@ function renderFeeds(){
|
||||
el.innerHTML=`<span class="ico">${v.icon}</span><b>${v.title}</b>`+(id===':all'
|
||||
?`<span class="badge${unreadAll?'':' zero'}" title="${unreadAll} unread">${unreadAll>999?'999+':unreadAll}</span>`:'');
|
||||
el.onclick=()=>{ selectFeed(id); nav(false); };
|
||||
el.onpointerenter=el.ontouchstart=()=>prefetch(id);
|
||||
places.appendChild(el);
|
||||
}
|
||||
list.appendChild(places);
|
||||
@@ -160,6 +161,8 @@ function renderFeeds(){
|
||||
(f.orphaned?'<span class="tag" title="No longer listed, kept because it has downloads">Gone</span>':'')+
|
||||
`<span class="badge${unread?'':' zero'}" title="${unread} unread">${unread>999?'999+':unread}</span>`;
|
||||
el.onclick=()=>{ selectFeed(f.id); nav(false); };
|
||||
// Fetched as the pointer or a finger reaches it, so the click finds it here (#247).
|
||||
el.onpointerenter=el.ontouchstart=()=>prefetch(f.id);
|
||||
if(kids) $('.chev',el).onclick=(ev: Event)=>{ ev.stopPropagation(); toggleGroup(f.id); };
|
||||
for(const img of $$('img',el)){ const was=drawn.get(img.outerHTML)?.shift(); if(was) img.replaceWith(was); }
|
||||
list.appendChild(el);
|
||||
|
||||
Reference in New Issue
Block a user