From f8693d126ba7a35b29e8327dbfdd770eb84fc6fa Mon Sep 17 00:00:00 2001 From: Janpeter Visser <30029041+madhura68@users.noreply.github.com> Date: Sun, 10 May 2026 12:59:08 +0200 Subject: [PATCH] refactor(PBI-77): standaardiseer loading-skeletons rond shadcn Skeleton (#186) * refactor(PBI-77): align TaskDialogSkeleton with entity-dialog-layout (T-899) Use entityDialogContentClasses/HeaderClasses/BodyClasses/FooterClasses from components/shared/entity-dialog-layout.ts instead of hand-copied class strings. Header, body, and footer skeletons now mimic the actual TaskDialog form fields (code, title, description, plan, priority, status, delete + cancel/save buttons). Fixes mobile layout-shift: the shared content-classes include max-sm: fullscreen modifiers that the previous hand-rolled subset missed. Co-Authored-By: Claude Opus 4.7 (1M context) * 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) * refactor(PBI-77): dashboard + settings loading on shadcn Skeleton (T-901) Replace hand-rolled animate-pulse + bg-border divs with the shadcn component for consistent bg-muted color and pulse timing across all five loading.tsx files. No layout-shift: heights, widths, and rounded radii are preserved. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Claude Opus 4.7 (1M context) --- app/(app)/dashboard/loading.tsx | 10 +-- app/(app)/products/[id]/loading.tsx | 35 +---------- .../[id]/sprint/[sprintId]/loading.tsx | 35 +---------- .../sprint/[sprintId]/planning/loading.tsx | 35 +---------- app/(app)/settings/loading.tsx | 10 +-- .../tasks/task-dialog-skeleton.tsx | 62 ++++++++++++++----- components/loading/backlog-page-skeleton.tsx | 32 ++++++++++ 7 files changed, 92 insertions(+), 127 deletions(-) create mode 100644 components/loading/backlog-page-skeleton.tsx diff --git a/app/(app)/dashboard/loading.tsx b/app/(app)/dashboard/loading.tsx index 656e323..40800ab 100644 --- a/app/(app)/dashboard/loading.tsx +++ b/app/(app)/dashboard/loading.tsx @@ -1,10 +1,12 @@ +import { Skeleton } from '@/components/ui/skeleton' + export default function Loading() { return ( -
-
+
+
- {[1, 2, 3].map(i => ( -
+ {[1, 2, 3].map((i) => ( + ))}
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/app/(app)/settings/loading.tsx b/app/(app)/settings/loading.tsx index 07f3dd9..11488b0 100644 --- a/app/(app)/settings/loading.tsx +++ b/app/(app)/settings/loading.tsx @@ -1,9 +1,11 @@ +import { Skeleton } from '@/components/ui/skeleton' + export default function Loading() { return ( -
-
- {[1, 2, 3, 4].map(i => ( -
+
+ + {[1, 2, 3, 4].map((i) => ( + ))}
) diff --git a/app/_components/tasks/task-dialog-skeleton.tsx b/app/_components/tasks/task-dialog-skeleton.tsx index bb6a66b..823abb7 100644 --- a/app/_components/tasks/task-dialog-skeleton.tsx +++ b/app/_components/tasks/task-dialog-skeleton.tsx @@ -1,5 +1,11 @@ import { Skeleton } from '@/components/ui/skeleton' import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog' +import { + entityDialogBodyClasses, + entityDialogContentClasses, + entityDialogFooterClasses, + entityDialogHeaderClasses, +} from '@/components/shared/entity-dialog-layout' import { cn } from '@/lib/utils' export function TaskDialogSkeleton() { @@ -8,32 +14,54 @@ export function TaskDialogSkeleton() { Taak laden… - {/* Header */} -
- +
+
+ + +
+
- {/* Body — 3 bars mimicking title + description + plan */} -
- - - +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {/* Footer */} -
-
- - +
+
+ +
+ + +
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) => ( + + ))} +
+
+
+
+ ) +}