feat(web): move playlist search to the top right
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ae87200f0
commit
f8a68029c1
4 files changed
+34
-22
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { CollectionDetailSkeleton } from "@/components/library-skeletons"
|
||||
|
||||
export default function Loading() {
|
||||
return <CollectionDetailSkeleton />
|
||||
return <CollectionDetailSkeleton search />
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CollectionDetailSkeleton } from "@/components/library-skeletons"
|
||||
|
||||
export default function Loading() {
|
||||
return <CollectionDetailSkeleton />
|
||||
return <CollectionDetailSkeleton search />
|
||||
}
|
||||
@@ -148,11 +148,23 @@ export function SongListSkeleton() {
|
||||
)
|
||||
}
|
||||
|
||||
/** Matches the header + track list layout of album and playlist pages. */
|
||||
export function CollectionDetailSkeleton() {
|
||||
/**
|
||||
* Matches the header + track list layout of album and playlist pages.
|
||||
* Pass `search` on playlist pages to reserve the "Find in Playlist" toolbar row.
|
||||
*/
|
||||
export function CollectionDetailSkeleton({
|
||||
search = false,
|
||||
}: {
|
||||
search?: boolean
|
||||
}) {
|
||||
return (
|
||||
<LoadingRegion className="flex h-svh flex-col overflow-hidden pb-28">
|
||||
<PageHeader />
|
||||
{search ? (
|
||||
<div className="flex shrink-0 justify-end px-4 pt-3 pb-1">
|
||||
<Skeleton className="h-9 w-full rounded-full md:w-64" />
|
||||
</div>
|
||||
) : null}
|
||||
<div className="mx-auto w-full max-w-9/10 min-w-0">
|
||||
<div className="flex flex-col gap-8 px-6 pt-6 pb-8 sm:flex-row sm:items-end">
|
||||
<Skeleton className="mx-auto aspect-square w-full max-w-60 shrink-0 rounded-lg sm:mx-0" />
|
||||
|
||||
@@ -342,6 +342,24 @@ export function PlaylistView({ playlist }: { playlist: BrowsePlaylistDetail }) {
|
||||
return (
|
||||
<div className="flex h-svh flex-col">
|
||||
<PageHeader openApp />
|
||||
<div className="flex shrink-0 justify-end px-4 pt-3 pb-1">
|
||||
<div className="relative w-full md:w-64">
|
||||
<SearchIcon className="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<input
|
||||
type="search"
|
||||
aria-label="Find in playlist"
|
||||
placeholder="Find in Playlist"
|
||||
value={searchQuery}
|
||||
onChange={(event) => {
|
||||
setSearchQuery(event.target.value)
|
||||
clearSelection()
|
||||
setActiveTrackId("")
|
||||
setDragIndex(null)
|
||||
}}
|
||||
className="h-9 w-full min-w-0 rounded-full border border-input bg-input/30 pr-3 pl-9 text-sm text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ScrollArea className="min-h-0 flex-1">
|
||||
<div className="pb-28">
|
||||
<div className="mx-auto w-full max-w-9/10 min-w-0">
|
||||
@@ -478,24 +496,6 @@ export function PlaylistView({ playlist }: { playlist: BrowsePlaylistDetail }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="px-6 pb-4">
|
||||
<div className="relative max-w-sm">
|
||||
<SearchIcon className="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<input
|
||||
type="search"
|
||||
aria-label="Search playlist"
|
||||
placeholder="Search playlist"
|
||||
value={searchQuery}
|
||||
onChange={(event) => {
|
||||
setSearchQuery(event.target.value)
|
||||
clearSelection()
|
||||
setActiveTrackId("")
|
||||
setDragIndex(null)
|
||||
}}
|
||||
className="h-10 w-full min-w-0 rounded-full border border-input bg-input/30 pr-3 pl-9 text-sm text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{filteredSongs.length > 0 ? (
|
||||
<VirtualList
|
||||
count={filteredSongs.length}
|
||||
|
||||
Reference in new issue
Block a user