From 7fbf9dbbf00363f43de9369ecf9cd54afdb64ecb Mon Sep 17 00:00:00 2001 From: hectorqin Date: Thu, 22 Oct 2026 13:22:17 +0800 Subject: [PATCH] feat(web): shelf and library paint a cover-grid skeleton while loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both screens showed an empty page with a floating "正在加载…" until the first response. The .book-grid.is-skeleton styles (same grid and density as the real one, a shimmer that goes flat under reduced motion) were already in reader.css from the legacy shelf but nothing rendered them; BookGridSkeleton does, so the first paint fills in instead of jumping. Co-Authored-By: Claude Opus 5.5 --- web/src/features/library/pages/LibraryPage.tsx | 3 ++- web/src/features/shelf/pages/ShelfPage.tsx | 3 ++- web/src/ui/book-grid-skeleton.tsx | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 web/src/ui/book-grid-skeleton.tsx diff --git a/web/src/features/library/pages/LibraryPage.tsx b/web/src/features/library/pages/LibraryPage.tsx index d89642b..527876d 100644 --- a/web/src/features/library/pages/LibraryPage.tsx +++ b/web/src/features/library/pages/LibraryPage.tsx @@ -1,5 +1,6 @@ import { BookOpen, FileText, Folder, Plus, Search, Upload } from 'lucide-react'; import { coverTint } from '../../../ui/cover-tint.ts'; +import { BookGridSkeleton } from '../../../ui/book-grid-skeleton.tsx'; import { ActionMenu } from '../../../ui/action-menu.tsx'; import { Callout, Icon } from '../../../ui/toolkit.tsx'; import { useQuery, useQueryClient } from '@tanstack/react-query'; @@ -49,7 +50,7 @@ export function LibraryBrowsePage() { {listing.data && listing.data.crumbs.length > 1 &&
{listing.data.crumbs.map((crumb, index) => {index > 0 && /})}
}
{ event.preventDefault(); navigate(path, 1, draft.trim()); }}>