A playlist row's X marks the episode played (#497)
renderPlaylist set an onclick of its own over listenRow's, to play on through the playlist, and returned early for a click on the X instead of calling its remove, so Mark played never ran. listenRow now takes what a play click does, and the playlist passes playFrom instead of replacing the handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
This commit is contained in:
@@ -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 expect(page.locator('#ptitle')).toHaveText('First Episode');
|
||||||
await page.locator('#pclose').click();
|
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 page.locator('#content .acts [data-a="rm"]').click();
|
||||||
await answer(page);
|
await answer(page);
|
||||||
await expect(page.locator('#feedlist .feed.child', { hasText: 'Commute' })).toHaveCount(0);
|
await expect(page.locator('#feedlist .feed.child', { hasText: 'Commute' })).toHaveCount(0);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### 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).
|
- 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).
|
- 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).
|
- 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).
|
||||||
|
|||||||
@@ -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)));
|
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
|
/// 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.
|
/// to take it out of the list, which `remove` does. `start` plays it: a playlist's goes on through
|
||||||
function listenRow(e: Entry,removeLabel: string,remove: ()=>void){
|
/// the playlist.
|
||||||
|
function listenRow(e: Entry,removeLabel: string,remove: ()=>void,start=()=>play(e)){
|
||||||
// Carries its episode, for paintListenRow to repaint as the player moves.
|
// Carries its episode, for paintListenRow to repaint as the player moves.
|
||||||
const el: HTMLDivElement & {entry?: Entry}=document.createElement('div');
|
const el: HTMLDivElement & {entry?: Entry}=document.createElement('div');
|
||||||
el.className='childrow';
|
el.className='childrow';
|
||||||
@@ -379,7 +380,7 @@ function listenRow(e: Entry,removeLabel: string,remove: ()=>void){
|
|||||||
`<button class="iconbtn" data-a="remove" title="${removeLabel}" aria-label="${removeLabel}">${ICON.close}</button>`+
|
`<button class="iconbtn" data-a="remove" title="${removeLabel}" aria-label="${removeLabel}">${ICON.close}</button>`+
|
||||||
`<div class="rail"><i></i></div>`;
|
`<div class="rail"><i></i></div>`;
|
||||||
el.onclick=ev=>(ev.target as Element).closest('[data-a=remove]')?remove()
|
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);
|
paintListenRow(el);
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,13 +96,9 @@ async function renderPlaylist(p: Playlist){
|
|||||||
$('#count').textContent=`${p.name}: ${plural(p.items,'episode')}`;
|
$('#count').textContent=`${p.name}: ${plural(p.items,'episode')}`;
|
||||||
list.innerHTML=rows.length?'':'<p class="hint">Nothing here yet. Episodes show up as your podcasts publish them.</p>';
|
list.innerHTML=rows.length?'':'<p class="hint">Nothing here yet. Episodes show up as your podcasts publish them.</p>';
|
||||||
for(const e of rows){
|
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(); });
|
// Not an onclick of its own over listenRow's: that one skipped the X and never marked it (#497).
|
||||||
el.onclick=ev=>{
|
list.appendChild(listenRow(e,'Mark played',async()=>{ try{ await setRead(e,true); }catch(err){ toast(why(err),true); } renderPlaylist(p); loadPlaylists(); },
|
||||||
if((ev.target as Element).closest('[data-a=remove]')) return;
|
()=>playFrom(rows,e)));
|
||||||
if(el.classList.contains('now')&&!audio.paused){ audio.pause(); return; }
|
|
||||||
playFrom(rows,e);
|
|
||||||
};
|
|
||||||
list.appendChild(el);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Plays an episode of a list that goes on to the list's next.
|
/// Plays an episode of a list that goes on to the list's next.
|
||||||
|
|||||||
Reference in New Issue
Block a user