A pinned item goes to the top of its list
order_sql takes pinned_first, which puts coalesce(s.flagged, 0) DESC ahead of the chosen sort, so pins lead every list in whatever order is asked for and on every page of it. Not when sorting by the pin column itself, where the direction is the point, and not for Currently Listening. Pinning now asks for the list again so the row moves at once, instead of redrawing it where it stood. Closes #35. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1299,3 +1299,20 @@ test('a pinned feed, even one from inside a folder, goes to the top of the list'
|
||||
await expect(page.locator('.feed.pinned')).toHaveCount(0);
|
||||
await expect(page.locator('.feed.child', { hasText: name })).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('a pinned item goes to the top of its list, and back when unpinned', async ({ page }) => {
|
||||
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 });
|
||||
const guids = () => page.locator('.ep').evaluateAll(rows => rows.map(r => r.dataset.guid));
|
||||
const before = await guids();
|
||||
const last = before[before.length - 1];
|
||||
const row = page.locator(`.ep[data-guid="${last}"]`);
|
||||
await row.locator('[data-a="flag"]').click();
|
||||
await expect.poll(async () => (await guids())[0]).toBe(last);
|
||||
// It is the server's order, so it holds on a reload.
|
||||
await page.reload();
|
||||
await expect.poll(async () => (await guids())[0]).toBe(last);
|
||||
await page.locator(`.ep[data-guid="${last}"] [data-a="flag"]`).click();
|
||||
await expect.poll(guids).toEqual(before);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user