Compare commits

..
  • feat: no connection screen on web and mobile
    - Replace page content with a no-connection screen linking to Downloads when
      the network or server is unreachable; Downloads and the player stay usable
    - Detect it from the Convex socket plus Next's useOffline on web and
      expo-network on mobile, and recover on reconnect
    - Keep pages and app code in the service worker so reloads and launches work
      offline instead of showing the browser's offline page
    
    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 changed files with 186 additions and 247 deletions

No files matched your search

+21 -10
View File
@@ -77,39 +77,44 @@ const QUEUE_ACTIONS: MediaAction[] = ["play-next", "play-last", "shuffle"]
const MEDIA_ACTION_ITEMS: {
action: MediaAction
label: (favorited: boolean | undefined, playlistLabel: string) => string
label: (
countSuffix: string,
favorited: boolean | undefined,
playlistLabel: string
) => string
image: NonNullable<MenuAction["image"]> & string
destructive?: boolean
}[] = [
{
action: "playlist",
label: (_favorited, playlistLabel) => playlistLabel,
label: (countSuffix, _favorited, playlistLabel) =>
`${playlistLabel}${countSuffix}`,
image: "text.badge.plus",
},
{
action: "download",
label: () => "Download",
label: (countSuffix) => `Download${countSuffix}`,
image: "arrow.down.circle",
},
{
action: "remove-download",
label: () => "Remove Download",
label: (countSuffix) => `Remove Download${countSuffix}`,
image: "xmark.circle",
destructive: true,
},
{
action: "play-next",
label: () => "Play Next",
label: (countSuffix) => `Play Next${countSuffix}`,
image: "text.line.first.and.arrowtriangle.forward",
},
{
action: "play-last",
label: () => "Play Last",
label: (countSuffix) => `Play Last${countSuffix}`,
image: "text.line.last.and.arrowtriangle.forward",
},
{
action: "shuffle",
label: () => "Shuffle",
label: (countSuffix) => `Shuffle${countSuffix}`,
image: "shuffle",
},
{
@@ -129,7 +134,8 @@ const MEDIA_ACTION_ITEMS: {
},
{
action: "favorite",
label: (favorited) => (favorited ? "Unfavorite" : "Favorite"),
label: (countSuffix, favorited) =>
`${favorited ? "Unfavorite" : "Favorite"}${countSuffix}`,
image: "star",
},
{
@@ -200,7 +206,12 @@ function isActionIncluded(
export function buildMediaMenuActions(
config: Omit<MediaMenuConfig, "onAction">
): MenuAction[] {
const { favorited, playlistLabel = "Add to Playlist" } = config
const {
selectedCount = 1,
favorited,
playlistLabel = "Add to Playlist",
} = config
const countSuffix = selectedCount > 1 ? ` (${selectedCount})` : ""
const actions: MenuAction[] = []
@@ -219,7 +230,7 @@ export function buildMediaMenuActions(
actions.push({
id: item.action,
title: item.label(favorited, playlistLabel),
title: item.label(countSuffix, favorited, playlistLabel),
image: item.action === "favorite" && favorited ? "star.fill" : item.image,
...(item.destructive ? { attributes: { destructive: true } } : {}),
})
+22 -14
View File
@@ -198,8 +198,7 @@ function optionDetail(option: SizedDownloadOption, songCount: number) {
return `${included} of ${songCount} songs, ${option.fallbackCount} in High`
}
/** Centered popup asking which quality to download a target at. */
function DownloadQualityPopup({
function DownloadQualitySheet({
pending,
onClose,
onPick,
@@ -215,7 +214,7 @@ function DownloadQualityPopup({
return (
<Modal
visible={pending !== null}
animationType="fade"
animationType="slide"
transparent
onRequestClose={onClose}
>
@@ -223,11 +222,14 @@ function DownloadQualityPopup({
<Pressable style={styles.overlay} onPress={onClose}>
<Pressable
style={[
styles.popup,
styles.sheet,
{ backgroundColor: colors.card, borderColor: colors.border },
]}
onPress={(event) => event.stopPropagation()}
>
<View
style={[styles.grabber, { backgroundColor: colors.border }]}
/>
<Text style={[styles.title, { color: colors.foreground }]}>
Download Quality
</Text>
@@ -431,7 +433,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
<DownloadsContext.Provider value={value}>
{children}
{queue ? <DownloadSync queue={queue} /> : null}
<DownloadQualityPopup
<DownloadQualitySheet
pending={pending}
onClose={() => setPending(null)}
onPick={handlePick}
@@ -443,17 +445,23 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: "rgba(0,0,0,0.6)",
justifyContent: "center",
alignItems: "center",
padding: 24,
backgroundColor: "rgba(0,0,0,0.45)",
justifyContent: "flex-end",
},
popup: {
width: "100%",
maxWidth: 420,
borderRadius: 16,
sheet: {
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
borderWidth: 1,
padding: 16,
paddingHorizontal: 16,
paddingTop: 8,
paddingBottom: 24,
},
grabber: {
width: 36,
height: 4,
borderRadius: 2,
alignSelf: "center",
marginBottom: 12,
},
title: { fontSize: 18, fontWeight: "700" },
subtitle: { fontSize: 13, marginBottom: 4 },
+13 -6
View File
@@ -74,6 +74,10 @@ export function MediaMenuSeparator() {
)
}
function actionLabel(base: string, selectedCount: number) {
return selectedCount > 1 ? `${base} (${selectedCount})` : base
}
export function MediaContextMenuItems({
selectedCount,
onAction,
@@ -117,7 +121,7 @@ export function MediaContextMenuItems({
className="justify-between"
onClick={() => onAction("playlist")}
>
{playlistLabel}
{actionLabel(playlistLabel, selectedCount)}
<ListPlus />
</MediaMenuItem>
{downloaded !== undefined ? (
@@ -125,7 +129,10 @@ export function MediaContextMenuItems({
className="justify-between"
onClick={() => onAction(downloaded ? "remove-download" : "download")}
>
{downloaded ? "Remove Download" : "Download"}
{actionLabel(
downloaded ? "Remove Download" : "Download",
selectedCount
)}
{downloaded ? <CircleX /> : <ArrowDownToLine />}
</MediaMenuItem>
) : null}
@@ -134,21 +141,21 @@ export function MediaContextMenuItems({
className="justify-between"
onClick={() => onAction("play-next")}
>
Play Next
{actionLabel("Play Next", selectedCount)}
<ListStart />
</MediaMenuItem>
<MediaMenuItem
className="justify-between"
onClick={() => onAction("play-last")}
>
Play Last
{actionLabel("Play Last", selectedCount)}
<ListEnd />
</MediaMenuItem>
<MediaMenuItem
className="justify-between"
onClick={() => onAction("shuffle")}
>
Shuffle
{actionLabel("Shuffle", selectedCount)}
<Shuffle />
</MediaMenuItem>
{stationArtistId ? (
@@ -189,7 +196,7 @@ export function MediaContextMenuItems({
className="justify-between"
onClick={() => onAction("favorite")}
>
{favorited ? "Unfavorite" : "Favorite"}
{actionLabel(favorited ? "Unfavorite" : "Favorite", selectedCount)}
<Star />
</MediaMenuItem>
</>
-18
View File
@@ -103,11 +103,8 @@ type PlaybackContextValue = {
toggleShuffle: () => Promise<void>
cycleRepeat: () => Promise<void>
clearQueue: () => Promise<void>
clearHistory: () => Promise<void>
reorderQueue: (songIds: Id<"songs">[]) => Promise<void>
skipToQueueIndex: (index: number) => Promise<void>
/** Plays `history[index]`, moving it and every later song back into the queue. */
skipToHistoryIndex: (index: number) => Promise<void>
skipNext: () => Promise<void>
skipPrevious: () => Promise<void>
dolbyAtmosSupported: boolean | null
@@ -1458,10 +1455,6 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
setIsPlaying(false)
}, [store])
const clearHistory = useCallback(async () => {
store.update(playbackQueue.clearHistory)
}, [store])
const reorderQueue = useCallback(
async (songIds: Id<"songs">[]) => {
store.update((state) => playbackQueue.reorderQueue(state, songIds))
@@ -1476,13 +1469,6 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
[store]
)
const skipToHistoryIndex = useCallback(
async (index: number) => {
store.update((state) => playbackQueue.skipToHistoryIndex(state, index))
},
[store]
)
const skipNext = useCallback(async () => {
const before = store.getState()
if (before.repeatEnabled === "none" && before.queue.length <= 1) {
@@ -1564,10 +1550,8 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
toggleShuffle,
cycleRepeat,
clearQueue,
clearHistory,
reorderQueue,
skipToQueueIndex,
skipToHistoryIndex,
skipNext,
skipPrevious,
}),
@@ -1589,10 +1573,8 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
toggleShuffle,
cycleRepeat,
clearQueue,
clearHistory,
reorderQueue,
skipToQueueIndex,
skipToHistoryIndex,
skipNext,
skipPrevious,
]
+118 -178
View File
@@ -5,11 +5,13 @@ import * as React from "react"
import { PlaybackSongMeta } from "@/components/playback-song-meta"
import { usePlayback } from "@/components/playback-provider"
import { TrackCover, TrackRow } from "@/components/track-row"
import { Button } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Skeleton } from "@/components/ui/skeleton"
import { Spinner } from "@/components/ui/spinner"
import { useTrackSelection } from "@/hooks/use-track-selection"
import type { Id } from "@otunes/convex/_generated/dataModel"
import type { BrowseSong, QueueSong } from "@otunes/convex/types"
import type { BrowseSong, HistorySong, QueueSong } from "@otunes/convex/types"
import {
getContiguousSelectedIndices,
moveQueueBlock,
@@ -17,6 +19,7 @@ import {
import { getSelectionRangePositions } from "@/lib/selection-range-styles"
import { useSongs } from "@/lib/song-cache"
import { cn } from "@/lib/utils"
import { formatDuration } from "@/lib/format-duration"
const QUEUE_INITIAL_VISIBLE_COUNT = 100
const QUEUE_PAGE_SIZE = 50
@@ -29,13 +32,11 @@ type QueueItem = {
song: QueueSelectable | null
}
/** Upcoming songs only: queue index 0 is the current song, shown on its own. */
function toSelectableQueue(
songIds: Id<"songs">[],
songs: (BrowseSong | undefined)[]
): QueueItem[] {
return songIds.slice(1).map((songId, offset) => {
const queueIndex = offset + 1
return songIds.map((songId, queueIndex) => {
const selectionId = `${songId}-${queueIndex}`
const song = songs[queueIndex]
return {
@@ -46,75 +47,57 @@ function toSelectableQueue(
})
}
/** A played song; clicking it plays it again from that point in history. */
function HistorySongRow({
song,
historyIndex,
onPlay,
}: {
song: BrowseSong | undefined
historyIndex: number
onPlay: (historyIndex: number) => void
}) {
if (!song) {
return <QueueSongRowSkeleton />
}
function HistorySongRow({ song }: { song: HistorySong }) {
return (
<li
role="button"
tabIndex={0}
className="flex cursor-pointer items-center gap-3 px-4 py-2 text-sm hover:bg-foreground/5"
onClick={() => onPlay(historyIndex)}
onKeyDown={(event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault()
onPlay(historyIndex)
}
}}
>
<TrackCover
albumId={song.album.id}
alt={song.album.title}
inRange={false}
/>
<PlaybackSongMeta song={song} align="start" showAlbum={false} />
<li className="relative w-full py-2 text-left text-sm opacity-60">
<div className="relative z-10 flex items-center gap-3 px-2">
<TrackCover
albumId={song.album.id}
alt={song.album.title}
inRange={false}
square
/>
<PlaybackSongMeta
song={song}
isCurrent={false}
inRange={false}
align="start"
showAlbum={false}
/>
<span className="shrink-0 text-xs text-muted-foreground tabular-nums">
{formatDuration(song.durationSeconds)}
</span>
</div>
</li>
)
}
function QueueSongRowSkeleton() {
return (
<li className="flex items-center gap-3 px-4 py-2" aria-hidden>
<Skeleton className="size-10 shrink-0 rounded" />
<li className="flex items-center gap-3 px-2 py-2" aria-hidden>
<Skeleton className="size-10 shrink-0 rounded-none" />
<div className="flex min-w-0 flex-1 flex-col gap-1.5">
<Skeleton className="h-3.5 w-3/4" />
<Skeleton className="h-3 w-1/2" />
</div>
<Skeleton className="h-3 w-8 shrink-0" />
</li>
)
}
/**
* The queue sidebar, laid out like the mobile now playing queue: history above
* (scrolled out of view at first), then the current song and the upcoming
* songs, which can be dragged to reorder. Shuffle and repeat live in the
* player bar.
*/
export function QueuePanel() {
const {
queueSongIds,
queueHistorySongIds,
queueOpen,
clearHistory,
clearQueue,
reorderQueue,
skipToQueueIndex,
skipToHistoryIndex,
} = usePlayback()
const loadMoreRef = React.useRef<HTMLDivElement>(null)
const scrollRef = React.useRef<HTMLDivElement>(null)
const currentRef = React.useRef<HTMLDivElement>(null)
const nowPlayingRef = React.useRef<HTMLElement>(null)
const [visibleCount, setVisibleCount] = React.useState(
QUEUE_INITIAL_VISIBLE_COUNT
)
@@ -124,10 +107,15 @@ export function QueuePanel() {
[queueSongIds, visibleCount]
)
const visibleQueueSongs = useSongs(visibleQueueIds)
const historySongs = useSongs(queueHistorySongIds)
const currentSong = visibleQueueSongs[0]
const historySongMetadata = useSongs(queueHistorySongIds)
const historySongs = React.useMemo(
() =>
historySongMetadata.flatMap((song, historyIndex) =>
song ? [{ ...song, historyIndex }] : []
),
[historySongMetadata]
)
const hasMore = queueSongIds.length > visibleCount
const hasUpcoming = queueSongIds.length > 1
const selectableQueue = React.useMemo(
() => toSelectableQueue(visibleQueueIds, visibleQueueSongs),
@@ -137,21 +125,17 @@ export function QueuePanel() {
const [dragIndex, setDragIndex] = React.useState<number | null>(null)
const currentQueueSongId = queueSongIds[0]
// Keep the current song at the top as playback moves through the queue:
// jump there on open, then scroll smoothly as songs change.
const hasScrolledRef = React.useRef(false)
React.useLayoutEffect(() => {
const scroller = scrollRef.current
const current = currentRef.current
if (!queueOpen || !scroller || !current) {
React.useEffect(() => {
if (!queueOpen || queueSongIds.length === 0) {
return
}
scroller.scrollTo({
top: current.offsetTop,
behavior: hasScrolledRef.current ? "smooth" : "instant",
const frame = requestAnimationFrame(() => {
nowPlayingRef.current?.scrollIntoView({ block: "center" })
})
hasScrolledRef.current = true
}, [queueOpen, currentQueueSongId, queueHistorySongIds.length])
return () => cancelAnimationFrame(frame)
}, [queueOpen, queueSongIds.length, currentQueueSongId])
React.useEffect(() => {
if (!hasMore) {
@@ -159,8 +143,12 @@ export function QueuePanel() {
}
const sentinel = loadMoreRef.current
const root = scrollRef.current
if (!sentinel || !root) {
if (!sentinel) {
return
}
const viewport = sentinel.closest('[data-slot="scroll-area-viewport"]')
if (!viewport) {
return
}
@@ -170,7 +158,7 @@ export function QueuePanel() {
setVisibleCount((count) => count + QUEUE_PAGE_SIZE)
}
},
{ root, rootMargin: "240px" }
{ root: viewport, rootMargin: "240px" }
)
observer.observe(sentinel)
@@ -198,11 +186,6 @@ export function QueuePanel() {
[selectableQueue, skipToQueueIndex]
)
const handleHistoryPlay = React.useCallback(
(historyIndex: number) => void skipToHistoryIndex(historyIndex),
[skipToHistoryIndex]
)
const selectionPositions = React.useMemo(
() =>
getSelectionRangePositions(
@@ -257,119 +240,76 @@ export function QueuePanel() {
return (
<aside
className={cn(
"relative flex h-svh w-72 shrink-0 flex-col border-l bg-background",
"flex h-svh w-72 shrink-0 flex-col border-l bg-background",
"max-md:fixed max-md:inset-y-0 max-md:right-0 max-md:z-20 max-md:shadow-xl"
)}
>
<div
ref={scrollRef}
className="relative min-h-0 flex-1 [scrollbar-width:none] overflow-y-auto overscroll-contain"
>
{queueHistorySongIds.length > 0 ? (
<section>
<header className="flex items-center justify-between px-4 pt-3 pb-1">
<h2 className="text-base font-bold">History</h2>
<button
type="button"
className="text-sm text-muted-foreground hover:text-foreground"
onClick={() => void clearHistory()}
>
Clear
</button>
</header>
<ul className="flex flex-col">
{queueHistorySongIds.map((songId, historyIndex) => (
<HistorySongRow
key={`history-${songId}-${historyIndex}`}
song={historySongs[historyIndex]}
historyIndex={historyIndex}
onPlay={handleHistoryPlay}
/>
))}
</ul>
</section>
) : null}
<header className="flex items-center justify-between gap-2 border-b px-4 py-3">
<h1 className="text-lg font-semibold">Up Next</h1>
<Button
variant="ghost"
size="sm"
className="text-primary hover:text-primary"
onClick={() => void clearQueue()}
disabled={queueSongIds.length === 0}
>
Clear
</Button>
</header>
{/* Fills the viewport so the current song can always scroll to the top. */}
<div ref={currentRef} className="flex min-h-full flex-col">
{currentQueueSongId ? (
<div className="flex items-center gap-3 px-4 py-3">
{currentSong ? (
<>
<TrackCover
albumId={currentSong.album.id}
alt={currentSong.album.title}
inRange={false}
size="lg"
<ScrollArea className="min-h-0 flex-1">
{queueSongIds.length === 0 ? (
<p className="px-4 py-8 text-sm text-muted-foreground">
Nothing in the queue.
</p>
) : (
<>
{historySongs.length > 0 ? (
<ul className="flex flex-col border-b py-1">
{historySongs.map((song) => (
<HistorySongRow
key={`history-${song.id}-${song.historyIndex}`}
song={song}
/>
<PlaybackSongMeta
song={currentSong}
align="start"
showAlbum={false}
/>
</>
) : (
<Skeleton className="size-14 shrink-0 rounded-md" />
)}
</div>
) : null}
<header className="sticky top-0 z-20 flex items-center justify-between bg-background px-4 py-2">
<h2 className="text-base font-bold">Continue Playing</h2>
<button
type="button"
className="text-sm text-muted-foreground hover:text-foreground disabled:pointer-events-none disabled:opacity-50"
onClick={() => void clearQueue()}
disabled={queueSongIds.length === 0}
>
Clear
</button>
</header>
{hasUpcoming ? (
<>
<ul className="flex flex-col pb-8">
{selectableQueue.map((item, index) =>
item.song ? (
<TrackRow
key={item.selectionId}
variant="queue"
song={item.song}
index={index}
selectionPosition={selectionPositions[index]}
isDragging={draggingIndices.has(index)}
onPointerDown={handlePointerDown}
onSelect={handleRowSelect}
onPlay={handleRowPlay}
onDragStart={setDragIndex}
onDrop={handleDrop}
/>
) : (
<QueueSongRowSkeleton key={item.selectionId} />
)
)}
))}
</ul>
{hasMore ? (
<div
ref={loadMoreRef}
className="flex items-center justify-center py-4"
aria-hidden
>
<Spinner className="size-5 text-muted-foreground" />
</div>
) : null}
</>
) : (
<p className="flex flex-1 items-center justify-center px-4 pb-24 text-center text-lg font-semibold text-muted-foreground">
Nothing else is queued.
</p>
)}
</div>
</div>
<div
aria-hidden
className="pointer-events-none absolute inset-x-0 bottom-0 h-9 bg-linear-to-b from-transparent to-background"
/>
) : null}
<ul className="flex flex-col py-1">
{selectableQueue.map((item, index) =>
item.song ? (
<TrackRow
key={item.selectionId}
ref={item.queueIndex === 0 ? nowPlayingRef : undefined}
variant="queue"
song={item.song}
index={index}
isActive={item.queueIndex === 0}
isNowPlaying={item.queueIndex === 0}
selectionPosition={selectionPositions[index]}
isDragging={draggingIndices.has(index)}
onPointerDown={handlePointerDown}
onSelect={handleRowSelect}
onPlay={handleRowPlay}
onDragStart={setDragIndex}
onDrop={handleDrop}
/>
) : (
<QueueSongRowSkeleton key={item.selectionId} />
)
)}
</ul>
{hasMore ? (
<div
ref={loadMoreRef}
className="flex items-center justify-center py-4"
aria-hidden
>
<Spinner className="size-5 text-muted-foreground" />
</div>
) : null}
</>
)}
</ScrollArea>
</aside>
)
}
+12 -21
View File
@@ -3,7 +3,7 @@
import * as React from "react"
import Image from "next/image"
import Link from "next/link"
import { ArrowDownToLine, Menu, Music2, Play, Star, Trash2 } from "lucide-react"
import { ArrowDownToLine, Music2, Play, Star, Trash2 } from "lucide-react"
import {
MediaContextMenu,
@@ -38,7 +38,7 @@ import type { DownloadSource } from "@otunes/convex/client/download-queue"
* columns (use with `LibraryTrackListHeader`).
* - `album`: favorite star, track number, title with optional credits.
* - `playlist`: cover with favorite overlay, track number, title.
* - `queue`: cover, title and artist, duration, and a reorder grip. No menu.
* - `queue`: square cover, title and artist, no menu.
*/
export type TrackRowVariant = "library" | "album" | "playlist" | "queue"
@@ -89,14 +89,13 @@ export function TrackCover({
albumId,
alt,
inRange,
size = "md",
square = false,
children,
}: {
albumId: string | undefined
alt: string
inRange: boolean
/** `lg` is the larger current-song cover in the queue. */
size?: "md" | "lg"
square?: boolean
/** Overlay shown above the cover image. */
children?: React.ReactNode
}) {
@@ -106,8 +105,8 @@ export function TrackCover({
return (
<div
className={cn(
"flex shrink-0 items-center justify-center bg-muted ring-1",
size === "lg" ? "size-14 rounded-md" : "size-10 rounded",
"flex size-10 shrink-0 items-center justify-center bg-muted ring-1",
!square && "rounded",
ringClass
)}
>
@@ -119,8 +118,8 @@ export function TrackCover({
return (
<div
className={cn(
"group/cover relative shrink-0 overflow-hidden ring-1",
size === "lg" ? "size-14 rounded-md" : "size-10 rounded",
"group/cover relative size-10 shrink-0 overflow-hidden ring-1",
!square && "rounded",
ringClass
)}
>
@@ -128,7 +127,7 @@ export function TrackCover({
src={albumCoverUrl(albumId)}
alt={alt}
fill
sizes={size === "lg" ? "56px" : "40px"}
sizes="40px"
className="object-cover"
/>
{children}
@@ -278,9 +277,7 @@ function TrackRowComponent({
const inRange = isInSelectionRange(selectionPosition)
const downloadState = useSongDownloadState(song.id, downloadCollection)
const isDownloaded = downloadState === "here"
// The queue row only shows the duration, like the mobile queue.
const showDownloaded =
variant !== "queue" && (isDownloaded || downloadState === "device")
const showDownloaded = isDownloaded || downloadState === "device"
const flush = variant === "library" || variant === "queue"
const play = () => onPlay(index)
const toggleFavorite = () => onToggleFavorite?.(song.id)
@@ -462,11 +459,12 @@ function TrackRowComponent({
break
case "queue":
content = (
<div className="relative z-10 flex items-center gap-3 pr-2 pl-4">
<div className="relative z-10 flex items-center gap-3 px-2">
<TrackCover
albumId={song.album.id}
alt={song.album.title}
inRange={inRange}
square
/>
<PlaybackSongMeta
song={song}
@@ -476,13 +474,6 @@ function TrackRowComponent({
showAlbum={false}
/>
{duration}
<Menu
aria-hidden
className={cn(
"size-4 shrink-0 cursor-grab",
inRange ? "text-primary-foreground" : "text-muted-foreground"
)}
/>
</div>
)
break