fix: Polish SpotifyControls state sync and remove dead code - #9678
Conversation
- 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>
|
👋 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=9678🤖 Gemini Manual Trigger GuideTo re-enable: Set repository variable |
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Gemini Manual Trigger Guide |
- 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>
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Gemini Manual Trigger Guide |
3cfa261
into
fix/spotify-volume-control-issues-7076295242487717640
Repairs the pull request addressing Spotify volume control issues by incorporating previous PR audit feedback.
Architectural improvements involve changing the
SpotifyControlscomponents from side-effect-heavy synchronization to a more deterministic approach using a derivedresolvedIdand 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.tshave been correctly restored.PR created automatically by Jules for task 11587235113239168644 started by @arii