Skip to content

Hear a scanned record before adding it: tracks play from the scan sheet - #67

Open
titomazzetta wants to merge 1 commit into
mainfrom
scan-play
Open

titomazzetta wants to merge 1 commit into
mainfrom
scan-play

Conversation

@titomazzetta

Copy link
Copy Markdown
Owner

Why

Tito's note after the first stack he scanned on the live site: "when I have all the pictures there, I should be able to press play to preview those tracks, if possible, from that record." The rows on a scan card had a play icon on them and only ticked — a promise the sheet didn't keep. The search column already plays a result's tracks; the scan sheet is the same moment (record in hand, deciding) and should play the same way.

What changed

  • Every track with a clip is a play button. Tapping the title plays the record from there, as a detour — exactly the search column's play (playFromSearch): the release joins the previews if it isn't yours, the record plays in running order, and Back to shuffle in the player returns you where you were. Play the record on the card starts it from the top.
  • The sheet stays open while it plays. The row that's playing says playing (and paused), a second tap pauses or resumes it (api.toggle), and the card's chip reads Pause / Resume while its record is in the player. Tap another track and it plays from there.
  • Ticking and playing never cross. The tick box is its own 44px target at the left of the row (role="checkbox", named for the track); the title is the play button. Record-only tracks are plain rows, marked record only, still tickable.
  • README (feature row and "The record in your hand") and the Help panel say so.

components/ScanSheet.tsx (new props playingKey, playing, onPlay, onToggle), components/CrateApp.tsx (the wiring: current?.key, api.status, playFromSearch, api.toggle).

Security

Nothing new crosses a boundary. No new route, no new request, no new data: the detour and the external-details list (in memory, capped at 60) are the ones a search result's play already uses, and the adds still go through the same PATCH /api/playlists/[id], POST /api/collection and PUT /api/wantlist with every rule they have. The photo path is untouched. THREAT_MODEL unchanged.

Tests

  • Browser (flows11.mjs): 32 checks, 8 new, Chromium against the fake Discogs with YouTube stubbed and the reader stubbed at the browser. A card has Play the record; each track with a clip is a play button and a record-only track isn't; tapping a track plays it (the row says playing, the chip offers Pause, Back to shuffle is there underneath, the stub player holds that clip); playing didn't touch the ticks; a second tap pauses (paused, Resume); another track plays from there and the first is a plain row again. Then the existing checks: untick one, add six in photo order, the wantlist path, the phone layout.
  • Typecheck, lint, hidden-character scan and build pass. Offline suites unchanged (no lib/ change).

How to check

  1. Open Search, tap the camera, photograph a record with clips on Discogs.
  2. On its card tap a track: it plays, the row says playing, the player underneath shows "Exploring ". Tap it again: paused. Play the record starts from A1.
  3. Tick or untick while it plays — the boxes are their own targets.
  4. Add the tracks as before; Back to shuffle in the player bar returns you to where the shuffle was.

No database step, no environment change.

🤖 Generated with Claude Code

https://claude.ai/code/session_017abo1WFB5W1nAccTKsjJo3

Tito's note after the first stack he scanned: "when I have all the
pictures there, I should be able to press play to preview those tracks."
The rows had a play icon on them and only ticked.

Each track with a clip is now a play button — the record plays from
there as a detour, the search column's play (playFromSearch), so Back to
shuffle returns you — and the card has Play the record. The tick box is
its own 44px target at the left, so ticking and playing never cross. The
sheet stays open while it plays: the row that's playing says so, pauses
on a second tap (api.toggle), and the chip reads Pause / Resume while
its record is in the player. Record-only tracks stay plain rows.

No new route, no new data: the detour and the external-details list are
the ones a search result already uses. flows11: 32 checks (8 new —
play, pause, resume, a second track, the ticks untouched). README and
Help say so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017abo1WFB5W1nAccTKsjJo3

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant