diff --git a/src/components/player/Player.tsx b/src/components/player/Player.tsx index a7c0642..b1f8ae0 100644 --- a/src/components/player/Player.tsx +++ b/src/components/player/Player.tsx @@ -21,7 +21,6 @@ import { Playlist } from './Playlist' import { PlayerControls } from './PlayerControls' import { PlayerProgress } from './PlayerProgress' import { PlayerTrackInfo } from './PlayerTrackInfo' -import { useRenderFlash } from '@/hooks/useRenderFlash' export type PlayerDisplayMode = 'normal' | 'minimized' | 'maximized' | 'sidebar' @@ -108,7 +107,6 @@ export function Player({ className, onPlayerModeChange }: PlayerProps) { const [showPlaylist, setShowPlaylist] = useState(false) const [isLoading, setIsLoading] = useState(false) - const playlistFlashClass = useRenderFlash([showPlaylist, state.playlist?.id, state.playlist?.sounds.length], 'purple') // Load initial state useEffect(() => { @@ -359,8 +357,7 @@ export function Player({ className, onPlayerModeChange }: PlayerProps) { {/* Playlist */} {showPlaylist && state.playlist && ( -
- {/* DEBUG: Playlist - PURPLE FLASH */} +
- {/* DEBUG: Playlist Sidebar - PURPLE FLASH */} +

Playlist

diff --git a/src/components/player/PlayerControls.tsx b/src/components/player/PlayerControls.tsx index f146ccd..87f7e14 100644 --- a/src/components/player/PlayerControls.tsx +++ b/src/components/player/PlayerControls.tsx @@ -18,7 +18,6 @@ import { VolumeX, } from 'lucide-react' import { memo, useMemo } from 'react' -import { useRenderFlash } from '@/hooks/useRenderFlash' interface PlayerControlsProps { status: PlayerState['status'] @@ -55,7 +54,6 @@ export const PlayerControls = memo(function PlayerControls({ }: PlayerControlsProps) { const isMinimized = variant === 'minimized' const isMaximized = variant === 'maximized' - const flashClass = useRenderFlash([status, mode, volume], 'green') const modeIcon = useMemo(() => { switch (mode) { @@ -79,8 +77,7 @@ export const PlayerControls = memo(function PlayerControls({ if (isMinimized) { return ( -

- {/* DEBUG: PlayerControls Minimized - GREEN FLASH */} +
-
+ ) }) \ No newline at end of file diff --git a/src/components/player/PlayerProgress.tsx b/src/components/player/PlayerProgress.tsx index 88a0a6b..814df38 100644 --- a/src/components/player/PlayerProgress.tsx +++ b/src/components/player/PlayerProgress.tsx @@ -2,7 +2,6 @@ import { Progress } from '@/components/ui/progress' import { cn } from '@/lib/utils' import { memo, useMemo } from 'react' import { NumberFlowDuration } from '../ui/number-flow-duration' -import { useRenderFlash } from '@/hooks/useRenderFlash' interface PlayerProgressProps { position: number @@ -19,11 +18,6 @@ export const PlayerProgress = memo(function PlayerProgress({ }: PlayerProgressProps) { const isMaximized = variant === 'maximized' - // Only flash when seconds actually change to avoid NumberFlow timing issues - const positionSeconds = Math.floor(position / 1000) - const durationSeconds = Math.floor(duration / 1000) - const flashClass = useRenderFlash([positionSeconds, durationSeconds], 'blue') - const progressPercentage = useMemo(() => (position / (duration || 1)) * 100, [position, duration] @@ -38,11 +32,7 @@ export const PlayerProgress = memo(function PlayerProgress({ } return ( -
- {/* DEBUG: PlayerProgress - BLUE FLASH */} +
- {/* DEBUG: PlayerTrackInfo - RED FLASH */} + <> {/* Album Art / Thumbnail */}
{currentSound?.thumbnail ? ( @@ -101,6 +98,6 @@ export const PlayerTrackInfo = memo(function PlayerTrackInfo({ )}
-
+ ) }) \ No newline at end of file diff --git a/src/hooks/useRenderFlash.ts b/src/hooks/useRenderFlash.ts deleted file mode 100644 index 6fd0bf1..0000000 --- a/src/hooks/useRenderFlash.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { useEffect, useRef, useState } from 'react' - -export function useRenderFlash(deps: any[], color: string = 'red', duration: number = 300) { - const [isFlashing, setIsFlashing] = useState(false) - const prevDepsRef = useRef(undefined) - - useEffect(() => { - // Check if this is the first render - if (!prevDepsRef.current) { - prevDepsRef.current = deps - return - } - - // Check if any dependency actually changed - const hasChanged = deps.some((dep, index) => dep !== prevDepsRef.current![index]) - - if (hasChanged) { - setIsFlashing(true) - const timer = setTimeout(() => { - setIsFlashing(false) - }, duration) - - prevDepsRef.current = deps - return () => clearTimeout(timer) - } - - prevDepsRef.current = deps - }, [...deps]) - - const flashClass = isFlashing - ? `border-2 border-${color}-500 border-dashed animate-pulse` - : '' - - return flashClass -} \ No newline at end of file