fix(web): hide Play next / Add to queue on PlayerBar's track menu

Those actions don't have meaningful semantics for the track you're
already listening to. New TrackMenu prop hideQueueActions gates the
pair; PlayerBar passes it true. Other mount sites (track rows in
lists) keep the full 8-entry menu.
This commit is contained in:
2026-05-03 14:08:29 -04:00
parent 4b101481fc
commit 7faa7b4e1f
2 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -71,7 +71,7 @@
</a>
</div>
<LikeButton entityType="track" entityId={current.id} />
<TrackMenu track={current} direction="up" />
<TrackMenu track={current} direction="up" hideQueueActions />
</div>
<!-- Center: seek row + transport row -->
+11 -4
View File
@@ -29,12 +29,17 @@
let {
track,
direction = 'down'
direction = 'down',
hideQueueActions = false
}: {
track: TrackRef;
/** Whether the dropdown opens above the trigger ('up') or below ('down').
Pass 'up' when used near the bottom of the viewport (e.g. PlayerBar). */
direction?: 'up' | 'down';
/** Hide "Play next" / "Add to queue". Set true on the PlayerBar where
the menu's track IS the currently-playing one — those actions have
no meaningful semantics for the track you're already listening to. */
hideQueueActions?: boolean;
} = $props();
let menuOpen = $state(false);
@@ -154,10 +159,12 @@
{direction === 'up' ? 'bottom-full mb-1' : 'top-full mt-1'}"
onclick={(e) => e.stopPropagation()}
>
<TrackMenuItem icon={ListPlus} label="Play next" onclick={onPlayNext} />
<TrackMenuItem icon={Plus} label="Add to queue" onclick={onAddToQueue} />
{#if !hideQueueActions}
<TrackMenuItem icon={ListPlus} label="Play next" onclick={onPlayNext} />
<TrackMenuItem icon={Plus} label="Add to queue" onclick={onAddToQueue} />
<TrackMenuDivider />
<TrackMenuDivider />
{/if}
<TrackMenuItem
icon={liked ? HeartOff : Heart}