diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f814d2..d0aece7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The long form, with what was wrong before and how it was found, is in - Add a feed asks only for the feed; Popular and Directory in the sidebar are where you browse. - On a phone, an item's files, with play and delete, sit above its show notes rather than below them, where long notes left them looking missing. +- On a phone, an item with no files goes straight to its text, without a box saying "No files". - The page is served minified, about a quarter smaller. Its script is now TypeScript in `web/src`, type-checked, and built with swc; building ipx needs node. - The script is its own file, `/app.js`, rather than inside the page. Your browser keeps it diff --git a/tests/ui/app.spec.js b/tests/ui/app.spec.js index 2d494d4..f6469ba 100644 --- a/tests/ui/app.spec.js +++ b/tests/ui/app.spec.js @@ -1216,3 +1216,21 @@ test.describe('touch gestures on a phone', () => { await expect(page.locator('#pulltip')).toHaveCount(0); // the note goes on letting go }); }); + +test.describe('an item with no files, on a phone', () => { + test.use({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true }); + + test('shows no files box at all', async ({ page }) => { + await page.locator('#burger').click(); + await page.locator('#feedlist .place', { hasText: 'All Subscriptions' }).click(); + await page.locator('.tabs button', { hasText: 'All' }).first().click(); + await expect(page.locator('.ep').first()).toBeVisible({ timeout: 20_000 }); + // An item with no enclosure, found from the list the page itself has. + const guid = await page.evaluate(() => S.entries.find(e => !e.enclosures.length)?.guid); + expect(guid, 'the fixtures have an item with no files').toBeTruthy(); + await page.locator(`.ep[data-guid="${guid}"]`).click(); + await expect(page.locator('#detail .dt')).toBeVisible(); + await expect(page.locator('#detail .encbox')).toHaveCount(0); + await expect(page.locator('#detail')).not.toContainText('No files'); + }); +}); diff --git a/web/src/items.ts b/web/src/items.ts index 26fac41..c64d25e 100644 --- a/web/src/items.ts +++ b/web/src/items.ts @@ -227,7 +227,9 @@ function showDetail(e){ if(files) files.innerHTML='

No files

'; return; } - const encs=e.enclosures.map(encBox).join('')||'

No files

'; + // Nothing when there are no files: the pane that would say so is hidden above, and on a phone, + // where the files sit over the text, a box saying "No files" only pushed the text down. + const encs=e.enclosures.map(encBox).join(''); // A phone has no room for the files pane, so the files go above the text there instead. // Below it, a long set of show notes pushed play and delete screens down, and on an iPhone // it looked as if a downloaded file could not be deleted at all (issue #21).