Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(squads): show skeleton on squad detail initial load (#2930)

Naiyuan Qing317bca40c1e9
diff --git a/packages/views/squads/components/squad-detail-page.tsx b/packages/views/squads/components/squad-detail-page.tsx
index 743daa2d6e..8671ad6726 100644
--- a/packages/views/squads/components/squad-detail-page.tsx
+++ b/packages/views/squads/components/squad-detail-page.tsx
@@ -18,6 +18,7 @@ import { Users, Plus, Trash2, ArrowLeft, ArrowUpRight, Crown, Camera, Loader2, P
import { Button } from "@multica/ui/components/ui/button";
import { Input } from "@multica/ui/components/ui/input";
import { Label } from "@multica/ui/components/ui/label";
+import { Skeleton } from "@multica/ui/components/ui/skeleton";
import {
Popover,
PopoverContent,
@@ -202,7 +203,7 @@ export function SquadDetailPage() {
};
if (!squad) {
- return <div className="p-6 text-muted-foreground text-sm">Loading...</div>;
+ return <SquadDetailSkeleton />;
}
const availableAgents = agents.filter((a: Agent) => !a.archived_at && !members.some((m) => m.member_type === "agent" && m.member_id === a.id));
@@ -323,6 +324,40 @@ export function SquadDetailPage() {
);
}
+// Initial-load skeleton — mirrors the two-column layout of the loaded page
+// (left inspector + right tabs panel) so the swap to real content doesn't
+// shift layout. Column widths match the md:/lg: breakpoints used below.
+function SquadDetailSkeleton() {
+ return (
+ <div className="flex flex-1 min-h-0 flex-col">
+ <PageHeader className="px-5">
+ <Skeleton className="h-5 w-48" />
+ </PageHeader>
+ <div className="flex flex-1 min-h-0 flex-col gap-3 overflow-y-auto p-3 md:grid md:grid-cols-[280px_minmax(0,1fr)] md:gap-4 md:overflow-hidden md:p-6 lg:grid-cols-[320px_minmax(0,1fr)]">
+ <div className="flex flex-col gap-4 rounded-lg border p-5">
+ <Skeleton className="h-16 w-16 rounded-lg" />
+ <Skeleton className="h-5 w-40" />
+ <Skeleton className="h-3 w-full" />
+ <div className="space-y-2">
+ <Skeleton className="h-3 w-3/4" />
+ <Skeleton className="h-3 w-2/3" />
+ <Skeleton className="h-3 w-1/2" />
+ </div>
+ </div>
+ <div className="flex flex-col gap-4 rounded-lg border p-6">
+ <div className="flex items-center gap-4">
+ <Skeleton className="h-4 w-20" />
+ <Skeleton className="h-4 w-24" />
+ </div>
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-5/6" />
+ <Skeleton className="h-4 w-4/6" />
+ </div>
+ </div>
+ </div>
+ );
+}
+
// Compact 16px avatar shown next to the name in the page header. Falls back
// to the Users icon when no custom avatar is set so the squad still has a
// recognisable glyph in the breadcrumb strip.