Skip to content

Pling on Cloudflare, with Spotify sharing and Norwegian - #1

Merged
kluvin merged 11 commits into
mainfrom
claude/kind-albattani-sssxbx
Dec 3, 2026
Merged

kluvin merged 11 commits into
mainfrom
claude/kind-albattani-sssxbx

Conversation

@kluvin

@kluvin kluvin commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Pling on Cloudflare, with Spotify sharing, Norwegian and a cleaner UI. Live at https://pling.kluvin.workers.dev.

What's in it

  • Runs on Cloudflare Workers with PartyServer (one Durable Object per room); deployed with Cloudflare's cf CLI.
  • Blend: everyone adds a playlist, the host mixes them.
  • Play from a Spotify Blend, collaborative playlist or Jam: players get a button to join it.
  • Norwegian (Bokmål) via Paraglide, picked from the browser language, with an English / Norsk switch.
  • Full screen for players (keeps the screen awake); iPhone gets an Add to Home Screen hint.
  • PLING fires on touch-down, and holding still counts.
  • Bell fades out instead of cutting off.
  • Settings − / + no longer lose quick taps on a slow connection.
  • Shorter UI text.

Testing

  • npm run typecheck, 48 unit tests, npm run build.
  • 63 browser checks (two phones, rounds, Blend, Spotify links, Norwegian, full screen) pass against the live site.

Note

The CI deploy job on main needs CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repo secrets. This version is already deployed from the branch.


Generated by Claude Code

claude added 11 commits December 3, 2026 08:55
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
@kluvin
kluvin merged commit 380dc50 into main Dec 3, 2026
5 checks passed
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.

2 participants