feat(spotify): show the current track as an activity
OpenSSF Scorecard / Scorecard analysis (push) Waiting to run
CI / Build & test (Node 20) (push) Canceled after 0s
CI / Build & test (Node 24) (push) Canceled after 0s
CI / Build & test (push) Canceled after 0s
CodeQL / Analyze (javascript-typescript) (push) Canceled after 0s
Security / Secret scan (gitleaks) (push) Canceled after 0s
Security / Dependency scan (OSV-Scanner) (push) Canceled after 0s
Security / IaC/config scan (Trivy) (push) Canceled after 0s
Security / License compliance scan (Trivy) (push) Canceled after 0s

OAuth Authorization Code flow, with tokens kept server-side: refreshing needs
the client secret, so the browser never holds a Spotify token — it asks this
instance what is playing and this instance calls Spotify.

The callback arrives as a plain browser redirect with no Authorization header,
so the OAuth state carries the user id signed with the instance secret and is
compared in constant time; without that, anyone could bind their Spotify
account to another user.

Activities are now tracked per producer. pushActivities replaced the whole
list, so the desktop game detector and Spotify would erase each other — losing
exactly the case this is for, a game and Spotify at once.

Polling backs off when the tab is hidden and keeps the last known track on a
network error rather than reporting 'stopped listening'. A rejected refresh
token (access revoked on Spotify's side) drops the row so the UI stops
claiming a live connection.

Scope is read-only: user-read-currently-playing and user-read-playback-state.

Per the fork's language rule, the new UI ships in en and pt-BR, and this
round also translates the privacy panel.
This commit is contained in:
2026-08-31 12:37:08 -03:00
parent c022f2795f
commit 75316b0882
16 changed files with 4413 additions and 12 deletions
+19
View File
@@ -33,6 +33,25 @@ export const en = {
'settings.voice.micTest.idle': 'Test your mic without joining a call.',
'settings.voice.micTest.failed': 'Could not open the microphone. Check the device and its permission.',
// Settings — privacy
'privacy.title': 'Privacy',
'privacy.discoverable.label': 'Allow others to find my profile',
'privacy.discoverable.description': 'When enabled, your profile appears in Discover People. Others can always add you by exact username.',
'privacy.activity.label': 'Share Activity Status',
'privacy.activity.description': "Allow others to see what you're up to, like games you're playing or music you're listening to.",
// Settings — connections
'connections.title': 'Connections',
'connections.spotify.description': 'Show what you are listening to on your profile.',
'connections.spotify.connect': 'Connect Spotify',
'connections.spotify.disconnect': 'Disconnect',
'connections.spotify.connected': 'Connected',
'connections.spotify.notConfigured': 'This instance has no Spotify credentials configured.',
'connections.spotify.hint': 'Only what is playing is read — playback cannot be controlled.',
'connections.spotify.error.denied': 'Authorisation was cancelled on Spotify.',
'connections.spotify.error.invalid_state': 'The authorisation link expired. Try again.',
'connections.spotify.error.exchange_failed': 'Spotify refused the authorisation. Try again.',
// Profile card
'profile.aboutMe': 'About Me',
'profile.memberSince': 'Member Since',