Show observed release format and disc numbers in release cases
Summary
Reviewers could not tell a single from an album, or see disc structure, on the release review page, even though the saved Spotify observation carries that metadata. This PR renders the server-projected release_format (recoupable/database#109, typed in recoupable/api#1021) as one line under the release title, for example Album · 2 discs · 3 tracks reported · Released 2024-05-17 · <label> · UPC not observed · Reissue/physical format unknown, and prefixes each track cell with Disc N · when the release is multi-disc. When only part of the track list was collected (track_coverage: partial), the line says Track list incomplete and shows Multiple discs (a partial list already reaching disc 2) or Disc count unknown, never a definite disc count. This advances ticket Done-when 1 (distinguish singles, albums and formats on canonical releases with ordered, disc-aware membership).
Only observed values are shown: a UPC appears only when the server reports one, reissue and physical format are always stated as unknown, and an observed-but-unknown type (Format unknown) stays distinct from an uncollected one (Format not collected). The field is optional in lib/releases/types.ts, so a response from an API without the migration still renders. No sorting or grouping changes to the track table.
Refs recoupable/app#2139 (child of epic recoupable/app#2116).
Merge sequencing
docs (no change) → database recoupable/database#109 → api recoupable/api#1021 → app (this PR). Safe to merge before the backend because the field is optional; the line then reads Format not collected. Depends on no other OPEN PR; builds on merged app#2172/#2173/#2178.
Verification
- Ran (after the last change)
pnpm exec vitest run components/Releases lib/releases→ 24 files, 74 tests passed, 0 failed (includesReleaseCaseFormat.test.tsx, 6 tests,ReleaseCaseFormatCoverage.test.tsx, 2 tests, and the unchangedReleaseCasePresentation,ReleaseCaseReview,ReleaseCaseScope,ReleaseCaseAccess,ReleaseCaseRecoverysuites). - Ran
pnpm exec tsc --noEmit→ 1 error, pre-existing and unrelated (components/VercelChat/tools/SpotifyDeepResearchResult.tsx: cannot find module@/public/brand-logos/spotify.png, because the untracked generatednext-env.d.tsis absent without a Next build); 0 errors in changed files. - Ran
pnpm exec eslintandpnpm exec prettier --checkon the 8 changed files → clean. - Red → green:
ReleaseCaseFormat.test.tsxwas written first; with the component and the two render edits absent, all 5 tests failed (Unable to find an element with the text: /^Album · 2 discs · 3 tracks reported/,... Format not collected, etc.). With the implementation, 5/5 pass. - Red → green (review follow-up, second commit): a sixth test asserts
upc_state: "uncollected"readsUPC not collected, notUPC not observed; it failed (expected 'Album · 2 discs · 3 tracks reported ·…' to contain 'UPC not collected') before the label change and passes after. Test fixtures moved tocomponents/Releases/__tests__/releaseFormatFixture.ts, following the existingstreamFixture.tspattern. - Red → green (third commit, independent review follow-up matching database#109's partial-coverage fix):
ReleaseCaseFormatCoverage.test.tsx(50 of 60 tracks collected; partial list reaching disc 2) and the updated observed-but-unknown case were written first and failed 3/8 (Unable to find an element with the text: /^Album · Disc count unknown · 60 tracks reported · Track list incomplete/,/^Album · Multiple discs · .../,/^Format unknown · Disc count unknown · .../). With the render change, all pass. The shared render helper moved tocomponents/Releases/__tests__/renderReleaseCase.tsxso both test files stay under 100 lines. - Not verified: hosted deployment (Vercel built its automatic PR preview; not exercised), the production database, live API responses with
release_format, visual review in a browser, any live provider.
Out of scope / known gaps
- Catalog member expansion with bounded concurrency and resumable child requests (Done-when 2 remainder).
- Reissue and physical-format detection (not observable from Spotify).
- Saved review snapshots created before database#109 contain no
release_format; the current-case page always renders the live projection. ReleaseCaseDetails.tsxwas already 140 lines on main; this PR adds two lines (142) and does not split it, to avoid conflicts with sibling tickets editing the same page. The cubic comment about it is intentionally left open for the approver; a split belongs in a follow-up.labelis shown as an observed string only; it does not verify rights, ownership or distribution.
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Release details now show available format information, including disc count, reported track count, track coverage, release date, label, and UPC. Missing or unobserved information is clearly labeled rather than inferred.
- Track listings now show a disc number alongside each track when the release has multiple discs and that track’s disc number is available.