feat(room): a gramophone that plays background music#256
Merged
Conversation
Design + pro/con debate: docs/PLAN_GRAMOPHONE_v1.0.md. A clickable pixel-art gramophone in the Room opens an in-client music player — no browser, same self-contained DOM/CSS pattern as the rest of the Room. Player: play/pause, prev/next, seek (HTTP Range), volume/mute, a mood-filtered playlist (古典/轻音乐/经典 + 我的), shuffle + repeat (off/all/one), gentle fade in/out, and localStorage resume. Audio only ever starts from a tap (the browser autoplay gate); the gramophone glows + drifts musical notes while it plays (body.music — an honest reflection of the real 'sound is on' event, not a readout of her mood). It stays a USER affordance (object-as-interface), so the Room's honesty invariant holds. Backend: GET /api/room/music merges a bundled manifest with the user's own ~/.lisa/music/*.mp3 (mood 我的); tracks stream by opaque id via /api/room/music/file/<id> with Range + a path-traversal-safe resolver. Content: 6 curated tracks re-encoded to 112kbps (~19MB), all CC0 / public-domain / CC-BY (attribution shown in the now-playing footer + music/CREDITS.md) — no standard-copyright audio. Drop your own mp3s in ~/.lisa/music to add more. Gramophone sprite via the anchor→chroma-key pipeline. SW cache v7→v8. Tests for the manifest merge + traversal guard. Full suite green (1018 pass). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
oratis
added a commit
that referenced
this pull request
Jul 15, 2026
Headline: a clickable gramophone opens an in-client music player (playlist, seek, shuffle/repeat, ~19MB of CC0/PD/CC-BY tracks + ~/.lisa/music drop-ins) — docs/PLAN_GRAMOPHONE_v1.0.md (#256). Plus the 3×3 nav lock (#253). Release notes: docs/RELEASE_v0.19.0.md · full suite green (1018 pass). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a clickable gramophone to the Room that opens an in-client music player — designed (with a 7-point pro/con debate) in
docs/PLAN_GRAMOPHONE_v1.0.md. Same self-contained DOM/CSS pattern as the rest of the Room; no browser window, no new runtime deps.What you get
body.music).Backend
GET /api/room/musicmerges a bundled manifest with the user's~/.lisa/music/*.mp3(mood 我的).GET /api/room/music/file/<id>streams by opaque id with Range support; the id resolves to a path only via the track list, so there's no traversal surface (verified: bad/traversal id → 404).Music — licensing
6 curated tracks re-encoded to 112 kbps (~19 MB): 2 古典, 2 轻音乐, 2 经典. All CC0 / public-domain / CC-BY (the 3 Kevin MacLeod tracks show attribution in the footer; see
music/CREDITS.md). No standard-copyright audio. Drop your own mp3s in~/.lisa/music/for more.Verify
E2E in an isolated instance: gramophone renders → click opens the player → playlist loads (6 tracks, correct moods) → playback works (audio advances, duration 5:01 correct, seek/Range 206, license footer, glow+notes+bob). SW cache
v7→v8. Tests for the manifest merge + traversal guard. Full suite green — 1018 pass.Ships in v0.19.0.
🤖 Generated with Claude Code