Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make linking spotatui to spotatui.com easier (sync token UX + device-code login)

Aperta
#573 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with the named sync-error paths in src/infra/history.rs and src/infra/network/friends.rs, then inspect settings text editing and the Qobuz login flow in src/infra/qobuz/auth.rs. The issue lists several independent UX changes, and device-code linking depends on website endpoints being added first. Done means the selected TUI changes validate and save tokens, communicate auth failures and success, and support the described login flow where applicable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

About a third of spotatui.com accounts (roughly 30 of 93) have never synced a single play. Connecting the TUI to the website is a hand-copied token: sign up, find the token on the dashboard, open Settings with Alt+,, go to the Behavior tab, scroll to row 37 ("Sync Token"), paste, press Alt+s. After all that, the TUI never tells you whether it worked.

I'm fixing the website side separately (a setup card on the empty dashboard with the exact keys, and a "last used by spotatui" indicator). This issue covers the TUI side.

What goes wrong today

  • Failures are silent. Every sync error (bad token, 401, 500) only goes to the log (src/infra/history.rs around 345 and 2417, src/infra/network/friends.rs 229/260). With a wrong token, the Friends screen shows "Loading..." and "No friends yet", which looks like a healthy empty account.
  • Nothing confirms success. There's no "linked as @user" anywhere.
  • The token isn't checked on save. A typo or truncated paste fails forever.
  • No bracketed paste. There's no Event::Paste handling, so pasting only works because the terminal replays the characters as keystrokes.
  • Hard to discover. The only in-app pointer is Library → Friends ("Account Required"). It frames the token as a Friends feature, not history sync, and links to the homepage instead of /login. First run, Stats and announcements don't mention it, and the wiki (Friends.md, Configuration.md) also describes it as Friends-only.
  • Naming. The copy says sync_token, the row says "Sync Token", and spotatui sync is playlist sync.

Plan

1. Quick wins (no server changes needed)
  • Show sync auth failures in the status bar, once per session, e.g. spotatui.com: sync token rejected, check Settings → Behavior → Sync Token.
  • When the Sync Token setting is saved, call GET /api/profile with it and show "Linked to spotatui.com" or "Token rejected".
  • Make the Friends screen tell "token rejected" apart from "no friends yet".
  • Handle bracketed paste in settings text edits.
  • Friends "Account Required" copy: link https://spotatui.com/login, and name the row as it appears ("Sync Token").
  • Mention the web companion in the Stats empty state or an announcement, and fix the wiki so it says the token turns on history sync, stats and the GitHub widget, not just Friends.
  • Optional: SPOTATUI_SYNC_TOKEN env var for headless and dotfile setups.
2. Device-code linking (needs new website endpoints; I'll add those first)

Works like gh auth login:

  1. spotatui login, or a "Link account" action on the Friends panel and the Sync Token row, asks the server for a short code.
  2. The TUI shows the code and opens https://spotatui.com/link?code=ABCD-1234 (and prints it for SSH or headless use).
  3. The user signs in or signs up there and clicks "Link this device".
  4. The TUI polls, receives the token, saves it with save_config(), and shows "Linked as @user". The history collector picks the token up within a second (#393), so no restart is needed.

I picked a device code over a loopback redirect (like the Qobuz login in src/infra/qobuz/auth.rs) because it also works over SSH and on machines without a browser.

Lingua principale
Rust
Stelle
1.4k
Fork
238
Merge medio
9h 21m
PR unite (30g)
193

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LargeModGames/spotatui

Tutte le issue di LargeModGames/spotatui

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.