From 813c289bc0c3e07fdf9b37925c1439beebcf5cb2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 23 Nov 2026 13:01:40 -0500 Subject: [PATCH] fix(web): track menus open past a short list, and the player's flag box opens up TrackList no longer clips its rows, so a row's menu shows under a one-row search result; the first and last rows round their own corners instead. The flag box takes its menu's direction, so on the player bar it opens above the bar instead of off the screen. Co-Authored-By: Claude Opus 5.5 --- web/src/lib/components/FlagPopover.svelte | 9 +++++++-- web/src/lib/components/TrackList.svelte | 9 ++++++++- web/src/lib/components/TrackMenu.svelte | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/lib/components/FlagPopover.svelte b/web/src/lib/components/FlagPopover.svelte index 12de10f4..fc4efbf1 100644 --- a/web/src/lib/components/FlagPopover.svelte +++ b/web/src/lib/components/FlagPopover.svelte @@ -11,12 +11,16 @@ track, onClose, initialReason, - initialNotes + initialNotes, + direction = 'down' }: { track: TrackRef; onClose: () => void; initialReason?: QuarantineReason; initialNotes?: string; + /** Whether the box opens above its trigger ('up') or below ('down'), as + the menu that opened it does: 'up' near the bottom of the screen. */ + direction?: 'up' | 'down'; } = $props(); let reason: QuarantineReason = $state(untrack(() => initialReason ?? 'bad_rip')); @@ -48,7 +52,8 @@ tabindex="-1" aria-modal="false" aria-labelledby="flag-popover-title" - class="absolute right-0 z-30 mt-1 w-72 rounded-lg border border-border bg-surface p-3 shadow-xl" + class="absolute right-0 z-30 w-72 rounded-lg border border-border bg-surface p-3 shadow-xl + {direction === 'up' ? 'bottom-full mb-1' : 'top-full mt-1'}" onclick={(e) => e.stopPropagation()} onkeydown={(e) => { e.stopPropagation(); if (e.key === 'Escape') onClose(); }} > diff --git a/web/src/lib/components/TrackList.svelte b/web/src/lib/components/TrackList.svelte index 14ece48b..0f6f9579 100644 --- a/web/src/lib/components/TrackList.svelte +++ b/web/src/lib/components/TrackList.svelte @@ -2,11 +2,18 @@ // The box every track list sits in. No fill of its own: // the rows stripe themselves, and a filled box would hide the stripe. // Rows are direct children so `odd:` counts them. + // + // The box does not clip its rows: a row's menu opens past the box's edge, + // and in a short list (one search result) clipping would hide it. The first + // and last rows round their own corners instead, so their fill stays inside + // the border. import type { Snippet } from 'svelte'; let { children }: { children: Snippet } = $props(); -
+
{@render children()}
diff --git a/web/src/lib/components/TrackMenu.svelte b/web/src/lib/components/TrackMenu.svelte index ef7f0377..518280c6 100644 --- a/web/src/lib/components/TrackMenu.svelte +++ b/web/src/lib/components/TrackMenu.svelte @@ -191,7 +191,7 @@ {/if} {#if flagOpen} - + {/if} {#if addOpen}