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:
@@ -71,7 +71,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<LikeButton entityType="track" entityId={current.id} />
|
<LikeButton entityType="track" entityId={current.id} />
|
||||||
<TrackMenu track={current} direction="up" />
|
<TrackMenu track={current} direction="up" hideQueueActions />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Center: seek row + transport row -->
|
<!-- Center: seek row + transport row -->
|
||||||
|
|||||||
@@ -29,12 +29,17 @@
|
|||||||
|
|
||||||
let {
|
let {
|
||||||
track,
|
track,
|
||||||
direction = 'down'
|
direction = 'down',
|
||||||
|
hideQueueActions = false
|
||||||
}: {
|
}: {
|
||||||
track: TrackRef;
|
track: TrackRef;
|
||||||
/** Whether the dropdown opens above the trigger ('up') or below ('down').
|
/** Whether the dropdown opens above the trigger ('up') or below ('down').
|
||||||
Pass 'up' when used near the bottom of the viewport (e.g. PlayerBar). */
|
Pass 'up' when used near the bottom of the viewport (e.g. PlayerBar). */
|
||||||
direction?: 'up' | 'down';
|
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();
|
} = $props();
|
||||||
|
|
||||||
let menuOpen = $state(false);
|
let menuOpen = $state(false);
|
||||||
@@ -154,10 +159,12 @@
|
|||||||
{direction === 'up' ? 'bottom-full mb-1' : 'top-full mt-1'}"
|
{direction === 'up' ? 'bottom-full mb-1' : 'top-full mt-1'}"
|
||||||
onclick={(e) => e.stopPropagation()}
|
onclick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<TrackMenuItem icon={ListPlus} label="Play next" onclick={onPlayNext} />
|
{#if !hideQueueActions}
|
||||||
<TrackMenuItem icon={Plus} label="Add to queue" onclick={onAddToQueue} />
|
<TrackMenuItem icon={ListPlus} label="Play next" onclick={onPlayNext} />
|
||||||
|
<TrackMenuItem icon={Plus} label="Add to queue" onclick={onAddToQueue} />
|
||||||
|
|
||||||
<TrackMenuDivider />
|
<TrackMenuDivider />
|
||||||
|
{/if}
|
||||||
|
|
||||||
<TrackMenuItem
|
<TrackMenuItem
|
||||||
icon={liked ? HeartOff : Heart}
|
icon={liked ? HeartOff : Heart}
|
||||||
|
|||||||
Reference in New Issue
Block a user