Skip to content

feat(room): a gramophone that plays background music#256

Merged
oratis merged 1 commit into
mainfrom
feat/gramophone
Jul 15, 2026
Merged

feat(room): a gramophone that plays background music#256
oratis merged 1 commit into
mainfrom
feat/gramophone

Conversation

@oratis

@oratis oratis commented Jul 15, 2026

Copy link
Copy Markdown
Owner

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

  • Gramophone prop (generated pixel-art sprite) on the floor by the armchair. Click it → the player slides up. While music plays it glows + drifts musical notes (body.music).
  • Player: play/pause · prev/next · seek (real HTTP Range) · volume/mute · a mood-filtered playlist (古典 / 轻音乐 / 经典, plus 我的 for your own) · shuffle + repeat (off/all/one) · gentle fade in/out · localStorage resume. A now-playing license footer shows CC-BY attribution.
  • Never autoplays — audio starts only from a tap (the browser gate). It's a user affordance (object-as-interface), not a readout of her state, so the Room's honesty invariant holds.

Backend

  • GET /api/room/music merges 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.

The plan's optional PR-3 "Lisa sways to the music" is intentionally deferred (animation-composition + honesty-gating risk for marginal gain) — noted as easy future polish.

Ships in v0.19.0.

🤖 Generated with Claude Code

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
oratis merged commit 0a13ce2 into main Jul 15, 2026
1 check passed
@oratis
oratis deleted the feat/gramophone branch July 15, 2026 08:15
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>
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