fix(audit-wave-9): route-level loading skeletons across dashboard
Add a default [portSlug]/loading.tsx that covers all 72 nested routes that previously rendered nothing during the cold-load gap. Uses the existing PageSkeleton (page-header + table-skeleton) so the empty-header flash on direct-URL visits / tab navigations is gone. Add tailored loading.tsx for the four other tab-strip detail surfaces so their initial paint mirrors the real page structure (header strip, pipeline stepper for interests, tab strip, two-column overview): - yachts/[yachtId]/loading.tsx - companies/[companyId]/loading.tsx - interests/[interestId]/loading.tsx - berths/[berthId]/loading.tsx (clients/[clientId]/loading.tsx already existed.) Closes ui/ux M3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
src/app/(dashboard)/[portSlug]/berths/[berthId]/loading.tsx
Normal file
29
src/app/(dashboard)/[portSlug]/berths/[berthId]/loading.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { CardSkeleton } from '@/components/shared/loading-skeleton';
|
||||
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-3 rounded-xl border border-border bg-card px-5 py-4 shadow-sm">
|
||||
<div className="flex items-center gap-3">
|
||||
<Skeleton className="h-12 w-13 rounded-2xl" />
|
||||
<Skeleton className="h-7 w-32" />
|
||||
<Skeleton className="h-6 w-24 rounded-full" />
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Skeleton className="h-9 w-32 rounded-md" />
|
||||
<Skeleton className="h-9 w-20 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 border-b border-border pb-1">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-8 w-24 rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { CardSkeleton } from '@/components/shared/loading-skeleton';
|
||||
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-3 rounded-xl border border-border bg-card px-5 py-4 shadow-sm">
|
||||
<div className="flex items-center gap-3">
|
||||
<Skeleton className="h-7 w-64" />
|
||||
<Skeleton className="h-5 w-16 rounded-full" />
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Skeleton className="h-9 w-20 rounded-md" />
|
||||
<Skeleton className="h-9 w-24 rounded-md" />
|
||||
<Skeleton className="h-9 w-28 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 border-b border-border pb-1">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-8 w-20 rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { CardSkeleton } from '@/components/shared/loading-skeleton';
|
||||
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-3 rounded-xl border border-border bg-card px-5 py-4 shadow-sm">
|
||||
<div className="flex items-center gap-3">
|
||||
<Skeleton className="h-7 w-72" />
|
||||
<Skeleton className="h-5 w-20 rounded-full" />
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Skeleton className="h-9 w-24 rounded-md" />
|
||||
<Skeleton className="h-9 w-24 rounded-md" />
|
||||
<Skeleton className="h-9 w-28 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
{/* Pipeline-stepper row */}
|
||||
<Skeleton className="h-12 w-full rounded-lg" />
|
||||
<div className="flex gap-2 border-b border-border pb-1">
|
||||
{Array.from({ length: 7 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-8 w-20 rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
17
src/app/(dashboard)/[portSlug]/loading.tsx
Normal file
17
src/app/(dashboard)/[portSlug]/loading.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { PageSkeleton } from '@/components/shared/loading-skeleton';
|
||||
|
||||
/**
|
||||
* Default route-level loading UI for every page under `(dashboard)/[portSlug]/...`.
|
||||
*
|
||||
* Renders while the server component resolves the session, port config,
|
||||
* and the client component bootstraps its initial query. Replaces the
|
||||
* empty-header flash on cold direct-URL visits and tab navigations.
|
||||
*
|
||||
* Individual routes can still ship their own `loading.tsx` for a more
|
||||
* tailored skeleton (see `clients/[clientId]/loading.tsx` which mirrors
|
||||
* the detail page's tab strip). When that file exists Next.js uses it
|
||||
* in place of this default.
|
||||
*/
|
||||
export default function Loading() {
|
||||
return <PageSkeleton />;
|
||||
}
|
||||
29
src/app/(dashboard)/[portSlug]/yachts/[yachtId]/loading.tsx
Normal file
29
src/app/(dashboard)/[portSlug]/yachts/[yachtId]/loading.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { CardSkeleton } from '@/components/shared/loading-skeleton';
|
||||
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-3 rounded-xl border border-border bg-card px-5 py-4 shadow-sm">
|
||||
<div className="flex items-center gap-3">
|
||||
<Skeleton className="h-7 w-56" />
|
||||
<Skeleton className="h-5 w-16 rounded-full" />
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Skeleton className="h-9 w-20 rounded-md" />
|
||||
<Skeleton className="h-9 w-24 rounded-md" />
|
||||
<Skeleton className="h-9 w-28 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 border-b border-border pb-1">
|
||||
{Array.from({ length: 5 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-8 w-20 rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user