feat(medium): Fix: Spotify 'Connect' button persists after successful connection#9549
feat(medium): Fix: Spotify 'Connect' button persists after successful connection#9549arii wants to merge 4 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
👋 Welcome to HRM!Thanks for your contribution. This repository uses Gemini AI for automated triage, code review, and generation. 🤖 Gemini Manual Trigger Quick Reference
For more details and GitHub CLI examples, see the Manual Trigger Guide. |
ℹ️ Gemini Review DisabledAutomatic review is currently disabled via Via Comment: Via GitHub Actions:
Via GitHub CLI: gh workflow run reusable-gemini-review.yml -f pr_number=9549🤖 Manual Trigger Quick Reference
Full reference: Manual Trigger Guide To re-enable: Set repository variable |
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Manual Trigger Quick Reference
|
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Manual Trigger Quick Reference
|
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Manual Trigger Quick Reference
|
1 similar comment
This PR effectively addresses the reported bug where the Spotify 'Connect' button persisted after a successful connection, and also introduces valuable UX improvements. Key Improvements:
The changes are well-implemented, follow project guidelines, and are thoroughly tested. Great work!
🤖 Gemini Manual Trigger Quick Reference
|
Thank you for the review and the detailed summary of the improvements. Acknowledged. |
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Manual Trigger Quick Reference
|
🤖 AI Technical AuditCode Review: Spotify 'Connect' button persistence fixOverall, the core logic changes address the UX issue perfectly. Transitioning the display logic from 🚨 ANTI-AI-SLOP DIRECTIVES
📂 File-by-File Analysis
|
Implemented the debounced focus listener to prevent API spam, removed redundant aria-disabled attributes, and cleaned up verbose comments in the test file as requested. Thanks for the thorough audit! |
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Manual Trigger Quick Reference
|
… connection ## Description The Spotify control section on the /client/control page incorrectly showed the 'Connect' CTA instead of playback controls when a device was active but no track was playing. This occurred because the UI state relied on track metadata rather than device availability. This PR updates the UI logic to correctly display playback controls when a Spotify device is active, even if no track is currently playing, and improves device refreshing. Fixes #9305 ## Change Type: 🐛 Bug fix (non-breaking change fixing an issue) ## Changes Made 1. **Robust UI State Logic**: Updated `SpotifyControls.tsx` to prioritize the `spotifyServiceInitialized` flag and the presence of any active devices. Controls are now shown if the service is ready AND (track data exists OR an active device exists). 2. **Force Device Refresh**: Added a window focus listener that sends a `GET_DEVICES` command when the tab regains focus, resolving stale device lists. 3. **UX/Accessibility Improvement**: Renamed the button to "Connect to HRM Web Player" and implemented a "Searching for Web Player..." state with a loading spinner when the service is not yet initialized. ## Testing Verified with unit tests (including a new reproduction test) and visual verification via Playwright. ## Related Issues Closes #9305 <details> <summary>Original PR Body</summary> The Spotify control section on the /client/control page incorrectly showed the 'Connect' CTA instead of playback controls when a device was active but no track was playing. This occurred because the UI state relied on track metadata rather than device availability. This PR implements the following fixes: 1. **Robust UI State Logic**: Updated `SpotifyControls.tsx` to prioritize the `spotifyServiceInitialized` flag and the presence of any active devices. Controls are now shown if the service is ready AND (track data exists OR an active device exists). 2. **Force Device Refresh**: Added a window focus listener that sends a `GET_DEVICES` command when the tab regains focus, resolving stale device lists. 3. **UX/Accessibility Improvement**: Renamed the button to "Connect to HRM Web Player" and implemented a "Searching for Web Player..." state with a loading spinner when the service is not yet initialized. Verified with unit tests (including a new reproduction test) and visual verification via Playwright. Fixes #9305 --- *PR created automatically by Jules for task [5529974195545826471](https://jules.google.com/task/5529974195545826471) started by @arii* </details>
✅ Commits squashed successfully!🤖 Gemini Manual Trigger Guide |
8333c31 to
3135758
Compare
|
@conflict-resolve |
|
@pr-squash-rebase |
|
⏳ Attempting to automatically resolve conflicts for branch |
|
❌ Error: Unable to automatically resolve all conflicts. Please resolve these conflicts manually. 🤖 Gemini Manual Trigger Guide |
❌ Automatic squash and rebase failed. The branch has conflicts with
|
|
@conflict-resolve |
|
⏳ Attempting to automatically resolve conflicts for branch |
|
❌ Error: Unable to automatically resolve all conflicts. Please resolve these conflicts manually. 🤖 Gemini Manual Trigger Guide |
|
@conflict-reserve |
|
@conflict-resolve |
|
⏳ Attempting to automatically resolve conflicts for branch |
|
❌ Error: Unable to automatically resolve all conflicts. Please resolve these conflicts manually. 🤖 Gemini Manual Trigger Guide |
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: arii <342438+arii@users.noreply.github.com>
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Gemini Manual Trigger Guide |
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Gemini Manual Trigger Guide |
Description
The Spotify control section on the /client/control page incorrectly showed the 'Connect' CTA instead of playback controls when a device was active but no track was playing. This occurred because the UI state relied on track metadata rather than device availability. This PR updates the UI logic to correctly display playback controls when a Spotify device is active, even if no track is currently playing, and improves device refreshing.
Fixes #9305
Change Type: 🐛 Bug fix (non-breaking change fixing an issue)
Changes Made
SpotifyControls.tsxto prioritize thespotifyServiceInitializedflag and the presence of any active devices. Controls are now shown if the service is ready AND (track data exists OR an active device exists).GET_DEVICEScommand when the tab regains focus, resolving stale device lists.Testing
Verified with unit tests (including a new reproduction test) and visual verification via Playwright.
Related Issues
Closes #9305
Original PR Body
The Spotify control section on the /client/control page incorrectly showed the 'Connect' CTA instead of playback controls when a device was active but no track was playing. This occurred because the UI state relied on track metadata rather than device availability.
This PR implements the following fixes:
SpotifyControls.tsxto prioritize thespotifyServiceInitializedflag and the presence of any active devices. Controls are now shown if the service is ready AND (track data exists OR an active device exists).GET_DEVICEScommand when the tab regains focus, resolving stale device lists.Verified with unit tests (including a new reproduction test) and visual verification via Playwright.
Fixes #9305
PR created automatically by Jules for task 5529974195545826471 started by @arii