feat: skeleton loading state on the home catalog

Replaces the plain "Loading…" text with a content-shaped MangaGridSkeleton
so the catalog grid's layout is reserved while it loads and swaps in without
a shift. Keeps the data-testid="loading" wrapper (now role="status") for
accessibility and selector stability.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-07-06 19:40:28 +02:00
parent 09f12c8959
commit def97d3087
5 changed files with 52 additions and 4 deletions

View File

@@ -32,6 +32,7 @@
import ContinueReadingShelf from '$lib/components/ContinueReadingShelf.svelte';
import RecommendationShelf from '$lib/components/RecommendationShelf.svelte';
import MangaCard from '$lib/components/MangaCard.svelte';
import MangaGridSkeleton from '$lib/components/MangaGridSkeleton.svelte';
import Pager from '$lib/components/Pager.svelte';
import SegmentedControl from '$lib/components/SegmentedControl.svelte';
import Sheet from '$lib/components/Sheet.svelte';
@@ -659,7 +660,9 @@
</Sheet>
{#if loading}
<p class="status" data-testid="loading">Loading…</p>
<div data-testid="loading" role="status" aria-label="Loading manga">
<MangaGridSkeleton />
</div>
{:else if error}
<p class="error" data-testid="error" role="alert">{error}</p>
{:else if mangas.length === 0}