Skip to content

fix(gui): add a Spotify login button - #796

Merged
LargeModGames merged 1 commit into
mainfrom
fix/gui-spotify-login-retry
Oct 13, 2026
Merged

LargeModGames merged 1 commit into
mainfrom
fix/gui-spotify-login-retry

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #787. The desktop app builds Spotify only, so after a failed first login the next launch opened with an empty library and no way to log in: the source picker only shows when a build has more than one source, and the status hint names the terminal's d key.

  • Your Library now shows "Spotify is not connected." and a Log in to Spotify button while Spotify is the active source and there is no session. The button sends SelectSource(Spotify), which already starts the device login. The page reads the session state from LikedSongs.available, so the protocol does not change.
  • A repeat login request while one waits used to replace the pairing prompt with "Spotify login already in progress..." for 4 seconds, and then the code was gone for the rest of the login. A visible button makes that second click likely, so Network now keeps the prompt (login_prompt replaces login_in_flight) and shows it again. The terminal app gets the same behaviour.

Testing

I tested the button by hand in the desktop app.

  • npm run lint, npm run format:check, npm run typecheck, npm test, npm run build in gui/:
All matched files use Prettier code style!
 Test Files  49 passed (49)
      Tests  381 passed (381)
✓ built in 146ms
  • Playwright, the two library scenes in three browsers: 6 passed (4.8s)
  • cargo fmt --all -- --check: exit 0
  • cargo clippy -- -D warnings on the slim, headless (telemetry), default and gui legs: all Finished
  • cargo test --no-default-features --features telemetry,tui: test result: ok. 1543 passed; 0 failed
  • cargo test: test result: ok. 2000 passed; 0 failed; 7 ignored

Additional notes

New screenshot scene: "Spotify login after a failed first login" (library-spotify-login.png).

Not in this PR:

  • The "Press d and pick Spotify" status texts still show in the GUI. The app does not know which frontend runs, so changing them would drop the key hint from the terminal app.
  • Cached credentials that Spotify refuses still count as connected, so the button does not show and a retry does nothing. That predates this change; the session layer reports a refused login as offline.

💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Bug Fixes
    • Your Library now shows a Log in to Spotify button when Spotify is signed out. Selecting it lets you retry the login process.
    • If you select the button again while login is already in progress, the existing Spotify pairing code is shown again instead of being replaced. This makes it easier to continue signing in after an interrupted or unsuccessful attempt.

The desktop app builds Spotify only, so after a failed first login it
opened with no source picker and a hint for the terminal's `d` key.
Your Library now offers Log in to Spotify while there is no session.
A repeat login request shows the waiting pairing code again instead of
replacing it.

Fixes #787
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8cb34fba-1559-44fd-b3d1-8b2ea47bd5ec
📥 Commits

Reviewing files that changed from the base of the PR and between 6957bd0 and 6db259d.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • gui/e2e/fixtures.ts
  • gui/e2e/scenes.shot.ts
  • gui/src/LibraryPanel.css
  • gui/src/LibraryPanel.tsx
  • gui/src/Shell.tsx
  • gui/src/library.test.tsx
  • src/infra/network/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The desktop library now offers a Spotify login button when Spotify is unavailable. Repeating a login request while pairing is pending redisplays the existing pairing instructions. The change also adds GUI tests and a screenshot test for the login prompt.

Changes: Spotify Login Recovery

Layer / File(s) Summary
Store and redisplay pairing prompt
src/infra/network/mod.rs
The network layer stores the pairing instructions while login is pending. A repeated request redisplays them. Successful completion and cancellation clear the stored prompt. Tests cover these changes.
Show login option in the desktop library
gui/src/LibraryPanel.tsx, gui/src/Shell.tsx, gui/src/LibraryPanel.css, gui/src/library.test.tsx, gui/e2e/fixtures.ts, gui/e2e/scenes.shot.ts, CHANGELOG.md
The library displays a login prompt when Spotify is active and logged out. Clicking the button sends SelectSource: "Spotify". GUI tests and a screenshot test cover the prompt. The changelog describes the login option and repeated-click behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6db25

Disconnected Spotify users have a login path, and failed or expired attempts can be retried. No actionable issue remains from this review.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the valid fix(gui): prefix and an imperative, concise subject. It describes the main change, adding a Spotify login button.
Linked Issues check Passed Issue [#787] requires a visible Spotify login option after login failure. LibraryPanel shows “Spotify is not connected” and a “Log in to Spotify” button when Spotify is active and `LikedSongs.availa…
Out of Scope Changes check Passed The UI, state handling, and tests address Spotify login recovery for [#787]. Keeping and redisplaying the pairing prompt on repeat login requests supports the new visible button and avoids hiding the …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/infra/network/mod.rs 75.0% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit cfcb249 into main Oct 13, 2026
36 checks passed
@LargeModGames
LargeModGames deleted the fix/gui-spotify-login-retry branch October 13, 2026 10:21
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.

GUI has no visible Spotify login option after initial login fails

1 participant