From b8d6252fcaf10ae8e2e9a1b534c2ff190b71caeb Mon Sep 17 00:00:00 2001 From: Arjun Komath Date: Sun, 28 Jun 2026 22:04:32 +1000 Subject: [PATCH] Fix rollout history loading states Amp-Thread-ID: https://ampcode.com/threads/T-019f0e1b-be5b-71dd-81e8-9a75998fe11d Co-authored-by: Amp --- .../rollouts/[rolloutId]/loading.tsx | 24 +++++++++++++ .../service/details/rollout-history.tsx | 34 +++++++++++++++---- .../service/service-layout-client.tsx | 4 ++- 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/rollouts/[rolloutId]/loading.tsx diff --git a/web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/rollouts/[rolloutId]/loading.tsx b/web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/rollouts/[rolloutId]/loading.tsx new file mode 100644 index 00000000..d7ac3214 --- /dev/null +++ b/web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/rollouts/[rolloutId]/loading.tsx @@ -0,0 +1,24 @@ +import { Skeleton } from "@/components/ui/skeleton"; + +export default function Loading() { + return ( +
+
+ +
+
+ + + + +
+
+
+ +
+ + +
+
+ ); +} diff --git a/web/components/service/details/rollout-history.tsx b/web/components/service/details/rollout-history.tsx index 67c305a9..1627312c 100644 --- a/web/components/service/details/rollout-history.tsx +++ b/web/components/service/details/rollout-history.tsx @@ -17,7 +17,7 @@ import { ItemGroup, ItemTitle, } from "@/components/ui/item"; -import { Spinner } from "@/components/ui/spinner"; +import { Skeleton } from "@/components/ui/skeleton"; import type { RolloutStatus } from "@/db/types"; import { formatRelativeTime } from "@/lib/date"; import { fetcher } from "@/lib/fetcher"; @@ -108,6 +108,32 @@ function formatDuration(start: string, end: string | null): string { return `${seconds}s`; } +function RolloutHistorySkeleton({ actions }: { actions?: React.ReactNode }) { + return ( +
+
+ + {actions ?
{actions}
: null} +
+ +
+ {[1, 2, 3].map((item) => ( +
+ +
+ + +
+
+ ))} +
+
+ ); +} + export function RolloutHistory({ serviceId, projectSlug, @@ -140,11 +166,7 @@ export function RolloutHistory({ const rollouts = data?.rollouts || []; if (isLoading) { - return ( -
- -
- ); + return ; } return ( diff --git a/web/components/service/service-layout-client.tsx b/web/components/service/service-layout-client.tsx index 04e07f9e..e81946e6 100644 --- a/web/components/service/service-layout-client.tsx +++ b/web/components/service/service-layout-client.tsx @@ -151,7 +151,9 @@ export function ServiceLayoutClient({ const isActiveTab = (href: string) => { if (href === basePath) { - return pathname === basePath; + return ( + pathname === basePath || pathname.startsWith(`${basePath}/rollouts`) + ); } return pathname.startsWith(href); };