feat: v1.1.0 - Major UI/UX improvements and new features

- Remove confirmation dialogs for song deletion (faster workflow)
- Add bulk playlist creation from YouTube playlist URLs
- Display playlist tags on song cards in home page
- Enable moving songs between playlists
- Fix mobile UI: action buttons now appear above player bar
- Add bulk song selection and deletion from home page
- Improve loading states and user feedback
- Update documentation and CI/CD workflow
- Fix all toast messages to English
This commit is contained in:
bitc0de committed 2025-12-25 13:15:34 +01:00
1 parent 84ae14bfb5
commit 706d808b83
10 files changed
+1604 -245

No files matched your search

+3 -3
View File
@@ -180,7 +180,7 @@ export default function PlayerBar({
if (!currentSong) {
return (
<div className="fixed bottom-0 left-0 right-0 bg-gray-900 border-t border-gray-800 p-4">
<div className="fixed bottom-0 left-0 right-0 bg-gray-900 border-t border-gray-800 p-4 z-50">
<div className="flex items-center justify-center text-gray-500">
Select a song to start playing
</div>
@@ -191,8 +191,8 @@ export default function PlayerBar({
return (
<>
<audio ref={audioRef} />
<div className="fixed bottom-0 left-0 right-0 bg-gray-900 border-t border-gray-800 p-2 sm:p-4">
<div className="flex flex-col gap-2 sm:gap-3">
<div className="fixed bottom-0 left-0 right-0 bg-gray-900 border-t border-gray-800 p-2 sm:p-4 z-50">
<div className="flex flex-col gap-2 sm:gap-3 z-50">
{/* Song Info - Always on top in mobile */}
<div className="flex items-center gap-3 w-full">
<div className="relative w-12 h-12 sm:w-14 sm:h-14 rounded-md overflow-hidden flex-shrink-0">
+106 -43
View File
@@ -2,7 +2,7 @@
import { useState } from 'react'
import Image from 'next/image'
import { Play, Trash2, ListPlus } from 'lucide-react'
import { Play, Trash2, ListPlus, ArrowRight, CheckSquare } from 'lucide-react'
interface Song {
id: string
@@ -11,6 +11,7 @@ interface Song {
channelName: string
thumbnail: string
duration: number
playlists?: Playlist[]
}
interface Playlist {
@@ -24,6 +25,11 @@ interface SongCardProps {
onDelete: (songId: string) => void
playlists?: Playlist[]
onAddToPlaylist?: (songId: string, playlistId: string) => void
currentPlaylistId?: string
onMoveToPlaylist?: (songId: string, fromPlaylistId: string, toPlaylistId: string) => void
isSelectionMode?: boolean
isSelected?: boolean
onToggleSelection?: (songId: string) => void
}
function formatDuration(seconds: number): string {
@@ -32,24 +38,24 @@ function formatDuration(seconds: number): string {
return `${mins}:${secs.toString().padStart(2, '0')}`
}
export default function SongCard({ song, onPlay, onDelete, playlists, onAddToPlaylist }: SongCardProps) {
export default function SongCard({
song,
onPlay,
onDelete,
playlists,
onAddToPlaylist,
currentPlaylistId,
onMoveToPlaylist,
isSelectionMode = false,
isSelected = false,
onToggleSelection
}: SongCardProps) {
const [showPlaylistMenu, setShowPlaylistMenu] = useState(false)
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
const [showMoveMenu, setShowMoveMenu] = useState(false)
const handleDelete = (e: React.MouseEvent) => {
e.stopPropagation()
setShowDeleteConfirm(true)
}
const confirmDelete = (e: React.MouseEvent) => {
e.stopPropagation()
onDelete(song.id)
setShowDeleteConfirm(false)
}
const cancelDelete = (e: React.MouseEvent) => {
e.stopPropagation()
setShowDeleteConfirm(false)
}
const handleAddToPlaylist = (e: React.MouseEvent, playlistId: string) => {
@@ -60,45 +66,53 @@ export default function SongCard({ song, onPlay, onDelete, playlists, onAddToPla
setShowPlaylistMenu(false)
}
const handleMoveToPlaylist = (e: React.MouseEvent, toPlaylistId: string) => {
e.stopPropagation()
if (onMoveToPlaylist && currentPlaylistId) {
onMoveToPlaylist(song.id, currentPlaylistId, toPlaylistId)
}
setShowMoveMenu(false)
}
const toggleMoveMenu = (e: React.MouseEvent) => {
e.stopPropagation()
setShowMoveMenu(!showMoveMenu)
}
const togglePlaylistMenu = (e: React.MouseEvent) => {
e.stopPropagation()
setShowPlaylistMenu(!showPlaylistMenu)
}
return (
<div className="bg-gray-800 rounded-lg p-4 hover:bg-gray-700 transition-colors cursor-pointer group relative">
{/* Delete confirmation modal */}
{showDeleteConfirm && (
<div
className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
onClick={cancelDelete}
>
<div
className="bg-gray-900 rounded-lg p-6 max-w-sm w-full mx-4 border border-gray-700"
onClick={(e) => e.stopPropagation()}
<div className={`bg-gray-800 rounded-lg p-4 transition-colors group relative ${
isSelectionMode
? 'cursor-default hover:bg-gray-750'
: 'cursor-pointer hover:bg-gray-700'
} ${isSelected ? 'ring-2 ring-blue-500 bg-gray-750' : ''}`}
onClick={isSelectionMode ? () => onToggleSelection?.(song.id) : () => onPlay(song)}>
{/* Selection checkbox */}
{isSelectionMode && (
<div className="absolute top-2 left-2 z-20">
<button
onClick={(e) => {
e.stopPropagation()
onToggleSelection?.(song.id)
}}
className={`w-6 h-6 rounded border-2 flex items-center justify-center transition-colors ${
isSelected
? 'bg-blue-500 border-blue-500 text-white'
: 'border-gray-400 hover:border-gray-300'
}`}
>
<h3 className="text-white text-lg font-semibold mb-2">Delete song?</h3>
<p className="text-gray-400 mb-6">Are you sure you want to delete "{song.title}"?</p>
<div className="flex gap-3 justify-end">
<button
onClick={cancelDelete}
className="px-4 py-2 cursor-pointer bg-gray-700 text-white rounded-lg hover:bg-gray-600 transition-colors"
>
Cancel
</button>
<button
onClick={confirmDelete}
className="px-4 py-2 cursor-pointer bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors"
>
Delete
</button>
</div>
</div>
{isSelected && <CheckSquare size={14} fill="currentColor" />}
</button>
</div>
)}
<div className="absolute top-2 right-2 z-10 flex gap-2">
{playlists && playlists.length > 0 && onAddToPlaylist && (
{!isSelectionMode && playlists && playlists.length > 0 && onAddToPlaylist && (
<div className="relative">
<button
onClick={togglePlaylistMenu}
@@ -124,6 +138,35 @@ export default function SongCard({ song, onPlay, onDelete, playlists, onAddToPla
</div>
)}
{!isSelectionMode && currentPlaylistId && playlists && playlists.length > 1 && onMoveToPlaylist && (
<div className="relative">
<button
onClick={toggleMoveMenu}
className="bg-green-500 cursor-pointer rounded-full p-1.5 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity hover:bg-green-600"
title="Move to another playlist"
>
<ArrowRight size={16} className="text-white" />
</button>
{showMoveMenu && (
<div className="absolute right-0 mt-2 w-48 bg-gray-900 border border-gray-700 rounded-lg shadow-lg py-1 max-h-60 overflow-y-auto z-20">
{playlists
.filter(playlist => playlist.id !== currentPlaylistId)
.map((playlist) => (
<button
key={playlist.id}
onClick={(e) => handleMoveToPlaylist(e, playlist.id)}
className="w-full cursor-pointer text-left px-4 py-2 text-sm text-white hover:bg-gray-800 transition-colors"
>
{playlist.name}
</button>
))}
</div>
)}
</div>
)}
{!isSelectionMode && (
<button
onClick={handleDelete}
className="bg-red-500 cursor-pointer rounded-full p-1.5 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity hover:bg-red-600"
@@ -131,6 +174,7 @@ export default function SongCard({ song, onPlay, onDelete, playlists, onAddToPla
>
<Trash2 size={16} className="text-white" />
</button>
)}
</div>
<div className="relative mb-4 w-full aspect-video rounded-md overflow-hidden bg-gray-900">
@@ -155,6 +199,25 @@ export default function SongCard({ song, onPlay, onDelete, playlists, onAddToPla
{song.title}
</h3>
{song.playlists && song.playlists.length > 0 && (
<div className="flex flex-wrap gap-1 mb-2">
{song.playlists.slice(0, 2).map((playlist) => (
<span
key={playlist.id}
className="inline-block bg-green-600 text-white text-xs px-2 py-0.5 rounded-full truncate max-w-20"
title={playlist.name}
>
{playlist.name}
</span>
))}
{song.playlists.length > 2 && (
<span className="inline-block bg-gray-600 text-white text-xs px-2 py-0.5 rounded-full">
+{song.playlists.length - 2}
</span>
)}
</div>
)}
<div className="flex justify-between items-center">
<p className="text-gray-400 text-sm truncate flex-1" title={song.channelName}>
{song.channelName}