diff --git a/README.md b/README.md index 92cd38a..2be0bb1 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ Built in three slices: aggregates artists similar to the ones you follow into a manual review feed of suggested **artists** and **albums** at `/discover`; **Follow** and **Want** reuse the slice-2 follow / wanted flows, **Dismiss** is permanent. Plus a - web-side seed-search box. No Spotify (its recommendation APIs are dead for new - apps). + web-side seed-search box. Every suggestion and seed-search result opens a + read-only **artist preview** (`/discover/artist/[mbid]`) — discography, + per-album tracklists, and "in library" / "monitored" badges — where you can + Follow or Want before committing. No Spotify (its recommendation APIs are dead + for new apps). **Operational notes:** the monitor and the discovery sweep are both **off by default** — set `monitor.enabled=true` (+ optional `monitor.*` tuning) in the diff --git a/docs/superpowers/plans/2026-07-12-lyra-discovery-preview.md b/docs/superpowers/plans/2026-07-12-lyra-discovery-preview.md index f5a429a..986bcbd 100644 --- a/docs/superpowers/plans/2026-07-12-lyra-discovery-preview.md +++ b/docs/superpowers/plans/2026-07-12-lyra-discovery-preview.md @@ -836,3 +836,5 @@ Co-Authored-By: Claude Opus 4.8 (1M context) " - Tracklists are fetched live per expand; a short-lived cache (or persisting on Want) is a later option if MB rate-limiting bites. - The preview shows one representative release's tracklist; multi-disc/edition differences aren't surfaced. - `have` via `LibraryItem` matches on `(artistName, album)` (name-based, like the existing wanted-add path); MBID-based library matching is a broader future change. +- **TODO — reuse the preview page from the normal `/artists` live search.** The artists search→follow picker (`artists-client.tsx`) currently only follows; wire each MB search hit to also link to `/discover/artist/[mbid]?name=…` so you can preview (disco + tracklists + own-state) before following there too. The preview page + endpoints already exist — this is a small link-wiring task in `artists-client.tsx`. +- **Applied post-merge:** `want()` in `preview-client.tsx` now guards on `res.ok` before optimistically flipping the Monitored badge (was deferred item #1 from the whole-branch review). diff --git a/web/src/app/discover/artist/[mbid]/preview-client.tsx b/web/src/app/discover/artist/[mbid]/preview-client.tsx index 5816790..5261857 100644 --- a/web/src/app/discover/artist/[mbid]/preview-client.tsx +++ b/web/src/app/discover/artist/[mbid]/preview-client.tsx @@ -65,7 +65,7 @@ export function PreviewClient({ mbid, initialName }: { mbid: string; initialName } async function want(r: Release) { - await fetch("/api/discover/want", { + const res = await fetch("/api/discover/want", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ @@ -78,6 +78,7 @@ export function PreviewClient({ mbid, initialName }: { mbid: string; initialName firstReleaseDate: r.firstReleaseDate, }), }); + if (!res.ok) return; // don't flip the badge if the want failed setData((d) => d ? { ...d, releases: d.releases.map((x) => (x.rgMbid === r.rgMbid ? { ...x, monitored: true } : x)) } : d, );