A short Unread list read through no longer says more to load (#385)

hasMore() compared nextOffset(), which on Unread counts only the loaded
items still unread, with S.total from the answer: once they were read it
was 0 against that total, so the page asked for a page that came back
empty and took its total, 0, with the items still on screen. Whether
more is left now comes from the last answer itself, its offset and items
against its total; reading takes an item off the server's list and off
nextOffset() alike, so what that answer said is left stays true.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 23:44:51 +00:00
parent 8a66f9c7ee
commit d3b8c4cd01
5 changed files with 17 additions and 3 deletions

View File

@@ -268,10 +268,18 @@ test('the next page starts after the unread ones on the Unread tab, after all of
run(`S.filter = 'unread'`);
// Two read here are off the server's unread list: starting at 3 would skip two unread ones (#383).
assert.equal(run('nextOffset()'), 1);
assert.equal(run('hasMore()'), true);
run(`S.filter = 'all'`);
assert.equal(run('nextOffset()'), 3);
});
test('a short Unread list read through says nothing more to load (#385)', () => {
run(`S.filter = 'unread'; S.offset = 0`);
run(`showList({total: 2, entries: [{guid:'a',read:false,enclosures:[]},{guid:'b',read:false,enclosures:[]}]}, false, 0)`);
run(`S.entries.forEach(e => e.read = true)`);
// nextOffset() is 0 now, under the total of 2, which once read as more to load.
assert.equal(run('hasMore()'), false);
run(`S.offset = 50; showList({total: 120, entries: Array.from({length: 50}, (_, i) => ({guid: 'p' + i, read: false, enclosures: []}))}, true, 0)`);
assert.equal(run('hasMore()'), true);
});
test('a reader is stuck only when a drag up or down had room to move it and did not (#384)', () => {