feat: Smart play/pause overlay on DetailPanel album art

DetailPanel.tsx:
- Added isPlaying and currentClipId props to track playback state
- Added onTogglePlay prop for pausing currently-playing track
- Album art click handler now smart:
  * If this track IS playing → pause it (onTogglePlay)
  * If this track is NOT playing → play it (onPlay)
- Hover overlay icon adapts dynamically:
  * Currently playing + hover → shows PAUSE icon (⏸)
  * Not playing + hover → shows PLAY icon (▶)
- Works for both artwork images and placeholder state

App.tsx:
- Passes isPlaying, currentClipId, and onTogglePlay to DetailPanel

Visual states:
- Different track in panel: ▶ on hover (click to play)
- Same track playing: ⏸ on hover (click to pause)
- Same track paused: ▶ on hover (click to resume)
This commit is contained in:
rin.kagamine committed 2026-05-29 21:49:36 -04:00
1 parent 4808406113
commit fa3515acc9
2 files changed
+39 -9

No files matched your search

+3
View File
@@ -229,12 +229,15 @@ function App() {
{selectedClip && (
<DetailPanel
clip={selectedClip}
isPlaying={isPlaying}
currentClipId={currentClip?.id}
onClose={() => setSelectedClip(null)}
onRename={handleRename}
onDelete={handleDelete}
onUploadArtwork={handleUploadArtwork}
onRemoveArtwork={handleRemoveArtwork}
onPlay={handlePlay}
onTogglePlay={() => setIsPlaying(!isPlaying)}
/>
)}