The first public release of Fabled Minstrel #158

Merged
bvandeusen merged 256 commits from dev into main 2026-12-03 21:41:58 -05:00
3 changed files with 54 additions and 36 deletions
Showing only changes of commit ebb8e331a2 - Show all commits
+30
View File
@@ -0,0 +1,30 @@
<script lang="ts">
// One thing waiting on an admin, as a row in a list of them: what it is,
// how long it has waited, and Open. Admin's Overview and the Collection
// list their queues with it.
let {
href,
text,
when,
error = false,
testid = 'needs-you'
}: {
href: string;
text: string;
/** How long it has waited, already worded: "oldest 3 days ago". */
when?: string;
/** A failure rather than a queue, drawn in the error colour. */
error?: boolean;
testid?: string;
} = $props();
</script>
<li data-testid={testid}>
<a {href} class="flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 hover:bg-surface-hover">
<span class="text-sm {error ? 'text-error-fg' : 'text-text-primary'}">{text}</span>
{#if when}
<span class="text-xs text-text-muted">{when}</span>
{/if}
<span class="ml-auto text-sm text-accent-fg">Open</span>
</a>
</li>
+17 -27
View File
@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import NeedsYouRow from '#lib/components/NeedsYouRow.svelte';
import { plural } from '#lib/utils/plural.js'; import { plural } from '#lib/utils/plural.js';
import { pageTitle } from '#lib/branding.js'; import { pageTitle } from '#lib/branding.js';
import { createAdminStatusQuery, createAdminSummaryQuery, createScanStatusQuery } from '#lib/api/admin.js'; import { createAdminStatusQuery, createAdminSummaryQuery, createScanStatusQuery } from '#lib/api/admin.js';
@@ -79,38 +80,27 @@
{#if problems > 0} {#if problems > 0}
<ul class="divide-y divide-border rounded-lg border border-border bg-surface"> <ul class="divide-y divide-border rounded-lg border border-border bg-surface">
{#if scan?.error_message} {#if scan?.error_message}
<li data-testid="needs-you"> <NeedsYouRow
<a href="/admin/library" class="flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 hover:bg-surface-hover"> href="/admin/library"
<span class="text-sm text-error-fg">The last library scan failed: {scan.error_message}</span> text={`The last library scan failed: ${scan.error_message}`}
{#if scan.finished_at} when={scan.finished_at ? relativeTime(scan.finished_at) : undefined}
<span class="text-xs text-text-muted">{relativeTime(scan.finished_at)}</span> error
{/if} />
<span class="ml-auto text-sm text-accent-fg">Open</span>
</a>
</li>
{/if} {/if}
{#each waiting as d (d.key)} {#each waiting as d (d.key)}
{@const q = summary?.[d.key]} {@const q = summary?.[d.key]}
<li data-testid="needs-you"> <NeedsYouRow
<a href={d.href} class="flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 hover:bg-surface-hover"> href={d.href}
<span class="text-sm text-text-primary">{queueLabel(d, countOf(summary, d.key))}</span> text={queueLabel(d, countOf(summary, d.key))}
{#if q?.since} when={q?.since ? `oldest ${relativeTime(q.since)}` : undefined}
<span class="text-xs text-text-muted">oldest {relativeTime(q.since)}</span> />
{/if}
<span class="ml-auto text-sm text-accent-fg">Open</span>
</a>
</li>
{/each} {/each}
{#each statusProblems as p (p.key)} {#each statusProblems as p (p.key)}
<li data-testid="needs-you"> <NeedsYouRow
<a href={p.href} class="flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 hover:bg-surface-hover"> href={p.href}
<span class="text-sm text-text-primary">{p.text}</span> text={p.text}
{#if p.since} when={p.since ? `since ${relativeTime(p.since)}` : undefined}
<span class="text-xs text-text-muted">since {relativeTime(p.since)}</span> />
{/if}
<span class="ml-auto text-sm text-accent-fg">Open</span>
</a>
</li>
{/each} {/each}
</ul> </ul>
{/if} {/if}
+7 -9
View File
@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import NeedsYouRow from '#lib/components/NeedsYouRow.svelte';
import { pageTitle } from '#lib/branding.js'; import { pageTitle } from '#lib/branding.js';
import { createAdminSummaryQuery } from '#lib/api/admin.js'; import { createAdminSummaryQuery } from '#lib/api/admin.js';
import { relativeTime } from '#lib/utils/relativeTime.js'; import { relativeTime } from '#lib/utils/relativeTime.js';
@@ -28,15 +29,12 @@
<ul class="divide-y divide-border rounded-lg border border-border bg-surface"> <ul class="divide-y divide-border rounded-lg border border-border bg-surface">
{#each waiting as d (d.key)} {#each waiting as d (d.key)}
{@const q = summary?.[d.key]} {@const q = summary?.[d.key]}
<li data-testid="collection-queue"> <NeedsYouRow
<a href={d.href} class="flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 hover:bg-surface-hover"> href={d.href}
<span class="text-sm text-text-primary">{queueLabel(d, countOf(summary, d.key))}</span> text={queueLabel(d, countOf(summary, d.key))}
{#if q?.since} when={q?.since ? `oldest ${relativeTime(q.since)}` : undefined}
<span class="text-xs text-text-muted">oldest {relativeTime(q.since)}</span> testid="collection-queue"
{/if} />
<span class="ml-auto text-sm text-accent-fg">Open</span>
</a>
</li>
{/each} {/each}
</ul> </ul>
{/if} {/if}