chore(web/lint): clear svelte-check warnings + fix QueueDrawer test query

CI svelte-check was blocking on:

- 1 ERROR I introduced in the previous cleanup: QueueDrawer.test.ts
  passed { hidden: true } to getByLabelText, but that option only
  exists on getByRole. Fixed by switching to a direct
  document.querySelector for the aria-hidden assertion.

- 13 WARNINGS pre-existing in the codebase from M7 #352/#372/#349
  era, never surfaced because earlier CI runs failed before reaching
  type-check. Now that CI gets that far, they accumulate. Cleared:

  - FlagPopover, RemoveTrackPopover, AddToPlaylistMenu, TrackMenu:
    interactive role divs gain tabindex="-1" + onkeydown that stops
    propagation and closes on Escape (functional, not just warning-
    suppression).

  - FlagPopover state-from-props: $state(untrack(() => prop ?? default))
    for explicit initial-snapshot semantics; const isUpdate switched
    to $derived so it reacts to prop changes.

  - PlaylistTrackRow drag-div: role="listitem" added.

  - playlists/+page.svelte: autofocus replaced with bind:this + $effect.
This commit is contained in:
2026-05-03 22:26:09 -04:00
parent 22e3f67411
commit d43c6b31f4
7 changed files with 22 additions and 6 deletions
+6 -3
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { untrack } from 'svelte';
import { Flag } from 'lucide-svelte';
import { useQueryClient } from '@tanstack/svelte-query';
import { flagTrack } from '$lib/api/quarantine';
@@ -17,12 +18,12 @@
initialNotes?: string;
} = $props();
let reason: LidarrQuarantineReason = $state(initialReason ?? 'bad_rip');
let notes = $state(initialNotes ?? '');
let reason: LidarrQuarantineReason = $state(untrack(() => initialReason ?? 'bad_rip'));
let notes = $state(untrack(() => initialNotes ?? ''));
let submitting = $state(false);
let error = $state<string | null>(null);
const isUpdate = !!initialReason;
const isUpdate = $derived(!!initialReason);
const client = useQueryClient();
async function submit() {
@@ -42,10 +43,12 @@
<div
role="dialog"
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"
onclick={(e) => e.stopPropagation()}
onkeydown={(e) => { e.stopPropagation(); if (e.key === 'Escape') onClose(); }}
>
<h4 id="flag-popover-title" class="text-sm font-medium text-text-primary">
Flag this track as broken