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:
2026-12-02 12:22:22 -05:00
parent 19f9790eef
commit 3de955c52a
14 changed files with 53 additions and 27 deletions

View File

@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- On a phone the directory's pages fit at 200% zoom without scrolling sideways, its tabs, buttons and search box are 40 px to tap, and a link does not stay underlined after a tap (#507).
- An episode its feed gives no title is named by the opening of its text or else its file's name, where it had none (#502). - An episode its feed gives no title is named by the opening of its text or else its file's name, where it had none (#502).
- Its checks of YouTube channels go one at a time, two seconds apart, since YouTube refuses many asked together (#386). - Its checks of YouTube channels go one at a time, two seconds apart, since YouTube refuses many asked together (#386).
- Its JSON log lines no longer carry their span, once on its own and again in a list, which said nothing the line's own fields did not (#363). - Its JSON log lines no longer carry their span, once on its own and again in a list, which said nothing the line's own fields did not (#363).

View File

@@ -6,7 +6,7 @@
html{-webkit-text-size-adjust:100%} html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif} body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:var(--accent);text-decoration:none} a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline} @media (hover:hover){a:hover{text-decoration:underline}}
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px} a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
header{display:flex;align-items:center;gap:16px;padding:12px 20px;background:var(--panel);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:1} header{display:flex;align-items:center;gap:16px;padding:12px 20px;background:var(--panel);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:1}
.brand{display:flex;align-items:center;gap:10px;color:var(--fg);font-weight:700;font-size:17px;white-space:nowrap} .brand{display:flex;align-items:center;gap:10px;color:var(--fg);font-weight:700;font-size:17px;white-space:nowrap}
@@ -29,21 +29,21 @@ h3{font-size:17px;margin:28px 0 8px}
/* A grid item is as wide as its content unless told otherwise, and a long title then runs off the page. */ /* A grid item is as wide as its content unless told otherwise, and a long title then runs off the page. */
.chart li,.tile{min-width:0} .chart li,.tile{min-width:0}
.chart a{display:flex;align-items:center;gap:12px;padding:8px;border-radius:10px;color:var(--fg)} .chart a{display:flex;align-items:center;gap:12px;padding:8px;border-radius:10px;color:var(--fg)}
.chart a:hover{background:var(--panel);text-decoration:none} @media (hover:hover){.chart a:hover{background:var(--panel);text-decoration:none}}
.no{width:22px;text-align:right;color:var(--faint);font-variant-numeric:tabular-nums;flex:none} .no{width:22px;text-align:right;color:var(--faint);font-variant-numeric:tabular-nums;flex:none}
.txt{display:flex;flex-direction:column;min-width:0} .txt{display:flex;flex-direction:column;min-width:0}
.txt b,.tile b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .txt b,.tile b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
small{color:var(--dim);font-size:13px} small{color:var(--dim);font-size:13px}
.cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px} .cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(180px,100%),1fr));gap:12px}
.cat{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border-radius:12px;background:var(--panel);border:1px solid var(--line);color:var(--fg)} .cat{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border-radius:12px;background:var(--panel);border:1px solid var(--line);color:var(--fg)}
.cat:hover{border-color:var(--accent);text-decoration:none} @media (hover:hover){.cat:hover{border-color:var(--accent);text-decoration:none}}
.tabs,.pills{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px} .tabs,.pills{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
.tabs a,.pills a{padding:6px 14px;border-radius:999px;background:var(--panel);border:1px solid var(--line);color:var(--fg);font-size:14px} .tabs a,.pills a{padding:6px 14px;border-radius:999px;background:var(--panel);border:1px solid var(--line);color:var(--fg);font-size:14px}
.tabs a[aria-current],.pills a[aria-current]{background:var(--accent);border-color:var(--accent);color:var(--ink)} .tabs a[aria-current],.pills a[aria-current]{background:var(--accent);border-color:var(--accent);color:var(--ink)}
.pills a[aria-current] small{color:inherit} .pills a[aria-current] small{color:inherit}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:18px 14px} .tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:18px 14px}
.tile{display:flex;flex-direction:column;gap:4px;min-width:0;color:var(--fg)} .tile{display:flex;flex-direction:column;gap:4px;min-width:0;color:var(--fg)}
.tile:hover{text-decoration:none}.tile:hover b{text-decoration:underline} @media (hover:hover){.tile:hover{text-decoration:none}.tile:hover b{text-decoration:underline}}
.show{display:flex;gap:24px;align-items:flex-end;margin-top:8px} .show{display:flex;gap:24px;align-items:flex-end;margin-top:8px}
.meta{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1} .meta{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.meta h2{margin:0;font-size:28px;line-height:1.15;overflow-wrap:anywhere} .meta h2{margin:0;font-size:28px;line-height:1.15;overflow-wrap:anywhere}
@@ -58,9 +58,17 @@ button{font:inherit;font-weight:600;padding:8px 16px;border-radius:10px;border:0
article{padding:12px 0;border-bottom:1px solid var(--line);max-width:80ch} article{padding:12px 0;border-bottom:1px solid var(--line);max-width:80ch}
article p{margin:4px 0;color:var(--dim)} article p{margin:4px 0;color:var(--dim)}
@media (max-width:600px){ @media (max-width:600px){
header{padding:10px 16px;gap:10px} header{padding:10px 16px;gap:10px;flex-wrap:wrap}
/* Under the name rather than squeezed beside it: at 200% zoom the two did not fit (#507). */
header form{flex:1 1 100%}
/* 40 px to tap, as the style guide asks of a phone (#507). */
.tabs a,.pills a{padding:9px 14px}
button,input{padding-top:10px;padding-bottom:10px}
.brand span,.brand{font-size:15px} .brand span,.brand{font-size:15px}
main{padding:16px} /* Its name may take two lines: on one, it ran past the edge at 200% zoom (#507). */
.brand{white-space:normal}
/* A word too long for the line breaks rather than pushing the page sideways at 200% zoom (#507). */
main{padding:16px;overflow-wrap:anywhere}
.show{flex-direction:column;align-items:flex-start;gap:14px} .show{flex-direction:column;align-items:flex-start;gap:14px}
.art.lg{width:140px} .art.lg{width:140px}
.tiles{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:14px 10px} .tiles{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:14px 10px}

View File

@@ -53,6 +53,16 @@ test.beforeEach(async ({ page }) => {
await expect(page.locator('#feedlist')).toBeVisible(); await expect(page.locator('#feedlist')).toBeVisible();
}); });
test('a toolbar button that cannot act says why, and its usual tooltip comes back when it can (#507)', async ({ page }) => {
await page.locator('#feedlist .place', { hasText: 'All Subscriptions' }).click();
await expect(page.locator('#tbRemove')).toBeDisabled();
await expect(page.locator('#tbRemove')).toHaveAttribute('title', 'Open a feed to unsubscribe from it');
await expect(page.locator('#tbRead')).toHaveAttribute('title', 'Choose an item first');
await page.locator('#feedlist .feed', { hasText: 'Test Show' }).click();
await expect(page.locator('#tbRemove')).toBeEnabled();
await expect(page.locator('#tbRemove')).toHaveAttribute('title', 'Unsubscribe from this feed');
});
test('the page loads and lists the configured feeds', async ({ page }) => { test('the page loads and lists the configured feeds', async ({ page }) => {
// Regression: a ReferenceError in the script left the shell rendered and the sidebar // Regression: a ReferenceError in the script left the shell rendered and the sidebar
// empty, with every handler below the error dead. Server-side checks all passed. // empty, with every handler below the error dead. Server-side checks all passed.

View File

@@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### 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). - 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). - 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). - 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).

View File

@@ -1604,7 +1604,7 @@ body:has(#player.on) #status{padding-bottom:3px}
dialog.ask{margin:auto 0 0;width:100%;max-width:100%} dialog.ask{margin:auto 0 0;width:100%;max-width:100%}
.card h3{font-size:22px} .card h3{font-size:22px}
.field label,.field .hint{font-size:13px} .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. */ /* A feed's settings, at a phone's sizes. */
.card.fset{padding:0} .card.fset{padding:0}
.fsetbody{padding:20px 16px 24px} .fsetbody{padding:20px 16px 24px}

View File

@@ -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> <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"> <div class="tgroup">
<button id="addFeed" title="Add a feed" aria-label="Add a feed" data-icon="plus"></button> <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> <button id="scanAll" title="Check every feed for new items" aria-label="Check every feed for new items" data-icon="scan"></button>
</div> </div>
<div class="tgroup item"> <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="tbPlay" title="Choose an item first" 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="tbRead" title="Choose an item first" 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="tbFlag" title="Choose an item first" aria-label="Pin" data-icon="pin" disabled></button>
</div> </div>
<span class="grow"></span> <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> <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>

View File

@@ -63,9 +63,9 @@ async function drawServer(){
: 'This server has no TypeSafe key (<code>TYPESAFE_KEY</code>), so each person uses their own.'}</p> : '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"')} ${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>`)} <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. // 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 () => { $<HTMLButtonElement>('#gsave').onclick = async () => {
try{ try{
await api('/api/settings', {method: 'PATCH', body: JSON.stringify({ 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. // Left alone while the server has no key to offer, rather than switched off.
...($<HTMLInputElement>('#gsig').disabled ? {} : {signals_on_server: $<HTMLInputElement>('#gsig').checked})})}); ...($<HTMLInputElement>('#gsig').disabled ? {} : {signals_on_server: $<HTMLInputElement>('#gsig').checked})})});
toast('Settings saved'); toast('Settings saved');
$<HTMLButtonElement>('#gsave').disabled = true; dim($<HTMLButtonElement>('#gsave'), 'Nothing changed yet', 'Save');
}catch(e){ toast(why(e), true); } }catch(e){ toast(why(e), true); }
}; };
} }

View File

@@ -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}){ async function renderListed(v: {title: string, icon: string, url?: string, blurb?: string}){
const box=$('#content'); const box=$('#content');
box.classList.add('plain'); box.classList.add('plain');
$<HTMLButtonElement>('#tbRemove').disabled=true; dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
syncTools(null); syncTools(null);
if(v===VIEWS[':directory']){ if(v===VIEWS[':directory']){
$<HTMLInputElement>('#epSearch').placeholder='Find a feed…'; $<HTMLInputElement>('#epSearch').placeholder='Find a feed…';

View File

@@ -28,7 +28,7 @@ function renderFeed(){
if(pl) return renderPlaylist(pl); if(pl) return renderPlaylist(pl);
const f=v?null:S.feeds.find(x=>x.id===S.feed); const f=v?null:S.feeds.find(x=>x.id===S.feed);
const sg=signalOf(S.feed); const sg=signalOf(S.feed);
$<HTMLButtonElement>('#tbRemove').disabled=!f; dim($<HTMLButtonElement>('#tbRemove'),f?null:NO_FEED,UNSUB);
syncTools(null); syncTools(null);
if(!v&&!f&&!sg){ box.innerHTML='<p class="empty">Add a feed to get started.</p>'; $('#count').textContent=''; return; } 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; const name=f?(f.title||f.id):sg?sg.name:v.title;

View File

@@ -399,8 +399,12 @@ function dragSplit(pane: HTMLElement){
/// Which item the toolbar's play, read and keep buttons act on. /// Which item the toolbar's play, read and keep buttons act on.
const cur=()=>S.entries.find(x=>entryKey(x)===S.sel); const cur=()=>S.entries.find(x=>entryKey(x)===S.sel);
function syncTools(e: Entry|null){ function syncTools(e: Entry|null){
$<HTMLButtonElement>('#tbPlay').disabled=!(e&&e.enclosures.some(isPlayable)); const pick=e?null:'Choose an item first';
$<HTMLButtonElement>('#tbRead').disabled=$<HTMLButtonElement>('#tbFlag').disabled=!e; 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 // 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 // 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. // 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>('#tbRead').setAttribute('aria-pressed',String(!!(e&&e.read)));
$<HTMLButtonElement>('#tbFlag').setAttribute('aria-pressed',String(!!(e&&e.flagged))); $<HTMLButtonElement>('#tbFlag').setAttribute('aria-pressed',String(!!(e&&e.flagged)));
$<HTMLButtonElement>('#tbFlag').innerHTML=e&&e.flagged?ICON.pinOn:ICON.pin; $<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. /// The item's text in the pane below the list, and its files in the pane beside it.

View File

@@ -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 $$('#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]')) 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'); 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); for(const ev of ['play','pause','timeupdate']) audio.addEventListener(ev,syncListening);
window.addEventListener('beforeunload',savePos); window.addEventListener('beforeunload',savePos);

View File

@@ -37,7 +37,7 @@ function playlistFolder(list: HTMLElement, q: string){
/// The folder's page: every playlist, and New playlist. /// The folder's page: every playlist, and New playlist.
function renderPlaylists(){ function renderPlaylists(){
$('#count').textContent=`Playlists: ${plural(playlists.length,'playlist')}`; $('#count').textContent=`Playlists: ${plural(playlists.length,'playlist')}`;
$<HTMLButtonElement>('#tbRemove').disabled=true; dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
syncTools(null); syncTools(null);
const box=$('#content'); const box=$('#content');
box.classList.add('plain'); 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 /// 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. /// played, which takes it out of an unplayed-only playlist.
async function renderPlaylist(p: Playlist){ async function renderPlaylist(p: Playlist){
$<HTMLButtonElement>('#tbRemove').disabled=true; dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
syncTools(null); syncTools(null);
const box=$('#content'); const box=$('#content');
box.classList.add('plain'); box.classList.add('plain');

View File

@@ -74,7 +74,7 @@ function signalFolder(list: HTMLElement, q: string){
function renderSignals(){ function renderSignals(){
const unread=S.signals.reduce((k,s)=>k+s.unread,0); const unread=S.signals.reduce((k,s)=>k+s.unread,0);
$('#count').textContent=`Signals: ${plural(S.signals.length,'signal')}, ${unread} unread`; $('#count').textContent=`Signals: ${plural(S.signals.length,'signal')}, ${unread} unread`;
$<HTMLButtonElement>('#tbRemove').disabled=true; dim($<HTMLButtonElement>('#tbRemove'),NO_FEED,UNSUB);
syncTools(null); syncTools(null);
const box=$('#content'); const box=$('#content');
box.classList.add('plain'); box.classList.add('plain');

View File

@@ -272,6 +272,10 @@ async function sendLink(title: string, url: string, btn?: HTMLElement){
toast('Link copied'); 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){ function toast(msg: string, bad?: boolean){
const t=document.createElement('div'), box=$('#toasts'); const t=document.createElement('div'), box=$('#toasts');
t.className='toast'+(bad?' bad':''); t.textContent=msg; t.className='toast'+(bad?' bad':''); t.textContent=msg;