Repository navigation
Pling on Cloudflare, with Spotify sharing and Norwegian - #1
Merged
Merged
Conversation
Replace the Phoenix LiveView app on Fly.io with a Cloudflare Worker: one Durable Object per room via PartyServer, and a React client served as static assets from the same Worker. Playback no longer uses the Spotify embed or the playlist-fetcher service. The host taps a plain open.spotify.com link and the song plays in their own Spotify app; other phones are buzzers. Decks are built in, pasted, or imported from a Spotify data export. Game rules are now pure functions, which fixes the old room bugs by design: - one alarm per room instead of a tick chain that could double up - presence derived from live connections; no manual room shutdown - each event sent once per connection (was subscribed twice) - one typed state shape; empty decks and the first track handled - host handed over when the host leaves Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
Every player can add their own playlist to the room. The host builds a blend from them: songs on several lists first, then an equal share from each list, with an option to keep only songs in common. Revealed songs show whose list they came from, and the host is told when the blend is out of date. Playlists come in without Spotify's API: paste links copied from the Spotify desktop app, a CSV (e.g. Exportify), a Spotify data export, or 'Artist - Title' lines. Also fixes the room header overflowing the screen with long room codes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
worker-configuration.d.ts is generated by `wrangler types`, so it is now ignored and regenerated on npm install (postinstall). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
The host pastes a Spotify share link under Music → Spotify. Players get a button that opens it in their own Spotify app; rounds run in own-music mode. Only links on Spotify's own domains are accepted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
cf migrate turned wrangler.jsonc into cloudflare.config.ts and moved the Vite plugin to 2.0. dev, build, deploy and type generation now go through cf; CI deploys with npm run deploy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
UI text lives in messages/en.json and messages/nb.json. The locale comes from a saved choice, then the browser (no/nn/nb map to Bokmål), then English; Settings and the home page have a language picker. Known server errors are translated on the client. The inlang plugin loads from node_modules so builds don't need a CDN. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
Each tap used to step from the last value the server sent, so fast taps on a slow connection were lost. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
The sample stopped abruptly at 1.04s while still ringing. Added a short reverb tail so it decays to silence over about 1.5s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
Server echoes of earlier taps arrived mid-tapping and reset the local count. Only take the server's value once taps pause for a second. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
- Full screen button on the buzzer screen and in Settings (Fullscreen API), with a screen wake lock so buzzer phones don't sleep. On iPhone, which has no full-screen API for pages, a hint to add Pling to the home screen; the new web app manifest opens it full screen from there. - PLING already fires on touch-down; a held finger no longer opens the long-press menu, selects text or pans the page. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
Shorter strings in English and Norwegian, and drop hint lines that repeated what the buttons already say. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MNqoqrQ66ouAMK8rxVyQqM
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.
Pling on Cloudflare, with Spotify sharing, Norwegian and a cleaner UI. Live at https://pling.kluvin.workers.dev.
What's in it
cfCLI.Testing
npm run typecheck, 48 unit tests,npm run build.Note
The CI deploy job on
mainneedsCLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDrepo secrets. This version is already deployed from the branch.Generated by Claude Code