From 87a2f06053d87001db644328b6f63f93336fa64d Mon Sep 17 00:00:00 2001 From: angel Date: Tue, 1 Jul 2025 21:52:36 +0000 Subject: [PATCH] feat: update commit SHA, enhance artist page with new layout and favorite functionality, improve settings page with first-time setup option --- .env.local | 2 +- app/components/WhatsNewPopup.tsx | 2 +- app/components/artist-icon.tsx | 66 +++++++++++++++++++++++++++----- app/components/sidebar.tsx | 2 +- app/library/artists/page.tsx | 53 ++++++++++++++++++++----- app/settings/page.tsx | 31 +++++++++++++++ 6 files changed, 134 insertions(+), 22 deletions(-) diff --git a/.env.local b/.env.local index a7d1334..847efe7 100644 --- a/.env.local +++ b/.env.local @@ -1 +1 @@ -NEXT_PUBLIC_COMMIT_SHA=3ca162e +NEXT_PUBLIC_COMMIT_SHA=bc159ac diff --git a/app/components/WhatsNewPopup.tsx b/app/components/WhatsNewPopup.tsx index 11b4c1d..17dc71d 100644 --- a/app/components/WhatsNewPopup.tsx +++ b/app/components/WhatsNewPopup.tsx @@ -23,7 +23,7 @@ const CHANGELOG = [ 'Improved search and browsing experience', 'Added history tracking for played songs', 'New Library Artist Page', - 'Artist page with top songs and albums', + 'Enhanced audio player with better controls', 'Added settings page for customization options', 'Introduced Whats New popup for version updates', 'Improved UI consistency with new Badge component', diff --git a/app/components/artist-icon.tsx b/app/components/artist-icon.tsx index c9431ef..7c766a7 100644 --- a/app/components/artist-icon.tsx +++ b/app/components/artist-icon.tsx @@ -3,7 +3,6 @@ import Image from "next/image" import { PlusCircledIcon } from "@radix-ui/react-icons" import { useRouter } from 'next/navigation'; - import { cn } from "@/lib/utils" import { ContextMenu, @@ -15,20 +14,23 @@ import { ContextMenuSubTrigger, ContextMenuTrigger, } from "../../components/ui/context-menu" - -import { Artist } from "@/lib/navidrome" -import { useNavidrome } from "./NavidromeContext" import { useAudioPlayer } from "@/app/components/AudioPlayerContext"; import { getNavidromeAPI } from "@/lib/navidrome"; +import { Card, CardContent } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { useNavidrome } from '@/app/components/NavidromeContext'; +import { Artist } from '@/lib/navidrome'; interface ArtistIconProps extends React.HTMLAttributes { artist: Artist size?: number + imageOnly?: boolean } export function ArtistIcon({ artist, size = 150, + imageOnly = false, className, ...props }: ArtistIconProps) { @@ -57,11 +59,59 @@ export function ArtistIcon({ ? api.getCoverArtUrl(artist.coverArt, 200) : '/default-user.jpg'; + // If imageOnly is true, return just the image without context menu or text + if (imageOnly) { + return ( +
+ {artist.name} +
+ ); + } + return (
-
+
handleClick()} + > +
+ {artist.name} +
+
+ +
+
+ +

{artist.name}

+

+ {artist.albumCount} albums +

+
+ + {/*
-
+
*/}
@@ -117,10 +167,6 @@ export function ArtistIcon({ Share
-
-

{artist.name}

-

{artist.albumCount} albums

-
); } diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx index 4eb0d2b..09ab212 100644 --- a/app/components/sidebar.tsx +++ b/app/components/sidebar.tsx @@ -55,7 +55,7 @@ export function Sidebar({ className, playlists, collapsed = false, onToggle }: S {collapsed ? : } -
+

Discover diff --git a/app/library/artists/page.tsx b/app/library/artists/page.tsx index 5c05a4b..299a298 100644 --- a/app/library/artists/page.tsx +++ b/app/library/artists/page.tsx @@ -7,17 +7,34 @@ import { Separator } from "@/components/ui/separator"; import { Tabs, TabsContent } from "@/components/ui/tabs"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Card, CardContent } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; import { ArtistIcon } from '@/app/components/artist-icon'; import { useNavidrome } from '@/app/components/NavidromeContext'; import { Artist } from '@/lib/navidrome'; import Loading from '@/app/components/loading'; -import { Search } from 'lucide-react'; +import { Search, Heart } from 'lucide-react'; +import { useRouter } from 'next/navigation'; +import Image from 'next/image'; export default function ArtistPage() { - const { artists, isLoading } = useNavidrome(); + const { artists, isLoading, api, starItem, unstarItem } = useNavidrome(); const [filteredArtists, setFilteredArtists] = useState([]); const [searchQuery, setSearchQuery] = useState(''); const [sortBy, setSortBy] = useState<'name' | 'albumCount'>('name'); + const router = useRouter(); + + const toggleFavorite = async (artistId: string, isStarred: boolean) => { + if (isStarred) { + await unstarItem(artistId, 'artist'); + } else { + await starItem(artistId, 'artist'); + } + }; + + const handleViewArtist = (artist: Artist) => { + router.push(`/artist/${artist.id}`); + }; useEffect(() => { if (artists.length > 0) { @@ -87,14 +104,32 @@ export default function ArtistPage() {

-
+
{filteredArtists.map((artist) => ( - + +
handleViewArtist(artist)}> +
+ {artist.name} +
+
+ +
+
+ +

{artist.name}

+

+ {artist.albumCount} albums +

+
+
))}
diff --git a/app/settings/page.tsx b/app/settings/page.tsx index 82096ac..081e0fe 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -443,6 +443,37 @@ const SettingsPage = () => { + + + + + Application Settings + + + General application preferences and setup + + + +
+ + +

+ Re-run the initial setup wizard to configure your preferences from scratch +

+
+
+
+