The interface's words follow the style guide (#507)

docs/STYLE-GUIDE.md sets the rules: sentence case, "Unable to ..." and
what to do for a failure, podcast not show, address not URL, check not
scan, no dashes or symbols for words, buttons that start with a verb.
The page, admin, sign-in and the app's alert now follow it: the copy
failure, the download and sharing states, the feed's error label, the
DeadAir lines, the search boxes' clear buttons (which said only "Clear"),
the icon picker's Auto and Initials, the r key's "Refresh" (it reloads
the lists), the admin log's Scans tab. "add it in Settings" stays in
lower case: it is a link inside a sentence.

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 11:35:17 -05:00
parent 0bb7437541
commit 8261e52484
18 changed files with 219 additions and 37 deletions

View File

@@ -420,7 +420,7 @@ ms in ipx, the difference being new connections, 80-330 ms each to open (#241).
Comments explain **why**, not what. If a line looks odd, the comment says what went wrong without Comments explain **why**, not what. If a line looks odd, the comment says what went wrong without
it. No emoji, no exclamation marks, no "obviously". Prose in the UI and docs is plain English and it. No emoji, no exclamation marks, no "obviously". Prose in the UI and docs is plain English and
addressed to the person using it. addressed to the person using it. The words in the interface follow [docs/STYLE-GUIDE.md](docs/STYLE-GUIDE.md).
Every change gets one line under `## [Unreleased]` in the changelog of the service it changes, in Every change gets one line under `## [Unreleased]` in the changelog of the service it changes, in
its [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) group: Added, Changed, Deprecated, its [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) group: Added, Changed, Deprecated,

180
docs/STYLE-GUIDE.md Normal file
View File

@@ -0,0 +1,180 @@
# Writing for the iPX interface
How the words in iPX read: the page (`web/`), the admin page, sign-in, the iOS app's own alerts
(`ios/`) and the directory's and ipx-play's pages. It applies to every string a person sees:
buttons, tooltips, toasts, hints, placeholders, empty lists, errors.
iPX is a web page in English, used on a desktop browser, a phone's home screen and inside the iOS
app, by people who run their own server or were given an account on one. They know what a podcast
and a feed are; they do not know what a guid, a scan job or a 304 is.
The rules below were chosen against forty years of interface guides (Apple 1987-2014, Windows
1995 and 2010, GNOME, KDE, Android and others); the reasons for the disputed ones are in the
decision log at the end.
## Voice and tone
| Be | This | Not that |
|---|---|---|
| Plain | Nothing in progress. Episodes you start and do not finish show up here. | No in-progress entries found. |
| Direct, to "you" | Choose at least one podcast. | The user must select one or more podcasts. |
| Calm | Unable to reach iPX. Check your connection and try again. | Error! Network request failed! |
| Brief | Link copied | The link has been successfully copied to your clipboard. |
| Honest about what happens next | Saved. It applies from the next check. | Saved. |
Signals and DeadAir have their own voice, radio's signal against noise; see
[signals.md](signals.md). Everything else is the plain voice above.
## Capitalization
Sentence case everywhere: capitalize the first word and proper nouns, nothing else.
| Element | ✅ | ❌ |
|---|---|---|
| Heading, dialog title | Add a feed | Add a Feed |
| Button | Copy link | Copy Link |
| Menu item, tab | Show notes | Show Notes |
| Label, checkbox | Media types to download | Media Types To Download |
| Tooltip | Check every feed for new items | Check Every Feed For New Items |
| Placeholder | Filter feeds… | FILTER FEEDS… |
Names of iPX's own features are proper nouns and keep their capitals: **iPX, Up Next, Now Playing,
Currently Listening, All Subscriptions, Signals, DeadAir, Admin, Directory**. The filters Unread, All and In progress
are tab labels, so only their first word is capitalized. Write other products as they write
themselves: TypeSafe, Patreon, OPML, CarPlay.
## Punctuation
* **Ellipsis**: the one character `…` (U+2026), never three periods, which screen readers read
out. Use it on a command that needs more from the person before it runs (✅ Import…), on a
placeholder that invites typing (✅ Filter…), and on work in progress (✅ Loading…). Not on a
command that only opens something: ✅ Settings, ❌ Settings….
* **Periods**: a complete sentence ends with one; a fragment does not. ✅ Link copied ·
✅ There is nothing to play in this item. ❌ Link copied. Two sentences both end with periods.
* **No exclamation marks**, anywhere.
* **Colons** after a label only when what follows completes it in the same line:
✅ Downloading: *episode title*. Not after a form label.
* **Quotation marks**: curly double quotes around what the person typed: ✅ No podcast is
called “f1”.
* **No symbols for words**: ✅ light or dark, ❌ light/dark · ✅ and, ❌ & · ✅ number of
episodes, ❌ # of episodes.
* **No dashes to join clauses**; two sentences instead. ❌ Could not copy automatically — select
the URL… ✅ Unable to copy the link. Select it and copy it yourself.
## Elements
**Buttons** start with a verb and are four words at most, with no closing punctuation:
✅ Use the new address · ✅ Share link · ❌ New address · ❌ Initials. An icon-only button has a
tooltip and an `aria-label` that say the same thing. A link or button inside a sentence takes the sentence's case: ✅ Get one at typesafe.ai,
then add it in Settings. A button that toggles changes its verb:
✅ Pin / Unpin · ❌ Pin: on.
**Paired commands** match: Subscribe / Unsubscribe, Keep / Remove (an episode on this device),
Mark read / Mark unread, Show / Hide.
**Tooltips** say what the control does, in more words than its label, and name its key when it has
one: ✅ Back 15 seconds (←) · ✅ Play the next in Up Next. No closing period. Not a repeat of the
label: ❌ title="Clear" on a button reading Clear.
**Labels** are nouns or short questions: ✅ Feed address · ✅ How many of the newest
undownloaded items? Not instructions.
**Placeholders** show the form of an answer or invite a search, never replace the label:
✅ https://example.com/rss · ✅ Morning commute · ❌ Enter the feed URL here. A field that holds a
secret says whether one is set: ✅ Set. Paste a new one to replace it.
**Hints** under a control say what the person would not otherwise know: its effect, not how to use
it. ✅ Only items matching a keyword are downloaded. ❌ Type keywords into the box above. If a
control needs a paragraph, change the control.
**Empty lists** say what is missing and how it fills: ✅ No podcasts yet. Add a feed with episodes
in it, and it shows here. ❌ No results.
**Toasts** confirm something that just happened, or say why it did not. One line; the subject is
what changed, not iPX: ✅ Removed from Up Next · ❌ iPX has removed the episode from Up Next.
## Errors, warnings and confirmations
An error says **what did not happen, and what to do now**, with the why between them when it
helps. The form is `Unable to <what>. <What to do>.`
| ✅ | ❌ |
|---|---|
| Unable to play this file. Try again, or download it again. | Playback error. |
| Unable to reach iPX just now. Try again in a minute. | Request failed (502). |
| Unable to keep it on this device. Try again. | Error: QuotaExceededError |
* Never "error", "failed" or "invalid" as the message, and nothing that blames the person.
* No codes, status numbers, exception names or paths in the message. They go to the log, which
the admin page shows.
* Before writing an error, ask whether it can be prevented: a Save button stays disabled until the
form is complete, rather than "Name is required" after the click.
* When iPX can fix the problem, the message offers the fix as a button: ✅ Add it in Settings.
* One message per problem; never one alert after another.
A **confirmation** asks only before something that cannot be undone. Its title is a question; its
buttons name the action, the destructive one not the default.
| ✅ | ❌ |
|---|---|
| Unsubscribe? · *Cancel* · *Unsubscribe* | Are you sure? · *OK* · *Cancel* |
Cancel means nothing happened. If the action cannot be taken back halfway, the button is Stop.
The page's `confirm()` (and the iOS app's answer to it) can only offer Cancel and OK, so its
question names the action in full: ✅ Delete this file from the server?
**please** only when the person has to wait or do something because of iPX: ✅ Please wait while
iPX imports 214 feeds. **sorry** only when something is lost or cannot go on. Neither as filler.
## Vocabulary
One word for each thing, everywhere.
| Use | Not | Meaning |
|---|---|---|
| podcast | show, talk show, channel | a feed with audio or video in it |
| episode | track, file (as the thing played) | an item of a podcast |
| item | entry, post, article | anything a feed publishes; an episode is an item |
| feed | RSS, source, channel | what someone subscribes to |
| address | URL, link (for a feed) | where a feed or server is; "link" is what is shared |
| subscribe, unsubscribe | follow, add/remove (for feeds) | |
| download | fetch, grab | the server saving an episode's file |
| keep on this device | download, save offline, cache | the phone or browser holding a copy |
| check | scan, poll, refresh | the server reading a feed for new items |
| read, unread | seen, new, viewed | |
| pin | star, favorite, protect | an item kept from being deleted |
| sign in, sign out | log in, log out, login | |
| server | backend, instance, daemon | the iPX someone signs in to |
| token | API key, secret | what a script or another server signs in with |
| Up Next | queue, playlist | the episodes lined up to play |
| playlist | smart list, collection | a list made from chosen podcasts |
Never in the interface: guid, enclosure, entry, scan job, worker, cache, 304, ETag, OPML child,
widget, payload, and the names of the people who use iPX (no character speaks, waiting is a
spinner). OPML stays: people exporting a list meet the word in other apps.
## Localization
iPX ships in English only, and its strings live in the code, not in a resource file. Write as if
that will change: no sentence built from fragments joined in code (✅ `Kept on this device, to
play offline: ${title}` keeps the variable at the end), plurals handled as a whole sentence, not
with "(s)", dates and numbers through `toLocaleString` and the page's date helpers, and room for
half again as much text in every label.
## Decision log
| Decision | Choice | Why |
|---|---|---|
| Title or sentence case for buttons and menus | Sentence case for everything | The web has no platform rule; Windows 2010 moved everything but titles to sentence case, and iPX's strings already are. One rule, no list of words to keep lowercase |
| Case for labels, checkboxes, tooltips | Sentence case | Follows from the above; Windows 1995, Apple 2009, GNOME and KDE agree |
| Lowercase words in title case | None needed | Nothing is in title case |
| Contractions | Never: do not, cannot, it is | iPX's house style already spells them out, and KDE 2021 and GEM agree. Android and Windows 2010 use them for friendliness; iPX finds it in plain words instead |
| Failure wording | "Unable to …" | Most of the page's errors already say it; one form, not "Could not", "Cannot" and "Unable to" side by side |
| Ellipsis character | `…` | Apple 2009 and KDE: three periods break screen readers |
| Ellipsis on Settings | No | Windows' test: an ellipsis means more input is needed, not that something opens; GNOME agrees, Apple 2009 differs |
| Room for translation | Half again | KDE's 50% over GNOME's 30%; short labels grow most |
| Exclamation marks | Never | House style; KDE and GEM keep them out of errors |
| OK and Cancel | Specific verbs; OK only to acknowledge or where `confirm()` allows nothing else; Cancel only when nothing changed, otherwise Stop | Mac 1992, Windows 1995 and Apple 2009 over Motif's standard pair |
| Button length | Four words at most | Mac 1992 says three; "Use the new address" needs four and is clearer than any three |
| Tone | Plain and friendly, second person, never jokey in errors | Android 2012 and Windows 2010; Signals keeps its own radio voice |
| please and sorry | The Windows 2010 rule: please when the person is put out, sorry when something is lost | Avoids the filler apology Android 2012 warns against |

View File

@@ -23,6 +23,7 @@ The iOS app, `ios/`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.
### Changed ### Changed
- The alert for a server out of reach reads "Unable to reach", with its buttons in sentence case, as the page writes (#507).
- The player, the badge and CarPlay talk to ipx in protobuf rather than JSON, which is smaller and quicker to read; they need an ipx with protobuf (#465), and a place saved offline by an older build is still sent (#469). - The player, the badge and CarPlay talk to ipx in protobuf rather than JSON, which is smaller and quicker to read; they need an ipx with protobuf (#465), and a place saved offline by an older build is still sent (#469).
### Fixed ### Fixed

View File

@@ -158,12 +158,12 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg
} }
triedCache = false triedCache = false
let host = Server.url?.host ?? "the server" let host = Server.url?.host ?? "the server"
let alert = UIAlertController(title: "Cannot reach \(host)", let alert = UIAlertController(title: "Unable to reach \(host)",
message: error.localizedDescription, preferredStyle: .alert) message: error.localizedDescription, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Try Again", style: .default) { [weak self] _ in alert.addAction(UIAlertAction(title: "Try again", style: .default) { [weak self] _ in
if let url = Server.url { self?.webView.load(URLRequest(url: url)) } if let url = Server.url { self?.webView.load(URLRequest(url: url)) }
}) })
alert.addAction(UIAlertAction(title: "Change Server", style: .default) { [weak self] _ in alert.addAction(UIAlertAction(title: "Change server", style: .default) { [weak self] _ in
self?.askForServer() self?.askForServer()
}) })
if presentedViewController == nil { present(alert, animated: true) } if presentedViewController == nil { present(alert, animated: true) }

View File

@@ -367,7 +367,7 @@ test('Share says why an episode gets no page anyone can play, and warns of a key
const note = (why: string | null, url: string) => run(`noLinkNote(${JSON.stringify(why)}, ${JSON.stringify(url)})`) as string; const note = (why: string | null, url: string) => run(`noLinkNote(${JSON.stringify(why)}, ${JSON.stringify(url)})`) as string;
const paid = 'https://c10.patreonusercdn.com/ep.mp3?token-hash=abc'; const paid = 'https://c10.patreonusercdn.com/ep.mp3?token-hash=abc';
assert.match(note('private', paid), /private to you.*includes your own access/s); assert.match(note('private', paid), /private to you.*includes your own access/s);
assert.match(note('failed', 'https://example.com/ep.mp3'), /could not be made just now/); assert.match(note('failed', 'https://example.com/ep.mp3'), /Unable to make a page anyone can play just now/);
assert.doesNotMatch(note('failed', 'https://example.com/ep.mp3'), /own access/); assert.doesNotMatch(note('failed', 'https://example.com/ep.mp3'), /own access/);
// A server with no ipx-play shares as it always has, with no reason to give. // A server with no ipx-play shares as it always has, with no reason to give.
assert.equal(note('not_set_up', 'https://example.com/ep.mp3'), ''); assert.equal(note('not_set_up', 'https://example.com/ep.mp3'), '');
@@ -388,7 +388,7 @@ test('a file\'s box says where it is: the publisher, on its way, iPX, this devic
const where = (x: object) => run(`whereText(${JSON.stringify({ id: 7, deadair: 0, path: null, state: 'held', ...x })})`) as string; const where = (x: object) => run(`whereText(${JSON.stringify({ id: 7, deadair: 0, path: null, state: 'held', ...x })})`) as string;
assert.equal(where({}), 'Publisher only'); assert.equal(where({}), 'Publisher only');
assert.equal(where({ state: 'pending' }), 'Queued for iPX'); assert.equal(where({ state: 'pending' }), 'Queued for iPX');
assert.equal(where({ state: 'error' }), 'iPX could not download it'); assert.equal(where({ state: 'error' }), 'Unable to download to iPX');
run(`want(7, 'Ep')`); run(`want(7, 'Ep')`);
assert.equal(where({ state: 'pending' }), 'Downloading to iPX, then this device'); assert.equal(where({ state: 'pending' }), 'Downloading to iPX, then this device');
run('unwant(7)'); run('unwant(7)');

View File

@@ -1618,7 +1618,7 @@ test('a download by hand fills its bar and names its file, and only on its own s
await slow.click(); await slow.click();
await page.locator('#files button[title="Download to iPX"]').click(); await page.locator('#files button[title="Download to iPX"]').click();
await expect(slow.locator('.dlbar.live')).toBeAttached({ timeout: 10_000 }); await expect(slow.locator('.dlbar.live')).toBeAttached({ timeout: 10_000 });
await expect(page.locator('#count')).toContainText(/downloading .+ — \d+%/); await expect(page.locator('#count')).toContainText(/Downloading .+: \d+%/);
await expect(page.locator('.toast', { hasText: /^Downloaded .+\.mp3/ })).toBeVisible({ timeout: 20_000 }); await expect(page.locator('.toast', { hasText: /^Downloaded .+\.mp3/ })).toBeVisible({ timeout: 20_000 });
await expect(slow.locator('.kind.here')).toBeVisible({ timeout: 5_000 }); await expect(slow.locator('.kind.here')).toBeVisible({ timeout: 5_000 });
@@ -3132,7 +3132,7 @@ test('a dialog keeps the keyboard inside it and gives it back on closing', async
await expect(page.locator('#modalCard[role=dialog]')).toHaveAttribute('aria-labelledby', /.+/); await expect(page.locator('#modalCard[role=dialog]')).toHaveAttribute('aria-labelledby', /.+/);
await expect(page.locator('#nurl')).toBeFocused(); await expect(page.locator('#nurl')).toBeFocused();
// Labels name their boxes (#307). // Labels name their boxes (#307).
await expect(page.getByRole('textbox', { name: 'Feed URL' })).toHaveCount(1); await expect(page.getByRole('textbox', { name: 'Feed address' })).toHaveCount(1);
for (let i = 0; i < 8; i++) { for (let i = 0; i < 8; i++) {
await page.keyboard.press('Tab'); await page.keyboard.press('Tab');
// Past the last control Tab goes to the browser's own toolbar (the body, from here), never the page behind. // Past the last control Tab goes to the browser's own toolbar (the body, from here), never the page behind.

View File

@@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- 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).
- A folder's triangle in the feed list is at its row's end, before the count, so every feed lines up with the places above at the list's edge, and on a phone Playlists' and Signals' + button sits beside the title rather than on a line of its own (#486, #487). - A folder's triangle in the feed list is at its row's end, before the count, so every feed lines up with the places above at the list's edge, and on a phone Playlists' and Signals' + button sits beside the title rather than on a line of its own (#486, #487).
- On a phone, an episode's title starts at the row's edge: the read and pin buttons are gone from the row, an unread episode has a dot before its title and a pinned one a pin under it, and both are changed from the reader's actions (#484). - On a phone, an episode's title starts at the row's edge: the read and pin buttons are gone from the row, an unread episode has a dot before its title and a pinned one a pin under it, and both are changed from the reader's actions (#484).

View File

@@ -28,7 +28,7 @@
<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="Pin the selected item, so it is never deleted" 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" aria-label="Clear" 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>
<div class="tgroup" id="admintools"> <div class="tgroup" id="admintools">
<button id="prefs" title="Settings" aria-label="Settings" data-icon="settings"></button> <button id="prefs" title="Settings" aria-label="Settings" data-icon="settings"></button>
<a id="admin" href="/admin" title="Admin: the server's settings, accounts and the log" aria-label="Admin" data-icon="admin"></a> <a id="admin" href="/admin" title="Admin: the server's settings, accounts and the log" aria-label="Admin" data-icon="admin"></a>
@@ -36,7 +36,7 @@
</header> </header>
<div id="shell"> <div id="shell">
<aside id="sidebar"> <aside id="sidebar">
<div class="searchwrap"><span class="clearable"><input type="search" id="feedFilter" placeholder="Filter feeds…" aria-label="Filter feeds"><button type="button" class="clearx" title="Clear" aria-label="Clear" data-icon="close"></button></span></div> <div class="searchwrap"><span class="clearable"><input type="search" id="feedFilter" placeholder="Filter feeds…" aria-label="Filter feeds"><button type="button" class="clearx" title="Clear the filter" aria-label="Clear the filter" data-icon="close"></button></span></div>
<div id="feedlist"></div> <div id="feedlist"></div>
<div class="sidefoot"> <div class="sidefoot">
<div class="who"><span id="who"></span><button id="signout" title="Sign out" aria-label="Sign out" data-icon="signout"></button></div> <div class="who"><span id="who"></span><button id="signout" title="Sign out" aria-label="Sign out" data-icon="signout"></button></div>

View File

@@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark light"> <meta name="color-scheme" content="dark light">
<title>Sign in — iPX</title> <title>Sign in to iPX</title>
<link rel="icon" type="image/png" sizes="128x128" href="/favicon.png" media="(prefers-color-scheme:light)"> <link rel="icon" type="image/png" sizes="128x128" href="/favicon.png" media="(prefers-color-scheme:light)">
<link rel="icon" type="image/png" sizes="128x128" href="/favicon-dark.png" media="(prefers-color-scheme:dark)"> <link rel="icon" type="image/png" sizes="128x128" href="/favicon-dark.png" media="(prefers-color-scheme:dark)">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">

View File

@@ -156,7 +156,7 @@ async function drawDirectoryStatus(){
const sh = s.shared; const sh = s.shared;
if(sh){ if(sh){
const when = new Date(sh.at * 1000).toLocaleString(); const when = new Date(sh.at * 1000).toLocaleString();
lines.push(sh.error ? `Sharing failed at ${esc(when)}: ${esc(sh.error)}` lines.push(sh.error ? `Unable to share at ${esc(when)}: ${esc(sh.error)}`
: `Shared ${plural(sh.accepted, 'feed')} at ${esc(when)}.` + : `Shared ${plural(sh.accepted, 'feed')} at ${esc(when)}.` +
(sh.refused_private ? ` The directory refused ${plural(sh.refused_private, 'feed')} as private.` : '') + (sh.refused_private ? ` The directory refused ${plural(sh.refused_private, 'feed')} as private.` : '') +
(sh.refused_blocked ? ` ${plural(sh.refused_blocked, 'feed')} the directory has removed.` : '')); (sh.refused_blocked ? ` ${plural(sh.refused_blocked, 'feed')} the directory has removed.` : ''));
@@ -272,7 +272,7 @@ function drawLogView(){
<div class="tabs" id="logtabs"> <div class="tabs" id="logtabs">
${Object.keys(LOG_TABS).map(t => ${Object.keys(LOG_TABS).map(t =>
`<button data-t="${t}" class="${logTab === t ? 'on' : ''}" title="${LOG_TAB_SAYS[t]}">${ `<button data-t="${t}" class="${logTab === t ? 'on' : ''}" title="${LOG_TAB_SAYS[t]}">${
{all: 'All', daemon: 'Daemon I/O', scan: 'Scans', web: 'HTTP'}[t]}</button>`).join('')} {all: 'All', daemon: 'Daemon I/O', scan: 'Checks', web: 'HTTP'}[t]}</button>`).join('')}
</div></div> </div></div>
<div class="logbar"> <div class="logbar">
<select id="loglevel" aria-label="Level"> <select id="loglevel" aria-label="Level">

View File

@@ -35,8 +35,8 @@ $('#modal').onclick=(e: MouseEvent)=>{ if((e.target as Element).id==='modal') cl
$<HTMLButtonElement>('#addFeed').onclick=()=>{ $<HTMLButtonElement>('#addFeed').onclick=()=>{
openModal(`<h3>Add a feed</h3> openModal(`<h3>Add a feed</h3>
<div class="field"><label for="nurl">Feed URL</label><input type="text" id="nurl" placeholder="https://example.com/rss"> <div class="field"><label for="nurl">Feed address</label><input type="text" id="nurl" placeholder="https://example.com/rss">
<span class="hint">A Patreon token on its own adds every show from that creator.</span></div> <span class="hint">A Patreon token on its own adds every podcast from that creator.</span></div>
<div class="field"><label for="nkw">Keywords (optional, comma separated)</label> <div class="field"><label for="nkw">Keywords (optional, comma separated)</label>
<input type="text" id="nkw"><span class="hint">Only items matching a keyword are downloaded.</span></div> <input type="text" id="nkw"><span class="hint">Only items matching a keyword are downloaded.</span></div>
<label class="check"><input type="checkbox" id="nexp"> Allow items marked explicit</label> <label class="check"><input type="checkbox" id="nexp"> Allow items marked explicit</label>
@@ -459,7 +459,7 @@ function due(ts: number){
function deadSavedText(me: Me|null){ function deadSavedText(me: Me|null){
const s=me&&me.deadair_saved||0; const s=me&&me.deadair_saved||0;
return s?`It has saved you ${spanText(s)} of dead air, on episodes you heard three quarters of or more.` return s?`It has saved you ${spanText(s)} of dead air, on episodes you heard three quarters of or more.`
:'Turn it on in a show\'s settings, or beside the speed while it plays, to cut the dead air from it.'; :'Turn it on in a podcast\'s settings, or beside the speed while it plays, to cut the dead air from it.';
} }
async function prefsModal(){ async function prefsModal(){
@@ -474,7 +474,7 @@ async function prefsModal(){
<div class="field" id="smodefield"${THEMES[theme.name].modes?'':' hidden'}><label for="smode">Light or dark</label> <div class="field" id="smodefield"${THEMES[theme.name].modes?'':' hidden'}><label for="smode">Light or dark</label>
<select id="smode">${Object.entries(MODES).map(([k,t])=> <select id="smode">${Object.entries(MODES).map(([k,t])=>
`<option value="${k}"${theme.mode===k?' selected':''}>${esc(t)}</option>`).join('')}</select> `<option value="${k}"${theme.mode===k?' selected':''}>${esc(t)}</option>`).join('')}</select>
<span class="hint">Auto follows your system's light/dark setting.</span></div> <span class="hint">Auto follows your system's light or dark setting.</span></div>
<div class="field"><label for="sfont">Interface font</label> <div class="field"><label for="sfont">Interface font</label>
<select id="sfont">${Object.entries(FONTS).map(([k,t])=> <select id="sfont">${Object.entries(FONTS).map(([k,t])=>
`<option value="${k}"${font===k?' selected':''}>${esc(t)}</option>`).join('')}</select></div> `<option value="${k}"${font===k?' selected':''}>${esc(t)}</option>`).join('')}</select></div>
@@ -654,7 +654,7 @@ function settingsModal(f: Feed, newUrl?: string){
// Each part named in a column of its own, the controls beside it (#290): the dialog had grown one // Each part named in a column of its own, the controls beside it (#290): the dialog had grown one
// captioned setting at a time into a single column three screens long on a phone. // captioned setting at a time into a single column three screens long on a phone.
const sect=(title: string, body: string)=>`<section class="fsec"><h4>${title}</h4><div class="fsecin">${body}</div></section>`; const sect=(title: string, body: string)=>`<section class="fsec"><h4>${title}</h4><div class="fsecin">${body}</div></section>`;
const these=isGroup?'these shows':'this show'; const these=isGroup?'these podcasts':'this podcast';
// The places in the sidebar this show's items go to, drawn as the sidebar draws them (#288, #289). // The places in the sidebar this show's items go to, drawn as the sidebar draws them (#288, #289).
const place=(id: string, key: 'hide_from_all'|'hide_from_signals', icon: string, title: string)=>{ const place=(id: string, key: 'hide_from_all'|'hide_from_signals', icon: string, title: string)=>{
const byList=f.group?S.feeds.find(g=>g.id===f.group&&g[key]):undefined; const byList=f.group?S.feeds.find(g=>g.id===f.group&&g[key]):undefined;
@@ -712,7 +712,7 @@ function settingsModal(f: Feed, newUrl?: string){
// The download limit, said as what it does. A number in a box hid that it is a window on the // The download limit, said as what it does. A number in a box hid that it is a window on the
// newest items, not a pace through the back catalogue (#97). // newest items, not a pace through the back catalogue (#97).
const each=isGroup?' of each show':''; const each=isGroup?' of each podcast':'';
const older=' Older ones stay listed, to download by hand.'; const older=' Older ones stay listed, to download by hand.';
const caption=()=>mode==='newest' const caption=()=>mode==='newest'
? `Downloads the newest <input type="number" id="smax" min="1" value="${newest}" ? `Downloads the newest <input type="number" id="smax" min="1" value="${newest}"
@@ -809,7 +809,7 @@ function downloadLatestModal(f: Feed){
openModal(`<h3>Download latest items</h3> openModal(`<h3>Download latest items</h3>
<div class="field"><label for="dcount">How many of the newest undownloaded items?</label> <div class="field"><label for="dcount">How many of the newest undownloaded items?</label>
<input type="number" id="dcount" min="1" max="100" value="5"> <input type="number" id="dcount" min="1" max="100" value="5">
<span class="hint">Queued immediately, ignoring the per-scan limit.</span></div> <span class="hint">Downloaded now, past the limit on each check.</span></div>
<div class="cardacts"><button class="btn ico" onclick="closeModal()" title="Cancel" aria-label="Cancel">${ICON.close}</button> <div class="cardacts"><button class="btn ico" onclick="closeModal()" title="Cancel" aria-label="Cancel">${ICON.close}</button>
<button class="btn ico primary" id="dgo" title="Download" aria-label="Download">${ICON.download}</button></div>`); <button class="btn ico primary" id="dgo" title="Download" aria-label="Download">${ICON.download}</button></div>`);
$<HTMLButtonElement>('#dgo').onclick=async()=>{ $<HTMLButtonElement>('#dgo').onclick=async()=>{

View File

@@ -31,7 +31,7 @@ function connect(){
// every pending bar at once, so adding a feed looked like it was fetching the lot. // every pending bar at once, so adding a feed looked like it was fetching the lot.
const bar=document.querySelector<HTMLElement>(`.dlbar[data-bar="${ev.enclosure}"] i`); const bar=document.querySelector<HTMLElement>(`.dlbar[data-bar="${ev.enclosure}"] i`);
if(bar){ bar.style.width=pct+'%'; bar.parentElement!.classList.add('live'); } if(bar){ bar.style.width=pct+'%'; bar.parentElement!.classList.add('live'); }
$('#count') && ($('#count').textContent=`downloading ${ev.file} — ${pct.toFixed(0)}%`); $('#count') && ($('#count').textContent=`Downloading ${ev.file}: ${pct.toFixed(0)}%`);
} }
else if(ev.ev==='download_done'){ else if(ev.ev==='download_done'){
const bar=document.querySelector(`.dlbar[data-bar="${ev.enclosure}"]`); const bar=document.querySelector(`.dlbar[data-bar="${ev.enclosure}"]`);

View File

@@ -181,11 +181,11 @@ function renderFeeds(){
// The mark sits on the artwork, the thing the eye scans the list by, and the line under // The mark sits on the artwork, the thing the eye scans the list by, and the line under
// the name says what is wrong in place of the counts. // the name says what is wrong in place of the counts.
`<span class="fart">${mine.length?folderArt(f,mine):artHTML(f.image,f.title||f.id)}`+ `<span class="fart">${mine.length?folderArt(f,mine):artHTML(f.image,f.title||f.id)}`+
(err?`<span class="ferr" role="img" title="${esc(err)}" aria-label="Error: ${esc(err)}">${ICON.alert}</span>`:'')+ (err?`<span class="ferr" role="img" title="${esc(err)}" aria-label="Not updating: ${esc(err)}">${ICON.alert}</span>`:'')+
(f.pinned?`<span class="fpin" role="img" title="Pinned" aria-label="Pinned">${ICON.pinOn}</span>`:'')+`</span>`+ (f.pinned?`<span class="fpin" role="img" title="Pinned" aria-label="Pinned">${ICON.pinOn}</span>`:'')+`</span>`+
`<div class="txt"><b>${esc(f.title||f.id)}</b><small>`+ `<div class="txt"><b>${esc(f.title||f.id)}</b><small>`+
(nbad?`${plural(nbad,'feed')} not updating` (nbad?`${plural(nbad,'feed')} not updating`
:err?esc(f.failing?.reason||'The last check failed') :err?esc(f.failing?.reason||'Unable to read it at the last check')
:`${mine.length?plural(mine.length,'feed'):plural(eps,'item')} · ${saved} downloaded`)+ :`${mine.length?plural(mine.length,'feed'):plural(eps,'item')} · ${saved} downloaded`)+
`</small></div>`+ `</small></div>`+
(f.orphaned?'<span class="tag" title="No longer listed, kept because it has downloads">Gone</span>':'')+ (f.orphaned?'<span class="tag" title="No longer listed, kept because it has downloads">Gone</span>':'')+

View File

@@ -266,7 +266,7 @@ function kindIcon(enc: Enclosure){
const k=kindOf(enc); const k=kindOf(enc);
const i=(<Record<string,string>>{audio:ICON.audio,video:ICON.video,image:ICON.image,pdf:ICON.doc,torrent:ICON.torrent})[k]||ICON.file; const i=(<Record<string,string>>{audio:ICON.audio,video:ICON.video,image:ICON.image,pdf:ICON.doc,torrent:ICON.torrent})[k]||ICON.file;
const [cls,label]=enc.path ? [' here',`${k}, downloaded`] const [cls,label]=enc.path ? [' here',`${k}, downloaded`]
: enc.state==='error' ? [' bad',`${k}, download failed${enc.last_error?': '+enc.last_error:''}`] : enc.state==='error' ? [' bad',`${k}, unable to download${enc.last_error?': '+enc.last_error:''}`]
: ['',k]; : ['',k];
return `<span class="kind${cls}" title="${esc(label)}" aria-label="${esc(label)}">${i}</span>`; return `<span class="kind${cls}" title="${esc(label)}" aria-label="${esc(label)}">${i}</span>`;
} }
@@ -503,7 +503,7 @@ function whereText(x: Enclosure){
if(here) return 'On this device'; if(here) return 'On this device';
if(wanted.has(x.id)) return 'Downloading to iPX, then this device'; if(wanted.has(x.id)) return 'Downloading to iPX, then this device';
if(x.state==='pending') return 'Queued for iPX'; if(x.state==='pending') return 'Queued for iPX';
if(x.state==='error') return 'iPX could not download it'; if(x.state==='error') return 'Unable to download to iPX';
return 'Publisher only'; return 'Publisher only';
} }
return here ? 'On iPX and this device' : busy ? 'On iPX, downloading to this device' : 'On iPX'; return here ? 'On iPX and this device' : busy ? 'On iPX, downloading to this device' : 'On iPX';
@@ -589,7 +589,7 @@ const shareAt=(url: string, secs: number)=>secs>=5 ? `${url}?t=${Math.floor(secs
function noLinkNote(why: string|null, url: string): string{ function noLinkNote(why: string|null, url: string): string{
const notes: string[]=[]; const notes: string[]=[];
if(why==='private') notes.push('This podcast\'s feed is private to you, so it gets no page anyone can play, and its file is never shared: this is the episode\'s own page.'); if(why==='private') notes.push('This podcast\'s feed is private to you, so it gets no page anyone can play, and its file is never shared: this is the episode\'s own page.');
else if(why==='failed') notes.push('The page anyone can play could not be made just now, so this is the episode\'s own address. Try again later for a link to it.'); else if(why==='failed') notes.push('Unable to make a page anyone can play just now, so this is the episode\'s own address. Try again later for a link to it.');
if(carriesAccess(url)) notes.push(ACCESS_WARNING); if(carriesAccess(url)) notes.push(ACCESS_WARNING);
return notes.map(n=>`<p class="hint">${esc(n)}</p>`).join(''); return notes.map(n=>`<p class="hint">${esc(n)}</p>`).join('');
} }

View File

@@ -11,5 +11,5 @@ document.getElementById('f')!.onsubmit = async e => {
}), }),
}); });
if (r.ok) location.href = '/'; if (r.ok) location.href = '/';
else msg.textContent = await r.text() || 'Sign in failed'; else msg.textContent = await r.text() || 'Unable to sign in. Check your name and password.';
}; };

View File

@@ -33,7 +33,7 @@ function setSrc(url: string): Promise<void>|null{
return ready.then(()=>{ return ready.then(()=>{
// Its playlist and audio requests join the trace of the tap that played them (#192). // Its playlist and audio requests join the trace of the tap that played them (#192).
hls=new w.Hls({xhrSetup:(xhr: XMLHttpRequest)=>xhr.setRequestHeader('traceparent',traceparent())}); hls=new w.Hls({xhrSetup:(xhr: XMLHttpRequest)=>xhr.setRequestHeader('traceparent',traceparent())});
hls.on(w.Hls.Events.ERROR,(_: string,d: {fatal: boolean, type: string, details: string})=>{ if(d.fatal){ toast('Unable to play the DeadAir version. Try again, or turn DeadAir off for this show.',true); hls.on(w.Hls.Events.ERROR,(_: string,d: {fatal: boolean, type: string, details: string})=>{ if(d.fatal){ toast('Unable to play the DeadAir version. Try again, or turn DeadAir off for this podcast.',true);
report('player_error',{msg:`hls.js: ${d.type} ${d.details}`,feed:player.feed,enclosure:player.enc}); } }); report('player_error',{msg:`hls.js: ${d.type} ${d.details}`,feed:player.feed,enclosure:player.enc}); } });
hls.loadSource(url); hls.attachMedia(audio); hls.loadSource(url); hls.attachMedia(audio);
}); });
@@ -247,7 +247,7 @@ function paintDead(){
if(!f||b.hidden) return; if(!f||b.hidden) return;
b.setAttribute('aria-pressed',String(!!f.deadair)); b.setAttribute('aria-pressed',String(!!f.deadair));
b.innerHTML=tile(f.deadair?'deadair-on':'deadair-off'); b.innerHTML=tile(f.deadair?'deadair-on':'deadair-off');
b.title=f.deadair?'DeadAir is cutting the dead air from this show':'DeadAir: cut the dead air from this show'; b.title=f.deadair?'DeadAir is cutting the dead air from this podcast':'DeadAir: cut the dead air from this podcast';
} }
$<HTMLButtonElement>('#pdead').onclick=async()=>{ $<HTMLButtonElement>('#pdead').onclick=async()=>{
const f=S.feeds.find(x=>x.id===player.feed); if(!f) return; const f=S.feeds.find(x=>x.id===player.feed); if(!f) return;
@@ -256,8 +256,8 @@ $<HTMLButtonElement>('#pdead').onclick=async()=>{
catch(err){ toast(why(err),true); return; } catch(err){ toast(why(err),true); return; }
f.deadair=on; paintDead(); f.deadair=on; paintDead();
const switched=await switchVersion(); const switched=await switchVersion();
toast(!on?'DeadAir is off for this show':switched?'DeadAir is cutting the dead air from this show' toast(!on?'DeadAir is off for this podcast':switched?'DeadAir is cutting the dead air from this podcast'
:'DeadAir is on for this show. Episodes lose their dead air a few minutes after they download.'); :'DeadAir is on for this podcast. Episodes lose their dead air a few minutes after they download.');
renderEntries(); renderEntries();
}; };
/// Carries on at the same place in the other version of what is playing, once DeadAir has been /// Carries on at the same place in the other version of what is playing, once DeadAir has been
@@ -352,7 +352,7 @@ function keysModal(){
[g('a'),'All Subscriptions'],[g('d'),'Directory'], [g('a'),'All Subscriptions'],[g('d'),'Directory'],
[g('u'),'Up Next'],[g('l'),'Currently Listening'],[g('s'),'Settings'], [g('u'),'Up Next'],[g('l'),'Currently Listening'],[g('s'),'Settings'],
[k('Shift')+' '+k('J'),'Next feed'],[k('Shift')+' '+k('K'),'Previous feed'], [k('Shift')+' '+k('J'),'Next feed'],[k('Shift')+' '+k('K'),'Previous feed'],
[k('/'),'Search items, Currently Listening or the Directory'],[k('r'),'Refresh'],[k('['),'Show or hide the feed list'], [k('/'),'Search items, Currently Listening or the Directory'],[k('r'),'Reload the lists'],[k('['),'Show or hide the feed list'],
['Items'], ['Items'],
[k('j')+' or '+k('n'),'Next item'],[k('k')+' or '+k('p'),'Previous item'], [k('j')+' or '+k('n'),'Next item'],[k('k')+' or '+k('p'),'Previous item'],
[k('Shift')+' '+k('A'),'Mark all read'], [k('Shift')+' '+k('A'),'Mark all read'],

View File

@@ -144,8 +144,8 @@ function signalModal(sg?: Signal){
<input type="text" id="sgname" value="${esc(sg?.name||'')}" placeholder="Formula 1"></div> <input type="text" id="sgname" value="${esc(sg?.name||'')}" placeholder="Formula 1"></div>
<div id="sgpicker" hidden> <div id="sgpicker" hidden>
<div class="inline">${searchBox('<input type="search" id="sgiconq" placeholder="Search icons: robot, car, music…" autocomplete="off">')} <div class="inline">${searchBox('<input type="search" id="sgiconq" placeholder="Search icons: robot, car, music…" autocomplete="off">')}
<button type="button" class="dlink" id="sgjev" title="Pick an icon for me">Auto</button> <button type="button" class="dlink" id="sgjev" title="Pick an icon for me">Pick for me</button>
<button type="button" class="dlink" id="sgnoicon">Initials</button></div> <button type="button" class="dlink" id="sgnoicon">Use initials</button></div>
<div class="icongrid" id="sgicons" role="listbox" aria-label="Icons"></div> <div class="icongrid" id="sgicons" role="listbox" aria-label="Icons"></div>
</div></div> </div></div>
<div class="field"><label for="sgkwin">Listen for</label> <div class="field"><label for="sgkwin">Listen for</label>

View File

@@ -114,7 +114,7 @@ for(const b of $$('[data-icon]')) b.insertAdjacentHTML('afterbegin',ICON[b.datas
/// A search box with an x at its right end that clears it, shown once something is typed (#291). /// A search box with an x at its right end that clears it, shown once something is typed (#291).
const searchBox=(input: string, cls='')=> const searchBox=(input: string, cls='')=>
`<span class="clearable ${cls}">${input}<button type="button" class="clearx" title="Clear" aria-label="Clear">${ICON.close}</button></span>`; `<span class="clearable ${cls}">${input}<button type="button" class="clearx" title="Clear the search" aria-label="Clear the search">${ICON.close}</button></span>`;
// Every box's x, wherever it is drawn: cleared as if the typing were deleted, so the box's own input // Every box's x, wherever it is drawn: cleared as if the typing were deleted, so the box's own input
// handler runs and its list comes back whole. // handler runs and its list comes back whole.
document.addEventListener('click',(e: MouseEvent)=>{ document.addEventListener('click',(e: MouseEvent)=>{
@@ -204,7 +204,7 @@ async function api(url: string, opts?: RequestInit): Promise<any>{
// whole 502 page (#219). A 500's words are the daemon's own workings, which its log already // whole 502 page (#219). A 500's words are the daemon's own workings, which its log already
// has; they are not something to show the person who pressed the button (#304). // has; they are not something to show the person who pressed the button (#304).
const said=!/html/.test(r.headers.get('Content-Type')||'')&&await r.text().catch(()=>''); const said=!/html/.test(r.headers.get('Content-Type')||'')&&await r.text().catch(()=>'');
throw new Error(r.status===500 ? 'iPX could not do that just now. Try again in a minute.' throw new Error(r.status===500 ? 'Unable to do that just now. Try again in a minute.'
: said || 'Unable to reach iPX just now. Try again in a minute.'); : said || 'Unable to reach iPX just now. Try again in a minute.');
} }
const pb=wireType(r.headers.get('Content-Type')); const pb=wireType(r.headers.get('Content-Type'));
@@ -237,7 +237,7 @@ async function copyText(text: string,btn?: HTMLElement){
flash(true); flash(true);
}catch(e){ }catch(e){
flash(false); flash(false);
toast('Could not copy automatically — select the URL and copy it manually',true); toast('Unable to copy the link. Select it and copy it yourself.',true);
} }
} }