On the Unread tab, a swipe back goes to the item just read (#50)
selectEntry took each read item out of the list the moment you moved on from it, so the item was not there for the back swipe (or k) to reach: it went to the one before, or to the list if the item had been first. Items read while turning from one to the next (a swipe, j and k) now stay in the list until the reader closes or another item is picked from the list, and a background refresh keeps them as it keeps the open one. Picking a row still drops the item left behind at once, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1255,6 +1255,34 @@ test.describe('touch gestures on a phone', () => {
|
||||
await expect(page.locator('body')).not.toHaveClass(/reading/);
|
||||
});
|
||||
|
||||
test('on the Unread tab, a swipe back goes to the item just read', async ({ page }) => {
|
||||
await page.locator('#burger').click();
|
||||
await page.locator('.feed', { hasText: 'Test Show' }).click();
|
||||
await page.locator('.tabs button', { hasText: 'All' }).first().click();
|
||||
await expect(page.locator('.ep').nth(1)).toBeVisible({ timeout: 20_000 });
|
||||
// Earlier tests read these; both have to be unread to be on the Unread tab.
|
||||
await page.evaluate(() => Promise.all(S.entries.map(e => setRead(e, false))));
|
||||
await page.locator('.tabs button', { hasText: 'Unread' }).first().click();
|
||||
await expect(page.locator('.ep').nth(1)).toBeVisible({ timeout: 20_000 });
|
||||
const titles = await page.locator('.ep .t').allTextContents();
|
||||
await page.locator('.ep').first().click();
|
||||
const shown = page.locator('#detail .dt');
|
||||
await expect(shown).toHaveText(titles[0]);
|
||||
|
||||
await drag(page, { x: 300, y: 400 }, { x: 80, y: 410 }); // left: the next item
|
||||
await expect(shown).toHaveText(titles[1]);
|
||||
// The first is read now, and used to be gone from the list already, so this went back to
|
||||
// the list instead.
|
||||
await drag(page, { x: 80, y: 400 }, { x: 300, y: 410 });
|
||||
await expect(shown).toHaveText(titles[0]);
|
||||
await drag(page, { x: 300, y: 400 }, { x: 80, y: 410 });
|
||||
await expect(shown).toHaveText(titles[1]);
|
||||
// Out of the reader, the ones read on the way leave the Unread tab as before.
|
||||
await page.locator('#dback').click();
|
||||
await expect(page.locator('body')).not.toHaveClass(/reading/);
|
||||
await expect(page.locator('.ep .t', { hasText: titles[0] })).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('pulling the list down from its top checks the feed for new items', async ({ page }) => {
|
||||
await page.locator('#burger').click();
|
||||
await page.locator('.feed', { hasText: 'Test Show' }).click();
|
||||
|
||||
Reference in New Issue
Block a user