Skip to content

fix: Polish SpotifyControls state sync and remove dead code - #9678

Merged
arii merged 2 commits into
fix/spotify-volume-control-issues-7076295242487717640from
fix-spotify-volume-control-issues-7076295242487717640-11587235113239168644
Mar 26, 2026
Merged

fix: Polish SpotifyControls state sync and remove dead code#9678
arii merged 2 commits into
fix/spotify-volume-control-issues-7076295242487717640from
fix-spotify-volume-control-issues-7076295242487717640-11587235113239168644

Conversation

@arii

@arii arii commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Repairs the pull request addressing Spotify volume control issues by incorporating previous PR audit feedback.
Architectural improvements involve changing the SpotifyControls components from side-effect-heavy synchronization to a more deterministic approach using a derived resolvedId and deterministic Reducer logic.
Unused variables and overly verbose comments have been removed to improve code readability, and types have been localized out of the global scope. Additionally, VRT guardrails in tests/playwright/vrt-dashboard.spec.ts have been correctly restored.


PR created automatically by Jules for task 11587235113239168644 started by @arii

- Change `resolveTargetDeviceId` to a derived constant `resolvedId` to remove redundant `useEffect` and React state warnings.
- Fix the `SYNC_WITH_WEBSOCKET` reducer action to use `state.lastVolume` when `volume` payload is missing instead of defaulting to `state.displayVolume` which might be stale.
- Move specific `SpotifyControlsState` and `SpotifyControlsAction` types from `types/core.ts` directly into `SpotifyControls.tsx`.
- Delete unused variables (`isSliding`, `prevActiveIdRef`, `hasPendingSendRef`, `lastVolumeSyncTimeRef`).
- Strip out verbose and low-value comments from `SpotifyControls.tsx`.
- Revert the arbitrary `maxDiffPixelRatio` bump in VRTs (`tests/playwright/vrt-dashboard.spec.ts`) from `0.15` to `0.1` to maintain visual regression safety.
- Verify `hooks/useVolumePreference.ts` utilizes the standard `@/utils/audioManager` alias.

Co-authored-by: arii <342438+arii@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Welcome to HRM!

Thanks for your contribution. This repository uses Gemini AI for automated triage, code review, and generation.

🤖 Gemini Manual Trigger Quick Reference

Command Action
@gemini-bot Run AI Code Review (PR only)
@gemini-enrich Run PR Enrichment (PR only)
@gemini-triage Run Issue Triage
@gemini-coder <task> Generate Code
@create-review-issues Create issues from review (PR only)
@gemini-help Show this help message
@pr-squash Squash PR commits (PR only)
@conflict-resolve Resolve merge conflicts (PR only)

For more details and GitHub CLI examples, see the Manual Trigger Guide.

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Gemini Review Disabled

Automatic review is currently disabled via GEMINI_ENABLE_PR_REVIEW. To run review manually:

Via Comment:

@gemini-bot

Via GitHub Actions:

  1. Go to Actions → Reusable Gemini Review
  2. Click "Run workflow"
  3. Enter PR number: 9678

Via GitHub CLI:

gh workflow run reusable-gemini-review.yml -f pr_number=9678

🤖 Gemini Manual Trigger Guide

To re-enable: Set repository variable GEMINI_ENABLE_PR_REVIEW=true

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Review Skipped

Review was skipped for the following reason: Gemini review is globally disabled

🤖 Gemini Manual Trigger Guide

@arii arii added the not reviewed The review could not be performed or completed successfully. label Mar 24, 2026
- Replace the redundant `resolveTargetDeviceId` useCallback with a `resolvedId` derived constant.
- Address React's 'react-hooks/set-state-in-effect' warning correctly by restoring its eslint bypass for the explicit device ID syncing logic.
- Fix the `SYNC_WITH_WEBSOCKET` reducer action to use `state.lastVolume` when `volume` payload is missing.
- Move specific `SpotifyControlsState` and `SpotifyControlsAction` types from `types/core.ts` directly into `SpotifyControls.tsx`.
- Delete unused variables (`prevActiveIdRef`, `hasPendingSendRef`, `lastVolumeSyncTimeRef`, `isSliding` state).
- Strip out verbose and low-value comments from `SpotifyControls.tsx`.
- Revert the arbitrary `maxDiffPixelRatio` bump in VRTs (`tests/playwright/vrt-dashboard.spec.ts`) from `0.15` to `0.1`.
- Ensure `hooks/useVolumePreference.ts` utilizes the standard `@/utils/audioManager` alias.

Co-authored-by: arii <342438+arii@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Review Skipped

Review was skipped for the following reason: Gemini review is globally disabled

🤖 Gemini Manual Trigger Guide

@arii arii added not reviewed The review could not be performed or completed successfully. and removed not reviewed The review could not be performed or completed successfully. labels Mar 26, 2026
@arii
arii marked this pull request as ready for review March 26, 2026 03:18
@arii
arii merged commit 3cfa261 into fix/spotify-volume-control-issues-7076295242487717640 Mar 26, 2026
29 checks passed
@arii
arii deleted the fix-spotify-volume-control-issues-7076295242487717640-11587235113239168644 branch March 26, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not reviewed The review could not be performed or completed successfully.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant