feat: migrate frontend to React components - #1
Merged
Conversation
Replace the vanilla JS bundle that the three route shells used to load with proper React client components rendered through Next.js. The existing CSS, DOM structure, and behavior (WebSocket state sync, audio playback, visualizer broadcast/draw, artwork-derived primary color) are preserved as-is so the UI stays strictly identical. - Shared lib under src/lib for types, constants, helpers, the Shell wrapper, the queue list, and the useJamState / usePrimaryArtworkColor hooks - Page components now own their state, refs, and effects instead of injecting /assets/app.js - Drop public/app.js and the HomeJamPage helper Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move public/styles.css to src/app/globals.css and import it from page-shell so the Next.js CSS pipeline handles hashing, minification, and injection. Keep public/ around (via .gitkeep) so the Dockerfile COPY step still finds the directory. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
public/app.js) that the three route shells loaded with proper React client components rendered through Next.js. The CSS, DOM structure, and runtime behavior (WebSocket state sync, audio playback, visualizer broadcast/draw, artwork-derived primary color) are preserved so the UI stays strictly identical.src/lib/for types, constants, helpers, theShellwrapper, the queue list, and theuseJamState/usePrimaryArtworkColorhooks. Each page now owns its state, refs, and effects directly.public/styles.csstosrc/app/globals.cssand import it frompage-shellso the Next.js CSS pipeline handles hashing, minification and injection (the<link rel="stylesheet" href="/assets/styles.css">tag is gone).public/is kept (via.gitkeep) so the DockerCOPY public ./publicstep still finds the directory.src/server.tsis untouched: the custom HTTP server still owns the WebSocket upgrade, the REST API, the/media/*Range streaming and the yt-dlp pipeline.Test plan
npm run build— Next compiles,tsc -p tsconfig.server.jsonis cleannpm startthen open/admin,/client,/visualizer— visuals are byte-identical withmain/client: search via iTunes, add a track to the queue, watch the queue appear on/adminand/visualizervia WS/admin: Lancer / Arreter, Passer, Vider la file, Retirer — all hit the existing API endpoints/adminautoplays once the user has interacted; the autoplay hint shows up if the browser blocks the first start; the visualizer levels propagate to/visualizerdocker compose up --build -d— the image still builds and runs with the same volume mounts and env vars🤖 Generated with Claude Code