Files
minstrel/web/src/routes/collection/+layout.svelte
T
bvandeusenandClaude Opus 5.5 bcd9e422a5
release / web (push) Failing after 1m28s
release / go (push) Successful in 1m53s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m16s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m13s
release / android (push) Canceled after 2m59s
feat(web): every Collection queue can remove the file and keep the track
Reports offers "Remove the file" ahead of "Remove from library": the
bad file goes and the track waits in Needs a file, with its likes and
plays, for a good copy. Suspect sources gets "Remove this file", and the
Duplicates wrong-slot action and its route are named for what they do
(remove-files). Their toasts and copy name Needs a file.

Missing files becomes Needs a file in the rail, the Collection header and
the Overview counts. Each track says why it waits and who removed it, and
can be forgotten one at a time or by folder; the list exports as a CSV or
copies to the clipboard. The empty state says how a track gets there and
how it leaves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:47:36 -05:00

49 lines
1.8 KiB
Svelte

<script lang="ts">
import { createAdminSummaryQuery } from '#lib/api/admin.js';
import { QUEUES, countOf, queueLabel } from '#lib/admin/queues.js';
import CollectionRail from '#lib/components/CollectionRail.svelte';
let { children } = $props<{ children: import('svelte').Snippet }>();
// The Collection: the library's health. Web-only and admin-only. The
// queues count from the admin summary, the same read Admin's Overview
// makes, so a queue that needs you is counted the same in both places.
const summaryStore = createAdminSummaryQuery();
const summary = $derived($summaryStore.data);
const waiting = $derived(QUEUES.filter((d) => countOf(summary, d.key) > 0));
</script>
<div class="space-y-4">
<header class="space-y-1">
<h1 class="font-display text-2xl font-medium text-text-primary">Collection</h1>
<p class="text-sm text-text-secondary">
What in the library needs looking at: tracks people reported, songs held twice, files from
doubtful sources, and the tracks waiting for a good file.
</p>
{#if summary}
{#if waiting.length > 0}
<p class="text-sm text-text-primary" data-testid="collection-health">
To look at:
{#each waiting as d, i (d.key)}<a href={d.href} class="text-accent-fg hover:underline"
>{queueLabel(d, countOf(summary, d.key))}</a
>{i < waiting.length - 1 ? ', ' : '.'}
{/each}
</p>
{:else}
<p class="text-sm text-text-secondary" data-testid="collection-health">Nothing needs you.</p>
{/if}
{/if}
</header>
<div class="md:grid md:grid-cols-[11rem_minmax(0,1fr)] md:gap-6">
<div class="mb-4 md:mb-0">
<div class="md:sticky md:top-4">
<CollectionRail {summary} />
</div>
</div>
<div class="min-w-0">
{@render children?.()}
</div>
</div>
</div>