Enable the full music player in private draft previews

SI
2mo ago
+188-33

Draft previews now include the same trusted Spotify player as published sites, replacing the disabled preview-only music header. Creators can test sign-in and verified recording playback before publishing; test connections return to the editor without populating the live audience.

The editor requests short-lived owner-authorized preview permissions from the API. The trusted player wrapper retains its origin while generated content stays in a separate opaque sandbox. Preview analytics remain disabled, and publishing still requires a paid subscription.

Requires the matching API preview endpoint to deploy first.

Validation: 32 focused tests, app type check, and targeted lint pass. Local browser verification covers opening the real player, enabled sign-in controls, and returning to the draft. Final live Spotify consent and real recording playback remain deployment checks.


Summary by cubic

Private draft previews now show the same trusted Spotify player as published sites, replacing the disabled preview-only music header. Creators can test Spotify sign-in and verified recording playback before publishing; test connections return to the editor without being added to the live audience.

Behavior

  • The editor requests a short-lived owner-authorized preview token; connecting opens the OAuth flow in a new tab and returns with a status notice.
  • Drafts keep generated content in an opaque sandbox while the trusted player wrapper keeps its own origin, and preview analytics stay disabled.
  • Publishing still requires a paid subscription.

Deployment

  • The matching API preview endpoint must deploy before this PR ships.