feat(career): gigs frontend — poster, runner strip, summary, encore#956
Conversation
Career v3, WS3 (frontend half), rebuilt cleanly on merged main (v3-a/b/c
in) after git interleaved the structurally-similar canvas functions:
- Book a gig from any opened passport: /gigs/propose renders as a GIG
POSTER (venue presents GENRE NIGHT, numbered bill) with re-roll and
Save/Copy poster (natively-drawn canvas via blob-io, audible failure
paths, slash-safe filenames).
- Play the gig: venue override + Venue viz handoff, then
playQueue.start(..., {source:'gig'}) — the queue's auto-advance runs
the set; zero new playback machinery.
- Floating gig strip (body-level, pointer-events none, z 35 per the
chrome invariant) tracks set position and names what's next.
- Completion = song:ended with an empty queue → POST /gigs → summary
poster overlay with per-song accuracies; encore fires the crowd
celebrate + confetti (reduced-motion: neither). song:stop with a dead
queue = abandoned (no log); end-of-song teardown (queue still active)
must NOT abandon.
- Gigs played render as dated rows in the passport book.
vm tests: runner advance/abandon semantics via the queue-state seam.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a Career “Gigs” flow for proposing setlists, playing them through the queue, tracking completion, recording results in the passport book, and exporting gig posters. ChangesCareer gigs
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant PassportBook
participant CareerAPI
participant GigPoster
participant CareerRunner
participant PlayQueue
PassportBook->>CareerAPI: POST /api/plugins/career/gigs/propose
CareerAPI-->>GigPoster: Return proposed setlist
GigPoster->>CareerRunner: Start proposed gig
CareerRunner->>PlayQueue: Start setlist playback
PlayQueue-->>CareerRunner: Emit song lifecycle events
CareerRunner->>CareerAPI: POST /api/plugins/career/gigs
CareerAPI-->>PassportBook: Return recorded gig summary
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/career/screen.js`:
- Around line 1500-1502: Reduce plugins/career/screen.js below the 1500-line max
enforced by lint by extracting the gig-related block, including poster, runner,
and summary logic around the gig handlers and setGigRun/getGigRun state, into a
small module. Preserve the existing public handlers and behavior while updating
imports or exports as needed.
- Around line 1118-1129: Update the override setup around the restore variable
so failures from localStorage operations still clear restore as appropriate, but
a throwing window.setViz('venue') call does not set restore to null. Keep the
previously captured venue and viz values, and treat only the setViz invocation
as best-effort so restoreGigStage() can restore the user's state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4586f9b7-7db7-4ef8-91dd-dd7e929adaae
📒 Files selected for processing (4)
CHANGELOG.mdplugins/career/assets/career.cssplugins/career/screen.jsplugins/career/tests/passports.test.js
CodeRabbit on #956: a setViz failure nulled the restore snapshot AFTER the overrides were written, permanently borrowing the stage — snapshot now captured before any write, write failures keep it intact. Also registers career screen.js in docs/size-exemptions.md 'Planned, not exempt' (1,516 lines; max-lines WARNS non-blocking — the split plan needs Byron's sign-off). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…empt) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The |
Career v3, workstream 3 (frontend half), on the merged gigs backend (#954):
playQueue(raw filenames — the queue encodes internally; pre-encoding was caught in review and would have broken loading + the stats join). The gig borrows the stage: venue override + Venue viz are stashed and restored when the set ends or is abandoned (unlike "Play here", an explicit persistent choice).song:endedon OUR live gig queue (source + active checked — a cleared/foreign queue can never log a gig) → waits for the last song'sstats:recorded(or a timeout — unscored plays never emit one) so/gigsreads the set's real accuracies → summary poster with per-song results; encore fires the crowd eruption + confetti. Escape closes poster/summary overlays; quitting mid-set abandons silently (no log, no fail state).exportCanvasPnghelper dedups the card/poster export plumbing.Review notes
Internal review pass caught: the double-encoding bug, the completion/stats race, the foreign-queue completion hole, the Escape gap, the unrestored stage, and the export duplication — all fixed.
Testing
Live end-to-end: booked a real 2-song classical gig, both songs played + auto-advanced (strip verified per song), summary poster with accuracies, gig logged with
gig_count, viz restored, zero page errors. vm tests for runner advance/abandon semantics. Full JS glob 1172, career pytest green.🤖 Generated with Claude Code
Summary by CodeRabbit