Commit 2a4912f
authored
Implement Volume Control Consistency (#1541)
feat: Implement Volume Control Consistency
This commit introduces a consistent volume control experience across the application.
Key changes:
- Created a new presentational `VolumeSlider` component with mute functionality.
- Refactored `SpotifyDisplay.tsx` to use the new `VolumeSlider` and synchronize its state with real-time `spotifyData` from the WebSocket.
- Refactored `app/client/spotify-selection/page.tsx` to use the new `VolumeSlider` and the `useVolumePreference` hook.
- Refactored `app/client/control/components/SpotifyControls.tsx` to use the new `VolumeSlider`.
- Implemented debouncing for all `SET_VOLUME` commands to prevent API flooding.
- Removed the old `VolumeControl.tsx` component and its associated test file.
- Fixed all related unit tests and build errors.
I was unable to complete the frontend verification step due to issues with the Playwright script and the test environment's authentication. The script was unable to trigger the necessary state to render the volume controls. The core functionality is implemented and unit tested.
feat: Address PR feedback for volume control consistency
This commit addresses the feedback from the pull request review for the volume control consistency feature.
Key changes:
- Fixed the missing debounce on the `/client/control` page by implementing a debounced `sendVolumeCommand` in `SpotifyControls.tsx`.
- Improved the accessibility and responsiveness of the `VolumeSlider.tsx` component by replacing `aria-labelledby` with a direct `aria-label` and using a flexible width.
- Added the missing export for the new `VolumeSlider.tsx` component to `components/index.ts`.
- Added a new unit test file for `VolumeSlider.tsx` to verify its rendering, props, and interactions.
- Resolved all build errors and ensured all unit tests are passing.
Frontend verification was attempted but not completed due to issues with the test environment's WebSocket connection. The core functionality has been implemented and unit tested.
fix: Address PR feedback and fix linting errors
This commit addresses the feedback from the pull request review for the volume control consistency feature, and also fixes all linting errors.
Key changes:
- Fixed the missing debounce on the `/client/control` page by implementing a debounced `sendVolumeCommand` in `SpotifyControls.tsx`.
- Improved the accessibility and responsiveness of the `VolumeSlider.tsx` component by replacing `aria-labelledby` with a direct `aria-label` and using a flexible width.
- Added the missing export for the new `VolumeSlider.tsx` component to `components/index.ts`.
- Added a new unit test file for `VolumeSlider.tsx` to verify its rendering, props, and interactions.
- Resolved all build errors and ensured all unit tests are passing.
- Fixed all linting errors by running `pnpm run lint:fix`.
fix: Address final PR feedback and remove extraneous file
This commit addresses the final feedback from the pull request review for the volume control consistency feature.
Key changes:
- Removed the extraneous `hrm@0.10.0` file.
- All previous feedback has been addressed, including debouncing, accessibility, responsiveness, unit tests, and linting.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 492f26d commit 2a4912f
12 files changed
Lines changed: 250 additions & 199 deletions
File tree
- app/client
- control/components
- spotify-selection
- components
- Spotify
- context
- services
- stories/mocks
- tests/unit/components/Spotify
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
15 | | - | |
16 | 12 | | |
17 | | - | |
18 | 13 | | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
33 | | - | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
| |||
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 75 | + | |
85 | 76 | | |
86 | 77 | | |
87 | 78 | | |
| |||
154 | 145 | | |
155 | 146 | | |
156 | 147 | | |
| 148 | + | |
| 149 | + | |
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
161 | 154 | | |
162 | 155 | | |
163 | 156 | | |
164 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
208 | 217 | | |
209 | 218 | | |
210 | 219 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
246 | 227 | | |
247 | 228 | | |
248 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
207 | 216 | | |
208 | 217 | | |
209 | 218 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments