android: what the phone says when things go wrong
Fifty-nine places put a raw Rust string into a field a person reads, and the red toast drew it verbatim — a phone in a lift showed "could not reach server: io: failed to lookup address information" under the password box. One translator, src/mobile/trouble.js, called where an error is DRAWN rather than where it is caught: the stores keep what Rust said and only the sentence on screen is ours, so every sink is fixed at once. Five screens that drew a failed read as an empty answer stop lying — Tracks no longer reports a broken database as an empty library, a playlist that could not be read is not an empty playlist, the lyrics face says a lookup failed instead of "no lyrics" and finally carries the ⋯ that reaches Paste lyrics, Gaps says why it could not reach the catalogue, and Search signed out says so where it used to render nothing at all. The room list, which is fire-and-forget over the wire, gets a twelve-second end and a Try again. rescan_library ran prune_missing() first, which deletes every track row whose file does not exist — so one tap on You → Rescan library with the folder unreachable emptied the whole index and returned Ok(()). It now makes the root if it is merely not there yet and refuses if it cannot be read, and You draws the path with what to do about it. The mock grew a weather system so the walk can drive all of this: fail, answer, offline and clear, checked before dispatch so a plugin command arms like any other. Nine mock steps and one on the phone — the first steps in thirty rounds that ever made a command reject or saw the client signed out — and the last of them puts the weather away and leaves the app as it found it.
This commit is contained in:
1 parent
44eda8dff5
commit
052e15302b
22 files changed
+537
-35
No files matched your search
@@ -62,6 +62,9 @@
|
||||
let gapRows = $state({}); // foldKey(artist) → catalog rows not owned
|
||||
let gapOpen = $state({});
|
||||
let gapLoading = $state({});
|
||||
/* the lookup's catch was empty, so a failed reach put the line back to
|
||||
"See what's missing" and it could be tapped for ever with no reason */
|
||||
let gapErr = $state({});
|
||||
const shelves = $derived(arts.filter((ar) => followedEntry(ar.name)));
|
||||
const ownedTitles = (name) => new Set(lib.albums.filter((a) => foldKey(a.artist) === foldKey(name)).map((a) => looseTitle(a.title)));
|
||||
async function toggleGaps(name) {
|
||||
@@ -71,6 +74,7 @@
|
||||
if (!follow) return;
|
||||
if (!gapRows[key] && !gapLoading[key]) {
|
||||
gapLoading = { ...gapLoading, [key]: true };
|
||||
gapErr = { ...gapErr, [key]: "" };
|
||||
try {
|
||||
const page = await api.catalogArtist(follow.artist_id);
|
||||
const released = (page?.albums ?? []).filter((a) => !isUpcoming(a) && !a.appears_on);
|
||||
@@ -78,7 +82,7 @@
|
||||
gapRows = { ...gapRows, [key]: released.filter((r) => !owned.has(looseTitle(r.title))) };
|
||||
gapTotals = { ...gapTotals, [key]: { total: released.length } };
|
||||
try { localStorage.setItem(GAPS_KEY, JSON.stringify(gapTotals)); } catch { /* ignore */ }
|
||||
} catch { /* the line stays collapsed; nothing is invented */ }
|
||||
} catch (e) { gapErr = { ...gapErr, [key]: String(e) }; }
|
||||
gapLoading = { ...gapLoading, [key]: false };
|
||||
}
|
||||
if (gapRows[key]) gapOpen = { ...gapOpen, [key]: true };
|
||||
@@ -171,7 +175,7 @@
|
||||
</button>
|
||||
{#if count !== 0}
|
||||
<button class="gapline" onclick={() => toggleGaps(ar.name)} aria-expanded={!!gapOpen[key]}>
|
||||
{#if gapLoading[key]}Checking the catalogue…{:else if count != null}<b>{count}</b> more released{:else}See what's missing{/if}
|
||||
{#if gapLoading[key]}Checking the catalogue…{:else if gapErr[key]}Couldn't reach the catalogue — tap to try again{:else if count != null}<b>{count}</b> more released{:else}See what's missing{/if}
|
||||
<span class="cta">{gapOpen[key] ? "hide" : "show"}<Icon name={gapOpen[key] ? "chevron-down" : "chevron-right"} size={12} /></span>
|
||||
</button>
|
||||
{:else}
|
||||
|
||||
Reference in new issue
Block a user