Dimmed buttons say why; the directory fits at 200% zoom (#507)
Checked against the style guide's design half: - Dimmed, not removed: the page already dims rather than hides, but a dimmed toolbar button kept its usual tooltip, so it looked broken. dim() sets the reason (Choose an item first, Open a feed to unsubscribe from it, Nothing to play in this item) and gives the usual tooltip back. The player's play-button sync leaves a dimmed one alone, and syncTools asks it to repaint so a playing item still says Pause. The admin page's Save says nothing has changed yet. - 200% zoom on a 320 px screen (160 CSS px): the app and admin page fit; the directory scrolled sideways, its name on one line, its header form beside it, its category grid at a 180 px minimum and the chart's words. Now its name wraps, the form takes its own line, the grid's minimum is the width, and long words break. - Tap targets at 320 px: the directory's tabs, chips, button and search box were 35-39 px, now 40; the page's checkbox rows were 26 px, now 40. The admin switches are iOS's 51x31 inside a taller row. - The directory's hovers sit inside (hover:hover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVCCH8YcP2Y3i8VNYWA
This commit is contained in:
@@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- A toolbar button that cannot act says why in its tooltip (Choose an item first, Open a feed to unsubscribe from it, Nothing to play in this item), and the admin page's Save says nothing has changed yet; on a phone a checkbox's row is 40 px to tap (#507).
|
||||
- On a phone the toolbar's buttons and the list's tabs are at least 40 px to tap, a chapter no longer stays lit after a tap, and an item's pin and download buttons have names a screen reader reads, as the style guide's design half asks (#507).
|
||||
- The page's words follow one style (docs/STYLE-GUIDE.md): failures say "Unable to …" and what to do, a podcast is a podcast rather than a show, a feed has an address rather than a URL, and the buttons Auto and Initials in a signal's icon picker read Pick for me and Use initials (#507).
|
||||
- A title that is only the opening of an item's own text, as ipx now names an untitled item, is not shown again above that text in the reader or a directory preview (#502).
|
||||
|
||||
@@ -1604,7 +1604,7 @@ body:has(#player.on) #status{padding-bottom:3px}
|
||||
dialog.ask{margin:auto 0 0;width:100%;max-width:100%}
|
||||
.card h3{font-size:22px}
|
||||
.field label,.field .hint{font-size:13px}
|
||||
.check{font-size:17px}
|
||||
.check{font-size:17px;min-height:40px}
|
||||
/* A feed's settings, at a phone's sizes. */
|
||||
.card.fset{padding:0}
|
||||
.fsetbody{padding:20px 16px 24px}
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
<span id="applogo" title="iPX"><img class="logo onlight" src="/logo.svg" alt="iPX"><img class="logo ondark" src="/logo-dark.svg" alt="iPX"><img class="logo classic" src="/icon.png" alt="iPodderX"></span>
|
||||
<div class="tgroup">
|
||||
<button id="addFeed" title="Add a feed" aria-label="Add a feed" data-icon="plus"></button>
|
||||
<button id="tbRemove" title="Unsubscribe from this feed" aria-label="Unsubscribe from this feed" data-icon="circleMinus" disabled></button>
|
||||
<button id="tbRemove" title="Open a feed to unsubscribe from it" aria-label="Unsubscribe from this feed" data-icon="circleMinus" disabled></button>
|
||||
<button id="scanAll" title="Check every feed for new items" aria-label="Check every feed for new items" data-icon="scan"></button>
|
||||
</div>
|
||||
<div class="tgroup item">
|
||||
<button id="tbPlay" title="Play the selected item" aria-label="Play the selected item" data-icon="play" disabled></button>
|
||||
<button id="tbRead" title="Mark the selected item read or unread" aria-label="Mark read or unread" data-icon="check" disabled></button>
|
||||
<button id="tbFlag" title="Pin the selected item, so it is never deleted" aria-label="Pin" data-icon="pin" disabled></button>
|
||||
<button id="tbPlay" title="Choose an item first" aria-label="Play the selected item" data-icon="play" disabled></button>
|
||||
<button id="tbRead" title="Choose an item first" aria-label="Mark read or unread" data-icon="check" disabled></button>
|
||||
<button id="tbFlag" title="Choose an item first" aria-label="Pin" data-icon="pin" disabled></button>
|
||||
</div>
|
||||
<span class="grow"></span>
|
||||
<span class="clearable" id="epBox"><input type="search" id="epSearch" placeholder="Search" aria-label="Search"><button type="button" class="clearx" title="Clear the search" aria-label="Clear the search" data-icon="close"></button></span>
|
||||
|
||||
@@ -63,9 +63,9 @@ async function drawServer(){
|
||||
: 'This server has no TypeSafe key (<code>TYPESAFE_KEY</code>), so each person uses their own.'}</p>
|
||||
${anum('gsigdays', 'A new Signal looks back', g.signal_days, 'days', ' min="1" max="365"')}
|
||||
<p class="cap">Each item read is a call to TypeSafe, so a longer look back costs more, once for each new Signal.</p>`)}
|
||||
<div class="afoot"><button class="btn primary" id="gsave" disabled>${ICON.check} Save</button></div>`;
|
||||
<div class="afoot"><button class="btn primary" id="gsave" title="Nothing changed yet" disabled>${ICON.check} Save</button></div>`;
|
||||
// Save waits for a change, so it says whether there is one.
|
||||
box.oninput = () => { $<HTMLButtonElement>('#gsave').disabled = false; };
|
||||
box.oninput = () => { dim($<HTMLButtonElement>('#gsave'), null, 'Save'); };
|
||||
$<HTMLButtonElement>('#gsave').onclick = async () => {
|
||||
try{
|
||||
await api('/api/settings', {method: 'PATCH', body: JSON.stringify({
|
||||
@@ -79,7 +79,7 @@ async function drawServer(){
|
||||
// Left alone while the server has no key to offer, rather than switched off.
|
||||
...($<HTMLInputElement>('#gsig').disabled ? {} : {signals_on_server: $<HTMLInputElement>('#gsig').checked})})});
|
||||
toast('Settings saved');
|
||||
$<HTMLButtonElement>('#gsave').disabled = true;
|
||||
dim($<HTMLButtonElement>('#gsave'), 'Nothing changed yet', 'Save');
|
||||
}catch(e){ toast(why(e), true); }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ function catTile(c: string,name: string,count: string,rows: DirFeed[]){
|
||||
async function renderListed(v: {title: string, icon: string, url?: string, blurb?: string}){
|
||||
const box=$('#content');
|
||||
box.classList.add('plain');
|
||||
$<HTMLButtonElement>('#tbRemove').disabled=true;
|
||||
dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
|
||||
syncTools(null);
|
||||
if(v===VIEWS[':directory']){
|
||||
$<HTMLInputElement>('#epSearch').placeholder='Find a feed…';
|
||||
|
||||
@@ -28,7 +28,7 @@ function renderFeed(){
|
||||
if(pl) return renderPlaylist(pl);
|
||||
const f=v?null:S.feeds.find(x=>x.id===S.feed);
|
||||
const sg=signalOf(S.feed);
|
||||
$<HTMLButtonElement>('#tbRemove').disabled=!f;
|
||||
dim($<HTMLButtonElement>('#tbRemove'),f?null:NO_FEED,UNSUB);
|
||||
syncTools(null);
|
||||
if(!v&&!f&&!sg){ box.innerHTML='<p class="empty">Add a feed to get started.</p>'; $('#count').textContent=''; return; }
|
||||
const name=f?(f.title||f.id):sg?sg.name:v.title;
|
||||
|
||||
@@ -399,8 +399,12 @@ function dragSplit(pane: HTMLElement){
|
||||
/// Which item the toolbar's play, read and keep buttons act on.
|
||||
const cur=()=>S.entries.find(x=>entryKey(x)===S.sel);
|
||||
function syncTools(e: Entry|null){
|
||||
$<HTMLButtonElement>('#tbPlay').disabled=!(e&&e.enclosures.some(isPlayable));
|
||||
$<HTMLButtonElement>('#tbRead').disabled=$<HTMLButtonElement>('#tbFlag').disabled=!e;
|
||||
const pick=e?null:'Choose an item first';
|
||||
dim($<HTMLButtonElement>('#tbPlay'),pick??(e!.enclosures.some(isPlayable)?null:'Nothing to play in this item'),'Play the selected item');
|
||||
dim($<HTMLButtonElement>('#tbRead'),pick,e?`Mark ${e.read?'unread':'read'}`:'');
|
||||
dim($<HTMLButtonElement>('#tbFlag'),pick,e?.flagged?'Unpin':'Pin, so it is never deleted');
|
||||
// The play button says Pause when the item chosen is the one playing.
|
||||
syncPlayButtons();
|
||||
// The same icons as the item's own buttons beside its title, so the two never disagree. Each
|
||||
// shows what is, as the pin always did: read showed what a click would do, so the two side by
|
||||
// side said opposite things (#74). The shape carries it, not the colour.
|
||||
@@ -408,10 +412,6 @@ function syncTools(e: Entry|null){
|
||||
$<HTMLButtonElement>('#tbRead').setAttribute('aria-pressed',String(!!(e&&e.read)));
|
||||
$<HTMLButtonElement>('#tbFlag').setAttribute('aria-pressed',String(!!(e&&e.flagged)));
|
||||
$<HTMLButtonElement>('#tbFlag').innerHTML=e&&e.flagged?ICON.pinOn:ICON.pin;
|
||||
if(e){
|
||||
$<HTMLButtonElement>('#tbRead').title=`Mark ${e.read?'unread':'read'}`;
|
||||
$<HTMLButtonElement>('#tbFlag').title=e.flagged?'Unpin':'Pin, so it is never deleted';
|
||||
}
|
||||
}
|
||||
|
||||
/// The item's text in the pane below the list, and its files in the pane beside it.
|
||||
|
||||
@@ -158,7 +158,9 @@ function syncPlayButtons(){
|
||||
for(const b of $$('#eps .ep [data-a=play]')) paint(b,on(b.closest<HTMLElement>('.ep')!.dataset.key),'Play');
|
||||
for(const b of $$('#files [data-a=play][data-enc], #detail [data-a=play][data-enc]'))
|
||||
paint(b,on(S.sel,Number(b.dataset.enc)),'Play');
|
||||
const e=cur(); paint($<HTMLButtonElement>('#tbPlay'),!!e&&on(entryKey(e)),'Play the selected item');
|
||||
// Dimmed, it keeps the reason it is dimmed (#507).
|
||||
const e=cur(), tb=$<HTMLButtonElement>('#tbPlay');
|
||||
if(!tb.disabled) paint(tb,!!e&&on(entryKey(e)),'Play the selected item');
|
||||
}
|
||||
for(const ev of ['play','pause','timeupdate']) audio.addEventListener(ev,syncListening);
|
||||
window.addEventListener('beforeunload',savePos);
|
||||
|
||||
@@ -37,7 +37,7 @@ function playlistFolder(list: HTMLElement, q: string){
|
||||
/// The folder's page: every playlist, and New playlist.
|
||||
function renderPlaylists(){
|
||||
$('#count').textContent=`Playlists: ${plural(playlists.length,'playlist')}`;
|
||||
$<HTMLButtonElement>('#tbRemove').disabled=true;
|
||||
dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
|
||||
syncTools(null);
|
||||
const box=$('#content');
|
||||
box.classList.add('plain');
|
||||
@@ -63,7 +63,7 @@ function renderPlaylists(){
|
||||
/// A playlist's page: its episodes in its order. Play goes on through it; the cross marks one
|
||||
/// played, which takes it out of an unplayed-only playlist.
|
||||
async function renderPlaylist(p: Playlist){
|
||||
$<HTMLButtonElement>('#tbRemove').disabled=true;
|
||||
dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
|
||||
syncTools(null);
|
||||
const box=$('#content');
|
||||
box.classList.add('plain');
|
||||
|
||||
@@ -74,7 +74,7 @@ function signalFolder(list: HTMLElement, q: string){
|
||||
function renderSignals(){
|
||||
const unread=S.signals.reduce((k,s)=>k+s.unread,0);
|
||||
$('#count').textContent=`Signals: ${plural(S.signals.length,'signal')}, ${unread} unread`;
|
||||
$<HTMLButtonElement>('#tbRemove').disabled=true;
|
||||
dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
|
||||
syncTools(null);
|
||||
const box=$('#content');
|
||||
box.classList.add('plain');
|
||||
|
||||
@@ -272,6 +272,10 @@ async function sendLink(title: string, url: string, btn?: HTMLElement){
|
||||
toast('Link copied');
|
||||
}
|
||||
|
||||
/// A button that cannot act now is dimmed in place, its tooltip saying why, and gets its usual
|
||||
/// tooltip back when it can (#507): dimmed with its usual one, it looked broken.
|
||||
function dim(b: HTMLButtonElement, why: string|null, usual: string){ b.disabled=!!why; b.title=why??usual; }
|
||||
const NO_FEED='Open a feed to unsubscribe from it', UNSUB='Unsubscribe from this feed';
|
||||
function toast(msg: string, bad?: boolean){
|
||||
const t=document.createElement('div'), box=$('#toasts');
|
||||
t.className='toast'+(bad?' bad':''); t.textContent=msg;
|
||||
|
||||
Reference in New Issue
Block a user