diff --git a/tests/ui/app.spec.ts b/tests/ui/app.spec.ts index feb918c..7a41931 100644 --- a/tests/ui/app.spec.ts +++ b/tests/ui/app.spec.ts @@ -544,6 +544,13 @@ test('a smart playlist puts its first podcasts ahead and plays on through itself await expect(page.locator('#ptitle')).toHaveText('First Episode'); await page.locator('#pclose').click(); + // Its X marks it played (#497): an onclick of the playlist's own once skipped it. + const twoFiles = async () => (await page.evaluate(() => api('/api/feeds/multi-show/entries')) as ListPage).entries + .find(e => e.title === 'Two Files')!; + await page.locator('#listening .childrow', { hasText: 'Two Files' }).locator('[data-a="remove"]').click(); + await expect.poll(async () => (await twoFiles()).read).toBe(true); + await page.evaluate(e => setRead(e, false), await twoFiles()); + await page.locator('#content .acts [data-a="rm"]').click(); await answer(page); await expect(page.locator('#feedlist .feed.child', { hasText: 'Commute' })).toHaveCount(0); diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index 1ca5aa6..496f317 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- The X on a playlist's episode marks it played again; it did nothing (#497). - A folder's triangle in the feed list is back on the far left, in a narrower margin than before, with every feed's artwork still in line (#491). - Opening a podcast or a list draws only the list: the feed list beside it is no longer rebuilt to move its highlight, and dates are written by one formatter rather than one a row, about 40% less work on a phone (#490). - A report of a reader that would not scroll no longer comes from a quick flick that did scroll, and says when the reader was last swiped across, not that it was just now (#488). diff --git a/web/src/dialogs.ts b/web/src/dialogs.ts index 31684f8..7381697 100644 --- a/web/src/dialogs.ts +++ b/web/src/dialogs.ts @@ -366,8 +366,9 @@ function drawListening(box: HTMLElement,rows: Entry[]){ for(const e of rows) box.appendChild(listenRow(e,'Remove from Currently Listening',()=>forget(e))); } /// An episode's row in Currently Listening and Up Next: its art, how far in, play, and a button -/// to take it out of the list, which `remove` does. -function listenRow(e: Entry,removeLabel: string,remove: ()=>void){ +/// to take it out of the list, which `remove` does. `start` plays it: a playlist's goes on through +/// the playlist. +function listenRow(e: Entry,removeLabel: string,remove: ()=>void,start=()=>play(e)){ // Carries its episode, for paintListenRow to repaint as the player moves. const el: HTMLDivElement & {entry?: Entry}=document.createElement('div'); el.className='childrow'; @@ -379,7 +380,7 @@ function listenRow(e: Entry,removeLabel: string,remove: ()=>void){ ``+ `
`; el.onclick=ev=>(ev.target as Element).closest('[data-a=remove]')?remove() - :el.classList.contains('now')&&!audio.paused?audio.pause():play(e); + :el.classList.contains('now')&&!audio.paused?audio.pause():start(); paintListenRow(el); return el; } diff --git a/web/src/playlists.ts b/web/src/playlists.ts index 5a76c44..529587f 100644 --- a/web/src/playlists.ts +++ b/web/src/playlists.ts @@ -96,13 +96,9 @@ async function renderPlaylist(p: Playlist){ $('#count').textContent=`${p.name}: ${plural(p.items,'episode')}`; list.innerHTML=rows.length?'':'

Nothing here yet. Episodes show up as your podcasts publish them.

'; for(const e of rows){ - const el=listenRow(e,'Mark played',async()=>{ try{ await setRead(e,true); }catch(err){ toast(why(err),true); } renderPlaylist(p); loadPlaylists(); }); - el.onclick=ev=>{ - if((ev.target as Element).closest('[data-a=remove]')) return; - if(el.classList.contains('now')&&!audio.paused){ audio.pause(); return; } - playFrom(rows,e); - }; - list.appendChild(el); + // Not an onclick of its own over listenRow's: that one skipped the X and never marked it (#497). + list.appendChild(listenRow(e,'Mark played',async()=>{ try{ await setRead(e,true); }catch(err){ toast(why(err),true); } renderPlaylist(p); loadPlaylists(); }, + ()=>playFrom(rows,e))); } } /// Plays an episode of a list that goes on to the list's next.