From 0d42e351b318302098c585dc5d9730cc741ae8d3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 4 Feb 2026 22:15:54 +0900 Subject: refactor(ui): replace LoadingSpinner with skeleton fallbacks in Suspense Reduce layout shift during data loading by using content-shaped skeleton placeholders instead of generic spinners in DeckDetailPage, DeckCardsPage, and StudyPage. Co-Authored-By: Claude Opus 4.5 --- src/client/pages/DeckCardsPage.tsx | 53 ++++++++++++++++++++++++++++++++++--- src/client/pages/DeckDetailPage.tsx | 26 ++++++++++++++++-- src/client/pages/StudyPage.tsx | 15 +++++++++-- 3 files changed, 87 insertions(+), 7 deletions(-) (limited to 'src/client') diff --git a/src/client/pages/DeckCardsPage.tsx b/src/client/pages/DeckCardsPage.tsx index 73a83ae..f4b6c78 100644 --- a/src/client/pages/DeckCardsPage.tsx +++ b/src/client/pages/DeckCardsPage.tsx @@ -30,7 +30,6 @@ import { EditCardModal } from "../components/EditCardModal"; import { EditNoteModal } from "../components/EditNoteModal"; import { ErrorBoundary } from "../components/ErrorBoundary"; import { ImportNotesModal } from "../components/ImportNotesModal"; -import { LoadingSpinner } from "../components/LoadingSpinner"; import { queryClient } from "../queryClient"; /** Combined type for display: note group */ @@ -440,7 +439,14 @@ function CardsContent({
{/* Deck Header */} - }> + +
+
+
+ } + > @@ -571,7 +577,48 @@ export function DeckCardsPage() { {/* Main Content */}
- }> + +
+
+
+
+
+
+
+
+
+
+
+
+
+ {[0, 1, 2].map((i) => ( +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))} +
+
+ } + > setIsCreateModalOpen(true)} diff --git a/src/client/pages/DeckDetailPage.tsx b/src/client/pages/DeckDetailPage.tsx index 97f8378..792bbe2 100644 --- a/src/client/pages/DeckDetailPage.tsx +++ b/src/client/pages/DeckDetailPage.tsx @@ -55,14 +55,36 @@ function DeckContent({ deckId }: { deckId: string }) {
{/* Deck Header */} - }> + +
+
+
+ } + > {/* Deck Stats */} - }> + +
+
+
+
+
+
+
+
+
+
+
+ } + > diff --git a/src/client/pages/StudyPage.tsx b/src/client/pages/StudyPage.tsx index 9c79752..423fdd0 100644 --- a/src/client/pages/StudyPage.tsx +++ b/src/client/pages/StudyPage.tsx @@ -17,7 +17,6 @@ import { Link, useParams } from "wouter"; import { ApiClientError, apiClient } from "../api"; import { studyDataAtomFamily } from "../atoms"; import { ErrorBoundary } from "../components/ErrorBoundary"; -import { LoadingSpinner } from "../components/LoadingSpinner"; import { renderCard } from "../utils/templateRenderer"; type Rating = 1 | 2 | 3 | 4; @@ -373,7 +372,19 @@ export function StudyPage() { {/* Main Content */}
- }> + +
+
+
+
+
+
+
+
+ } + > -- cgit v1.3-1-g0d28