|
5 | 5 | MaximizeIcon, |
6 | 6 | MinimizeIcon, |
7 | 7 | Music2Icon, |
8 | | - Volume1Icon, |
9 | | - Volume2Icon, |
10 | | - VolumeXIcon, |
11 | 8 | XIcon, |
12 | 9 | } from "lucide-react"; |
13 | 10 | import { useCallback, useMemo, useRef, useState } from "react"; |
@@ -51,51 +48,6 @@ export function SpotifyToggleButton() { |
51 | 48 | // --------------------------------------------------------------------------- |
52 | 49 | const CATEGORIES = [...new Set(DEFAULT_PLAYLISTS.map((p) => p.category))]; |
53 | 50 |
|
54 | | -// --------------------------------------------------------------------------- |
55 | | -// Volume slider — always accessible in the header bar |
56 | | -// --------------------------------------------------------------------------- |
57 | | -function VolumeControl() { |
58 | | - const { volume, setVolume } = useSpotifyPlayerStore(); |
59 | | - const [premuteVolume, setPremuteVolume] = useState<number>(80); |
60 | | - |
61 | | - const toggleMute = useCallback(() => { |
62 | | - if (volume > 0) { |
63 | | - setPremuteVolume(volume); |
64 | | - setVolume(0); |
65 | | - } else { |
66 | | - setVolume(premuteVolume || 80); |
67 | | - } |
68 | | - }, [volume, premuteVolume, setVolume]); |
69 | | - |
70 | | - const VolumeIcon = volume === 0 ? VolumeXIcon : volume < 50 ? Volume1Icon : Volume2Icon; |
71 | | - |
72 | | - return ( |
73 | | - <div className="flex items-center gap-1.5"> |
74 | | - <button |
75 | | - type="button" |
76 | | - onClick={toggleMute} |
77 | | - className="rounded p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground" |
78 | | - aria-label={volume === 0 ? "Unmute" : "Mute"} |
79 | | - > |
80 | | - <VolumeIcon className="size-3.5" /> |
81 | | - </button> |
82 | | - <input |
83 | | - type="range" |
84 | | - min={0} |
85 | | - max={100} |
86 | | - step={1} |
87 | | - value={volume} |
88 | | - onChange={(e) => setVolume(Number(e.target.value))} |
89 | | - className="spotify-volume-slider h-1 w-16 cursor-pointer appearance-none rounded-full bg-muted-foreground/20 accent-emerald-400 [&::-webkit-slider-thumb]:size-2.5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-emerald-400 [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-125 [&::-moz-range-thumb]:size-2.5 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-emerald-400" |
90 | | - aria-label="Volume" |
91 | | - /> |
92 | | - <span className="min-w-[2ch] text-[10px] tabular-nums text-muted-foreground/50"> |
93 | | - {volume} |
94 | | - </span> |
95 | | - </div> |
96 | | - ); |
97 | | -} |
98 | | - |
99 | 51 | // --------------------------------------------------------------------------- |
100 | 52 | // Main Spotify Player Drawer — rendered at the bottom of ChatView |
101 | 53 | // --------------------------------------------------------------------------- |
@@ -159,8 +111,12 @@ export function SpotifyPlayerDrawer() { |
159 | 111 | {/* Spacer */} |
160 | 112 | <div className="flex-1" /> |
161 | 113 |
|
162 | | - {/* Volume — always accessible */} |
163 | | - <VolumeControl /> |
| 114 | + <span |
| 115 | + className="rounded-full border border-border/60 px-2 py-0.5 text-[10px] text-muted-foreground/60" |
| 116 | + title="Spotify embeds do not expose volume control. Adjust volume in Spotify or with your system/browser controls." |
| 117 | + > |
| 118 | + Volume in Spotify/system |
| 119 | + </span> |
164 | 120 |
|
165 | 121 | {/* Playlist picker toggle (only when not minimized) */} |
166 | 122 | {!minimized && ( |
|
0 commit comments