Make linking spotatui to spotatui.com easier (sync token UX + device-code login)
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
- Ambito
- authentication
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
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.rsaround 345 and 2417,src/infra/network/friends.rs229/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::Pastehandling, 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", andspotatui syncis 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/profilewith 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_TOKENenv var for headless and dotfile setups.
2. Device-code linking (needs new website endpoints; I'll add those first)
Works like gh auth login:
spotatui login, or a "Link account" action on the Friends panel and the Sync Token row, asks the server for a short code.- The TUI shows the code and opens
https://spotatui.com/link?code=ABCD-1234(and prints it for SSH or headless use). - The user signs in or signs up there and clicks "Link this device".
- 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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LargeModGames/spotatui
-
enhancement good first issue javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LargeModGames/spotatui#841 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
LargeModGames/spotatui#832 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
LargeModGames/spotatui#829 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
LargeModGames/spotatui#827 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
LargeModGames/spotatui#825 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LargeModGames/spotatui
Issue simili
-
documentation good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
sujithputta02/Esapay#13 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
tursodatabase/turso#10002 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
topgrade-rs/topgrade#2419 ·
I maintainer di solito rispondono entro 1 giorno
-
review-bot
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
midagedev/bloomery#318 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Chia-Network/clvm_rs#863 ·
I maintainer di solito rispondono entro 1 giorno