diff --git a/apps/web/components/queue-panel.tsx b/apps/web/components/queue-panel.tsx
index b318ffa..6f2cf9e 100644
--- a/apps/web/components/queue-panel.tsx
+++ b/apps/web/components/queue-panel.tsx
@@ -3,12 +3,16 @@
import * as React from "react"
import { useFavorites } from "@/components/favorites-provider"
-import type { MediaContextAction } from "@/components/media-context-menu"
+import {
+ MediaContextMenuArea,
+ type MediaContextAction,
+} from "@/components/media-context-menu"
import { PlaybackSongMeta } from "@/components/playback-song-meta"
import { usePlayback } from "@/components/playback-provider"
import { TrackCover, TrackRow } from "@/components/track-row"
import { Skeleton } from "@/components/ui/skeleton"
import { Spinner } from "@/components/ui/spinner"
+import { useSongDownloadState } from "@/hooks/use-downloads"
import { useMediaActions } from "@/hooks/use-media-actions"
import { useTrackSelection } from "@/hooks/use-track-selection"
import type { Id } from "@otunes/convex/_generated/dataModel"
@@ -50,6 +54,51 @@ function toSelectableQueue(
})
}
+/**
+ * Opens the song's right-click menu over `children`, for the queue rows that
+ * stand alone (history and the current song) rather than in the selection.
+ */
+function SongMenuArea({
+ song,
+ children,
+}: {
+ song: BrowseSong
+ children: React.ReactElement
+}) {
+ const { isSongFavorite, toggleSongFavorite } = useFavorites()
+ const { runSongsAction } = useMediaActions()
+ const downloaded = useSongDownloadState(song.id) === "here"
+
+ function handleAction(action: MediaContextAction) {
+ if (action === "favorite") {
+ void toggleSongFavorite(song.id)
+ return
+ }
+ runSongsAction(action, [song.id], song.artist.id)
+ }
+
+ return (
+