fix: resolve all svelte-check warnings and errors (0 errors, 0 warnings)
All checks were successful
Release / Test backend (push) Successful in 45s
Release / Check ui (push) Successful in 44s
Release / Docker / caddy (push) Successful in 40s
Release / Docker / backend (push) Successful in 4m54s
Release / Docker / runner (push) Successful in 56s
Release / Docker / ui (push) Successful in 2m9s
Release / Gitea Release (push) Successful in 48s

This commit is contained in:
Admin
2026-04-05 11:03:23 +05:00
parent 6f0069daca
commit 37deac1eb3
10 changed files with 47 additions and 19 deletions

View File

@@ -4,6 +4,7 @@
let { data }: { data: PageData } = $props();
// svelte-ignore state_referenced_locally
const imgModels = data.imgModels ?? [];
// ── Config persistence ────────────────────────────────────────────────────────

View File

@@ -61,6 +61,7 @@
});
// ── Book autocomplete ────────────────────────────────────────────────────────
// svelte-ignore state_referenced_locally
const books: BookSummary[] = data.books ?? [];
let slugInput = $state('');
let slugFocused = $state(false);
@@ -144,6 +145,7 @@
let saveSuccess = $state(false);
// ── Model helpers ────────────────────────────────────────────────────────────
// svelte-ignore state_referenced_locally
const models: ImageModelInfo[] = data.models ?? [];
let coverModels = $derived(models.filter((m) => m.recommended_for.includes('cover')));
@@ -633,19 +635,19 @@
Reference image <span class="normal-case font-normal text-(--color-muted)">(optional, img2img)</span>
</p>
{#if selectedBook?.cover && selectedModelInfo?.supports_ref}
<label class="flex items-center gap-1.5 cursor-pointer select-none">
<div
role="checkbox"
<div class="flex items-center gap-1.5 cursor-pointer select-none">
<button
type="button"
role="switch"
aria-checked={useCoverAsRef}
tabindex="0"
onkeydown={(e) => { if (e.key === ' ' || e.key === 'Enter') useCoverAsRef = !useCoverAsRef; }}
aria-label="Use book cover as reference"
onclick={() => (useCoverAsRef = !useCoverAsRef)}
class="w-8 h-4 rounded-full transition-colors relative {useCoverAsRef ? 'bg-(--color-brand)' : 'bg-(--color-surface-3)'}"
class="w-8 h-4 rounded-full transition-colors relative focus:outline-none focus:ring-1 focus:ring-(--color-brand) {useCoverAsRef ? 'bg-(--color-brand)' : 'bg-(--color-surface-3)'}"
>
<span class="absolute top-0.5 left-0.5 w-3 h-3 rounded-full bg-white transition-transform {useCoverAsRef ? 'translate-x-4' : ''}"></span>
</div>
</button>
<span class="text-xs text-(--color-muted)">Use book cover</span>
</label>
</div>
{/if}
</div>
{#if referenceFile && referencePreviewUrl}
@@ -719,20 +721,20 @@
<!-- num_steps -->
<div class="space-y-1">
<div class="flex justify-between">
<label class="text-xs text-(--color-muted)">Steps</label>
<label for="img-steps" class="text-xs text-(--color-muted)">Steps</label>
<span class="text-xs text-(--color-text) font-mono">{numSteps}</span>
</div>
<input type="range" min="1" max="20" step="1" bind:value={numSteps}
<input id="img-steps" type="range" min="1" max="20" step="1" bind:value={numSteps}
class="w-full accent-(--color-brand)" />
</div>
<!-- guidance -->
<div class="space-y-1">
<div class="flex justify-between">
<label class="text-xs text-(--color-muted)">Guidance</label>
<label for="img-guidance" class="text-xs text-(--color-muted)">Guidance</label>
<span class="text-xs text-(--color-text) font-mono">{guidance.toFixed(1)}</span>
</div>
<input type="range" min="1" max="20" step="0.5" bind:value={guidance}
<input id="img-guidance" type="range" min="1" max="20" step="0.5" bind:value={guidance}
class="w-full accent-(--color-brand)" />
</div>
@@ -740,10 +742,10 @@
{#if referenceFile}
<div class="space-y-1">
<div class="flex justify-between">
<label class="text-xs text-(--color-muted)">Strength</label>
<label for="img-strength" class="text-xs text-(--color-muted)">Strength</label>
<span class="text-xs text-(--color-text) font-mono">{strength.toFixed(2)}</span>
</div>
<input type="range" min="0" max="1" step="0.05" bind:value={strength}
<input id="img-strength" type="range" min="0" max="1" step="0.05" bind:value={strength}
class="w-full accent-(--color-brand)" />
<p class="text-xs text-(--color-muted)">0 = copy reference · 1 = ignore reference</p>
</div>
@@ -797,7 +799,8 @@
<!-- Image -->
<img
src={result.imageSrc}
alt="Generated image"
alt=""
aria-label="Generated cover"
class="w-full object-contain max-h-[36rem] bg-zinc-950"
/>