From 45906ed6265bbbbc56dd9b1715f6466f462128b4 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Sun, 10 May 2026 11:39:52 +0200 Subject: [PATCH] refactor(PBI-77): extract BacklogPageSkeleton from 3 identical loadings (T-900) The loading.tsx files for products/[id], sprint/[sprintId], and sprint/[sprintId]/planning were 100% identical hand-rolled animate-pulse markup. Extract the shape into components/loading/backlog-page-skeleton.tsx using the shadcn component, and re-export it from the three loading files. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/(app)/products/[id]/loading.tsx | 35 +------------------ .../[id]/sprint/[sprintId]/loading.tsx | 35 +------------------ .../sprint/[sprintId]/planning/loading.tsx | 35 +------------------ components/loading/backlog-page-skeleton.tsx | 32 +++++++++++++++++ 4 files changed, 35 insertions(+), 102 deletions(-) create mode 100644 components/loading/backlog-page-skeleton.tsx diff --git a/app/(app)/products/[id]/loading.tsx b/app/(app)/products/[id]/loading.tsx index 795b2c5..8dcb9c1 100644 --- a/app/(app)/products/[id]/loading.tsx +++ b/app/(app)/products/[id]/loading.tsx @@ -1,34 +1 @@ -export default function Loading() { - return ( -
- {/* Header skeleton */} -
-
-
-
-
-
-
- - {/* Split pane skeleton */} -
- {/* Left */} -
-
- {[1, 2, 3, 4, 5].map(i => ( -
- ))} -
- {/* Right */} -
-
-
- {[1, 2, 3].map(i => ( -
- ))} -
-
-
-
- ) -} +export { default } from '@/components/loading/backlog-page-skeleton' diff --git a/app/(app)/products/[id]/sprint/[sprintId]/loading.tsx b/app/(app)/products/[id]/sprint/[sprintId]/loading.tsx index 795b2c5..8dcb9c1 100644 --- a/app/(app)/products/[id]/sprint/[sprintId]/loading.tsx +++ b/app/(app)/products/[id]/sprint/[sprintId]/loading.tsx @@ -1,34 +1 @@ -export default function Loading() { - return ( -
- {/* Header skeleton */} -
-
-
-
-
-
-
- - {/* Split pane skeleton */} -
- {/* Left */} -
-
- {[1, 2, 3, 4, 5].map(i => ( -
- ))} -
- {/* Right */} -
-
-
- {[1, 2, 3].map(i => ( -
- ))} -
-
-
-
- ) -} +export { default } from '@/components/loading/backlog-page-skeleton' diff --git a/app/(app)/products/[id]/sprint/[sprintId]/planning/loading.tsx b/app/(app)/products/[id]/sprint/[sprintId]/planning/loading.tsx index 795b2c5..8dcb9c1 100644 --- a/app/(app)/products/[id]/sprint/[sprintId]/planning/loading.tsx +++ b/app/(app)/products/[id]/sprint/[sprintId]/planning/loading.tsx @@ -1,34 +1 @@ -export default function Loading() { - return ( -
- {/* Header skeleton */} -
-
-
-
-
-
-
- - {/* Split pane skeleton */} -
- {/* Left */} -
-
- {[1, 2, 3, 4, 5].map(i => ( -
- ))} -
- {/* Right */} -
-
-
- {[1, 2, 3].map(i => ( -
- ))} -
-
-
-
- ) -} +export { default } from '@/components/loading/backlog-page-skeleton' diff --git a/components/loading/backlog-page-skeleton.tsx b/components/loading/backlog-page-skeleton.tsx new file mode 100644 index 0000000..79666b6 --- /dev/null +++ b/components/loading/backlog-page-skeleton.tsx @@ -0,0 +1,32 @@ +import { Skeleton } from '@/components/ui/skeleton' + +export default function BacklogPageSkeleton() { + return ( +
+
+
+ + +
+ +
+ +
+
+ + {[1, 2, 3, 4, 5].map((i) => ( + + ))} +
+
+ +
+ {[1, 2, 3].map((i) => ( + + ))} +
+
+
+
+ ) +}