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:
2026-11-22 18:30:01 -05:00
parent 5786a0cb1c
commit 9ef9359fe6
4 changed files with 15 additions and 10 deletions

View File

@@ -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).

View File

@@ -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){
`<button class="iconbtn" data-a="remove" title="${removeLabel}" aria-label="${removeLabel}">${ICON.close}</button>`+
`<div class="rail"><i></i></div>`;
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;
}

View File

@@ -96,13 +96,9 @@ async function renderPlaylist(p: Playlist){
$('#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>';
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.