Repository source: docs/plans/music_queue/music_queue_step2_feature_description.md
Debug mode: enabled (debug log)
Effort study: railspike-effort / v3/music_queue; host ledger music_queue.md. Standing P2 enrollment.
Extended estimates: enabled.
Cycle estimate: 0.45
Approved direction
Step 1 was approved on 2026-11-29 ("approved step 1"). No option was named, so this follows the recommended Option B: tracks shared during the slides go next, and any track can be marked "Play next". PR #473 (the newest-first queue) is merged, so this builds on main at 8272a89f9. Choices not yet confirmed are marked (default).
Problem
While the slides play on the room's screen, people can add tracks from their phones, but the screen never shows them: a new share sits at the far end of a queue that started earlier, and an old favourite cannot be brought forward at all.
Concepts touched: Music section (changed: the slides take additions; rows get Play next). Media embed (reused). Thread activity (reused: a #playnext reply is a hashtag-only reply, so the drawer already folds it away where it is on). Feature flags (one new flag). Feedback: no matching item in docs/feedback/items/.
User stories
As a club member at the meeting, I want to paste a link on
/music/from my phone, so that it plays after the current track on the room's screen.As a club member, I want to tap Play next on an older track, so that the room hears it soon without anyone reposting it.
As the person running the slides, I want additions to appear on their own, so that I never reload or hunt for them.
As the person running the slides, I want to see what is up next, so that I can tell the room whose pick is coming.
As a member who tapped Play next, I want to see that it worked, so that I don't tap again.
Core requirements
The queue is fixed when the slides open. A playable #music track shared after that, or a track given a
#playnextreply after that, is inserted after the current slide, in the order added. Inserts come before the rest of the queue; when they run out, Next continues where the queue left off.The slides page checks for additions every 10 seconds (default) and shows an "Up next" line naming the inserted tracks. Each addition plays once; a track marked twice still plays once.
/music/rows get a Play next button (default: rows only, not thread pages). It posts a reply holding only#playnext, as the share box posts, signed or as guest, and returns to/music/with that row marked "Queued".Without JavaScript the slides do not change on their own; Play next still posts its mark. A failed check shows a short notice that additions are not arriving, with Details, and keeps retrying.
A new flag,
FORUM_MUSIC_QUEUE_ENABLED, turns additions and the Play next button off. It is on by default (default) and needsFORUM_MUSIC_SLIDES_ENABLED.
Delivery scope
Work type: application change. A plain-text additions answer for the slides, the client queue in
music_slides.js, the Play next button and its return to/music/, styles, the flag, the concept file update and tests.Out of scope: reordering or removing queued tracks from a phone (retracting the
#playnextreply works today), a live session or join code (Step 1 Option C), the phone remote, Play next on thread pages, telling the phone when its track actually plays.
Completion boundary
Normal entry: the presenter opens Play all on the room's laptop; members open
/music/on their phones.End-to-end outcome: within about 10 seconds of a member's share or Play next tap, the screen's "Up next" line names the track; the next Next plays it, then the queue resumes.
Recovery: a failed or slow check (8s timeout) shows the notice and retries; additions made meanwhile still arrive once the check succeeds. A Play next tap that fails to post shows the share box's usual error. The flag turns it all off.
Release: merged, deployed with Deploy now, and used at one meeting with at least one phone addition.
Known user or environment
The maintainer runs the slides on the room laptop, probably signed out, and members add from their phones (iPhone SE among them), often as guests. Failure to handle: a guest's Play next is refused by the site's posting rules, or the laptop's clock is wrong. Next action: Play next shows the same error and recovery the share box shows; the check uses the server's time, never the laptop's. Evidence: a note from the meeting that a phone's addition appeared on the screen.
Risks
#playnextreplies clutter a track's thread. Impact: thread pages fill with bare marks. Earliest validation: check whetherFORUM_THREAD_ACTIVITY_DRAWER_ENABLEDis on for mitrapclub. Mitigation: the drawer already folds hashtag-only replies; if it stays off, say so in the handoff and let the maintainer choose.Guests posting replies. Impact: Play next fails for signed-out phones. Earliest validation: post a guest reply on mitrapclub's settings in a test. Mitigation: the share box already posts as guest, so the reply path should match; if not, the button is shown only where posting works.
Order when the queue jumps. Impact: after an insert, Next or Previous goes somewhere surprising. Earliest validation: a browser test that inserts two tracks mid-queue, then walks Next and Previous. Mitigation: Previous retraces what played; Next takes inserts first, then the saved resume point.
Server load from checks. Impact: many open slides tabs poll the server. Earliest validation: time one check against mitrapclub's data. Mitigation: a small plain-text answer from one indexed query.
Shared component inventory
Additions source:
ReadModel/TagPage.phpmembership (base(),newestShared()), plus thepoststable'screated_atandbodyfor#playnextreplies. Extend; no schema change.Playable test:
View/MediaEmbedDetector.php, asMusicPageController::playable()uses it.Hashtag-only rule:
Support/ThreadLabels.php, so a#playnextreply counts only when it is a valid hashtag-only body, the same rule the thread activity drawer uses.Posting: the reply compose path in
Http/ComposeAndAccountKeyController.php(resolveComposeReplyReturnTogains a/music/return, like the guestbook's and support wall's).Slides page and script:
templates/pages/music_slides.php,public/assets/music_slides.js(extend: a client queue in front of the server's Next)./music/rows:templates/partials/thread_row.phprow slot used bymusic.php. Extend with a Play next form in the Music row only.Plain-text answer: the
Key: valueformat fromCONTRIBUTING.md(no JSON).Errors: the shared short-message-plus-Details pattern.
Simple user flow
The presenter taps Play all on the room laptop; the newest track shows.
A member pastes a link on
/music/on their phone and taps Post.Within 10 seconds the room's screen shows "Up next: Artist – Title".
Another member taps Play next on an older track; it joins the Up next line, and their row says Queued.
The presenter taps Next: the shared track plays, then the older one, then the queue resumes where it was.
Success criteria
A share or Play next made after the slides open appears in "Up next" within 15 seconds and plays on the next Next.
A mark or share made before the slides opened is not inserted.
After the inserts play, Next continues from the track that was current when the first insert arrived.
With the flag off, no checks are made and no Play next button shows.
One meeting runs with at least one phone addition, reported by the maintainer.
— Claude · 2026-11-29 UTC · Model: claude-opus-5-5