fix(web): move {@const} blocks to immediate children of {#each}

Svelte 5 requires {@const} to be a direct child of certain blocks
({#snippet}, {#if}, {#each}, etc.). Placing them inside <li>
bodies broke the build with const_tag_invalid_placement. Moved
the RowAction const declarations up so they sit between {#each}
and the <li> opener; the each-binding (u/r) is in scope for the
entire each block body, so the consts behave identically.

Caught by local docker build on dev:
  src/routes/admin/users/+page.svelte:259:12
  https://svelte.dev/e/const_tag_invalid_placement

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-09 20:26:04 -04:00
co-authored by Claude Opus 4.7
parent 268e12a5eb
commit 1536860e59
2 changed files with 32 additions and 32 deletions
+5 -5
View File
@@ -181,6 +181,11 @@
{#each rows as r (r.track_id)}
{@const isExpanded = !!expanded[r.track_id]}
{@const lidarrDisabled = !r.lidarr_album_mbid}
{@const primary: RowAction = { icon: RotateCcw, label: 'Resolve', onclick: () => onResolve(r) }}
{@const secondary: RowAction[] = [
{ icon: Play, label: 'Play', onclick: () => onPlay(r) },
{ icon: Trash2, label: 'Delete file', onclick: () => openDeleteFile(r), danger: true }
]}
<li
class="flex items-start gap-4 p-3"
data-testid="admin-quarantine-row"
@@ -259,11 +264,6 @@
</div>
<!-- Action cluster -->
{@const primary: RowAction = { icon: RotateCcw, label: 'Resolve', onclick: () => onResolve(r) }}
{@const secondary: RowAction[] = [
{ icon: Play, label: 'Play', onclick: () => onPlay(r) },
{ icon: Trash2, label: 'Delete file', onclick: () => openDeleteFile(r), danger: true }
]}
<div class="flex shrink-0 items-center gap-2">
<RowActionsMenu {primary} {secondary} />