diff --git a/tests/ui/app.spec.ts b/tests/ui/app.spec.ts index e4862c6..78b4faf 100644 --- a/tests/ui/app.spec.ts +++ b/tests/ui/app.spec.ts @@ -3256,3 +3256,34 @@ test('a podcast told in seasons runs in its own order, one season at a time or a await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click(); await expect(page.locator('#content .seasons button.on')).toHaveText('All seasons'); }); + +test.describe('on a phone', () => { + test.use({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true }); + test('a row spends its width on the title: unread a dot before it, pinned a pin under it (#484)', async ({ page }) => { + await page.locator('#burger').click(); + await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click({ timeout: 20_000 }); + await page.locator('#content .tabs button[data-f="all"]').click(); + const row = page.locator('#eps .ep', { hasText: 'The Pilot' }); + await expect(row).toBeVisible(); + // No read or pin button before the title: it starts at the row's own padding. + await expect(row.locator('.st')).toBeHidden(); + await expect(row.locator('.fl')).toBeHidden(); + const [r, t] = [await row.boundingBox(), await row.locator('.t').boundingBox()]; + expect(t!.x - r!.x).toBeLessThan(16); + // Unread says so before the title, by a dot a screen reader names; read, nothing. + const flags = (body: object) => page.evaluate(b => fetch('/api/entries/seasoned-show/sn-1/flags', + { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(b) }), body); + await flags({ read: false, flagged: true }); + await page.reload(); + await page.locator('#burger').click(); + await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click(); + await expect(row.locator('.t [role=img][aria-label="Unread"]')).toBeVisible(); + await expect(row.locator('.line [aria-label="Pinned"]')).toBeVisible(); + await flags({ read: true, flagged: false }); + await page.reload(); + await page.locator('#burger').click(); + await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click(); + await expect(row.locator('.udot')).toBeHidden(); + await expect(row.locator('.pinmark')).toHaveCount(0); + }); +}); diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index a5c8b2f..b03c48c 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- On a phone, an episode's title starts at the row's edge: the read and pin buttons are gone from the row, an unread episode has a dot before its title and a pinned one a pin under it, and both are changed from the reader's actions (#484). - Podcasts are in order by name with a leading "The", "A" or "An" set aside, in the feed list, the Podcasts shelf, a playlist's choices and the Directory: The Rest Is Science is under R, not T (#481). - A file has one button that brings it to where you are: on a phone or in the iOS app it ends on the device, with iPX fetching it first when it has not got it, and on a computer iPX fetches it and the button then saves a copy. A line beside the file's size says where it is (publisher only, queued for iPX, on iPX, on this device), and the rarer actions (remove from this device, delete from iPX, download to iPX only) are under ⋯ (#457). - The admin page is laid out as a feed's settings are: each tab in named parts, numbers with their unit beside them, switches for on and off, Server's Save always in reach, and on a phone the tabs in a row of their own so all four fit (#414). diff --git a/web/app.css b/web/app.css index b5103bd..ac94071 100644 --- a/web/app.css +++ b/web/app.css @@ -1118,6 +1118,8 @@ body.playing .eq i:nth-child(3){animation-delay:-.6s} .ep.read .t{color:var(--dim);font-weight:500} .ep .line{display:flex;gap:9px;align-items:center;flex-wrap:wrap;color:var(--faint);font-size:11.5px} .ep .line:empty{display:none} +/* A phone's marks for what the row's buttons say elsewhere (#484). */ +.ep .udot,.ep .pinmark,.ep .pinmark+.dot{display:none} .ep .kept{display:inline-flex;align-items:center;gap:4px;color:var(--dim)} .ep .kept svg{width:1em;height:1em} .ep .fd,.ep .size,.ep .date{color:var(--dim);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} @@ -1408,7 +1410,15 @@ body:has(#player.on) #status{padding-bottom:3px} #split{grid-template-columns:1fr;grid-template-rows:1fr;grid-template-areas:"list"} /* Title and date only; the files sit above the item's text in the reader instead. */ #files,.ephead,.ep .fd,.ep .file,.ep .size,.ep .rowacts{display:none} - .ep,#split.one .ep{grid-template-columns:20px 20px minmax(0,1fr) auto} + /* No read or pin button: their two columns cost 77px of a 390px screen before the title, empty + once an episode is read (#484). Unread is a dot before the title, pinned a pin under it, and + both are changed from the reader's actions. */ + .ep .st,.ep .fl{display:none} + .ep,#split.one .ep{grid-template-columns:minmax(0,1fr) auto} + .ep:not(.read) .udot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--accent2);margin-inline-end:7px;vertical-align:.12em} + .ep .pinmark{display:inline-flex;color:var(--dim)} + .ep .pinmark+.dot{display:block} + .ep .pinmark svg{width:.9em;height:.9em} #grab{display:none} #detail{position:fixed;inset:0;z-index:38;display:none;border-top:0;padding:12px 16px 90px;padding-top:calc(12px + var(--safe-t))} body.reading #detail{display:block} @@ -1557,7 +1567,7 @@ body:has(#player.on) #status{padding-bottom:3px} .ep.sel{border-color:var(--edge)} .ep .t{font-size:17px} .ep .line,.ep .date{font-size:15px} - .ep+.ep{background-image:linear-gradient(var(--line),var(--line));background-size:calc(100% - 64px) 1px;background-position:64px 0;background-repeat:no-repeat} + .ep+.ep{background-image:linear-gradient(var(--line),var(--line));background-size:calc(100% - 8px) 1px;background-position:8px 0;background-repeat:no-repeat} .ep.sel,.ep.sel+.ep{background-image:none} .feed{padding:9px 10px;min-height:44px;border-radius:10px} .places{border-bottom-color:var(--edge);padding-bottom:10px;margin-bottom:10px} diff --git a/web/src/items.ts b/web/src/items.ts index b84a683..a738a32 100644 --- a/web/src/items.ts +++ b/web/src/items.ts @@ -197,8 +197,10 @@ function epEl(e: Entry){
- +
${[ + // On a phone, where the row has no pin button, what says it is pinned (#484). + e.flagged&&`${ICON.pinOn}`, num&&`${num}`, left&&`${left}`, others>0&&`+${others} more file${others===1?'':'s'}`,