feat: the admin settings cards read as menus: each a titled group of rows with one short line, status first, failures in words (M503 #5607)
release / govulncheck (push) Successful in 16s
release / web (push) Failing after 1m27s
release / go (push) Successful in 1m44s
release / android (push) Successful in 5m13s
release / integration (push) Successful in 5m18s
release / Build signed APK (releases and dev) (push) Successful in 5m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Indexers and clients, searching, missing files, Lidarr's neighbours, AcoustID, fingerprinting, loudness, outgoing email's schedule, public address and proxies move from paragraph cards to SettingsGroup and SettingRow. Switches are role="switch". Also fixes the two type errors run 9023 found: the Lidarr test result is narrowed before its lists are read, and the tag-source save mock carries version_bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 11:25:46 -04:00
co-authored by Claude Opus 5.5
parent 7e1cfb8d08
commit 7f913e3e70
16 changed files with 449 additions and 916 deletions
+51 -81
View File
@@ -9,6 +9,7 @@
import { errMessage } from '#lib/api/errors.js';
import { pushToast } from '#lib/stores/toast.svelte.js';
import AcquisitionServiceRow from './AcquisitionServiceRow.svelte';
import SettingsGroup from '#lib/components/settings/SettingsGroup.svelte';
// Where Minstrel looks for music and what downloads it (M502 #5518),
// Fabled Librarian's model: two lists of connections the operator adds and
@@ -88,109 +89,78 @@
}
const addButtonClass =
'rounded-md border border-border px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover ' +
'focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent';
'rounded-md border border-border px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary';
</script>
{#snippet addMenu(kind: 'search' | 'download', label: string)}
{#if adding === kind}
<div class="space-y-2" data-testid="add-{kind}">
{#each choices[kind] as choice (choice.protocol)}
<button
type="button"
class="block w-full rounded-lg border border-border px-4 py-3 text-left hover:bg-surface-hover
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
onclick={() => add(choice.protocol)}
<div class="px-4 py-3">
{#if adding === kind}
<div class="space-y-2" data-testid="add-{kind}">
{#each choices[kind] as choice (choice.protocol)}
<button
type="button"
class="block w-full rounded-md border border-border px-4 py-2 text-left hover:bg-surface-hover"
onclick={() => add(choice.protocol)}
>
<span class="block text-sm text-text-primary">{choice.name}</span>
<span class="block text-xs text-text-secondary">{choice.note}</span>
</button>
{/each}
<button type="button" class="text-sm text-text-secondary underline hover:no-underline" onclick={() => (adding = null)}
>Cancel</button
>
<span class="block text-sm font-medium text-text-primary">{choice.name}</span>
<span class="block text-xs text-text-secondary">{choice.note}</span>
</button>
{/each}
<button
type="button"
class="text-sm text-text-secondary underline hover:no-underline"
onclick={() => (adding = null)}>Cancel</button
>
</div>
{:else}
<button type="button" class={addButtonClass} onclick={() => (adding = kind)}>{label}</button>
{/if}
</div>
{:else}
<button type="button" class={addButtonClass} onclick={() => (adding = kind)}>{label}</button>
{/if}
</div>
{/snippet}
<section
class="space-y-5 rounded-xl border border-border bg-surface p-5"
data-testid="acquisition-card"
>
<div>
<h3 class="font-display text-lg font-medium text-text-primary">
Indexers and download clients
</h3>
<p class="mt-1 text-sm text-text-secondary">
Two jobs, kept apart: something to search with, and something to download with. Minstrel
speaks Prowlarr, Torznab and the qBittorrent WebUI, so a stock setup is a complete one.
</p>
</div>
<div class="space-y-6" data-testid="acquisition-card">
{#if loadError}
<p class="text-sm text-action-destructive">
<p class="text-sm text-error-fg">
Couldn't load indexers and download clients.
<button type="button" class="underline hover:no-underline" onclick={load}>Try again</button>
</p>
{:else if services === null}
<p class="text-sm text-text-secondary">Loading indexers and download clients…</p>
{:else}
<!-- The verdict first (#189): can music be found and downloaded at all. -->
<p class="text-sm" data-testid="acquisition-health">
{#if !canFetch}
<span class="text-action-destructive">
No download client is switched on, so nothing can be downloaded.
</span>
<span class="text-error-fg">No download client is switched on, so nothing can be downloaded.</span>
{:else if !canSearch}
<span class="text-action-destructive">
No indexer is switched on, so nothing new can be found.
</span>
<span class="text-error-fg">No indexer is switched on, so nothing new can be found.</span>
{:else}
<span class="text-text-secondary">Music can be searched for and downloaded.</span>
{/if}
</p>
<div class="space-y-3" data-testid="indexers">
<div>
<h4 class="text-sm font-medium text-text-primary">Indexers: where music is looked for</h4>
<p class="text-xs text-text-secondary">
Every indexer switched on here is searched, and the results are merged. If one is
unreachable the search still runs, narrower.
</p>
</div>
{#each indexers as service (service.code)}
<AcquisitionServiceRow {service} onChanged={load} />
{:else}
<p class="text-sm text-text-secondary">No indexer yet. Prowlarr is the usual choice.</p>
{/each}
{#if searchingExchanges.length > 0}
<p class="text-xs text-text-secondary">
Also searched: {searchingExchanges.map((s) => s.label).join(', ')}, set up under download
clients below.
</p>
{/if}
{@render addMenu('search', 'Add indexer')}
<div data-testid="indexers">
<SettingsGroup title="Indexers" id="indexers" hint="Where music is looked for. Every one switched on is searched.">
{#each indexers as service (service.code)}
<AcquisitionServiceRow {service} onChanged={load} />
{:else}
<p class="px-4 py-3 text-sm text-text-secondary">No indexer yet. Prowlarr is the usual choice.</p>
{/each}
{#if searchingExchanges.length > 0}
<p class="px-4 py-3 text-xs text-text-secondary">
Also searched: {searchingExchanges.map((s) => s.label).join(', ')}, under download clients.
</p>
{/if}
{@render addMenu('search', 'Add indexer')}
</SettingsGroup>
</div>
<div class="space-y-3 border-t border-border pt-5" data-testid="download-clients">
<div>
<h4 class="text-sm font-medium text-text-primary">
Download clients: what actually downloads
</h4>
<p class="text-xs text-text-secondary">
What a grab is handed to. A FabledExchange here can do more than download, and its entry
says which of its jobs are switched on.
</p>
</div>
{#each clients as service (service.code)}
<AcquisitionServiceRow {service} onChanged={load} />
{:else}
<p class="text-sm text-text-secondary">No download client yet.</p>
{/each}
{@render addMenu('download', 'Add download client')}
<div data-testid="download-clients">
<SettingsGroup title="Download clients" id="download-clients" hint="What a grab is handed to.">
{#each clients as service (service.code)}
<AcquisitionServiceRow {service} onChanged={load} />
{:else}
<p class="px-4 py-3 text-sm text-text-secondary">No download client yet.</p>
{/each}
{@render addMenu('download', 'Add download client')}
</SettingsGroup>
</div>
{/if}
</section>
</div>