Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: empty state syncing

Gus32ee18677026
diff --git a/AGENTS.md b/AGENTS.md
index dc12aef95..0bc473bda 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,7 +10,7 @@ Alook's main purpose is to make the cli agent always on, and give it a email add
- `src/ws-do`: WebSocket Durable Object worker
## MUST
-- run `pnpm typecheck`, `pnpm test`, `pnpm test:e2e` and `pnpm build` as the final check when you think the code is ready.
+- run `pnpm typecheck`, `pnpm test`, `pnpm test:e2e` as the final check when you think the code is ready.
## Plan-driven Development
diff --git a/skills-lock.json b/skills-lock.json
index 307330d6d..097a2ccbe 100644
--- a/skills-lock.json
+++ b/skills-lock.json
@@ -4,112 +4,87 @@
"adapt": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "fb7cca7602be381b7b486e731fdcd480335cbb9b925e1911276f5bb9352c6b2f"
+ "computedHash": "65085998d643c3b64ff323ca74d76496b47484046b030730c00c03a0208bf410"
},
"animate": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "b00cb71343fa7e987489ad330e3dd3e504ff893b9ddd2b30cacea93691b78e46"
- },
- "arrange": {
- "source": "pbakaus/impeccable",
- "sourceType": "github",
- "computedHash": "698fb952e9ef0d2551a5c3421ef61e084934420e0d8371a02efb4f76f21049e8"
+ "computedHash": "354414a934957f9d54a71468abe81888304d35b47a4fe8e27fff08f60b457d53"
},
"audit": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "eb9109e542194f8711cffce23095ef5da2deb4ed0b23f59c07e912e3931f1e17"
+ "computedHash": "115a00d21d91d52123115af789948cb22bd604de0084837b5533f5e4af3c4055"
},
"bolder": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "4b03286f1dc45da3e1a76a71c0c62729b4887c814dff3084345889cb4780a3a2"
+ "computedHash": "1787478962577c9d5bde26e89e47c1654aa9c8f3c47c316a026731db0000a92e"
},
"clarify": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "1138379fb9f10b911094fb57b5607de8efbd77d2467fba4981ccc1c155457c6f"
+ "computedHash": "42877142fcc51dcc6be696349aa7df8887eb29510e2a5868beac913f5f84de31"
},
"colorize": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "6e292a0ba428d339615e025cab1f2692b2e6267ba247574a00545b1dac1acc5a"
+ "computedHash": "4793ac377b2bc1a5831d9634ce882373350cc5d097fd631d192155266204ceb8"
},
"critique": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "59d3facaee0d7c969f23e938c35239183d3fdd9befff526908585e55afa3a9dd"
+ "computedHash": "977f6fc3aa1002ec095f649e1b7c4fa52ee08a447f19229062810a9323c5c342"
},
"delight": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "80127e9c695f768f5df70b9f62ad51cdfb3b4892791c4d901214b08f3be8d37e"
+ "computedHash": "1f6f4adee0b964e8344c0baef46b4e303ab3ba20932907bcbb1444ba7b3273b2"
},
"distill": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "ce6fbd844488a326208c1302c73b2865fa4fb20e447b6a06c038315444d6e0c5"
- },
- "extract": {
- "source": "pbakaus/impeccable",
- "sourceType": "github",
- "computedHash": "1bbe30b5be73a86971f6bccb37daae84aaafceaa6d23429d6a3a0442378ac4ec"
- },
- "frontend-design": {
- "source": "pbakaus/impeccable",
- "sourceType": "github",
- "computedHash": "9ebe6c652743fcde8d2ae773f34b6f548dcc8b2e75a3a30936adcd8b95dd2d16"
+ "computedHash": "669a671f855be8773e4c2936e54d4243fbd1d273f87633158544efe3dbc4d825"
},
- "harden": {
+ "impeccable": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "f8ce420b3c78b90707704122264da76514c793ac0e12fb9540ace68d257c231c"
+ "computedHash": "a26b3dd377c4572b1c34c68f82ab9a1cb806f21c7157060327fe60e9b6d2e277"
},
- "normalize": {
+ "layout": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "281b7f9e590e252a6aec3f5f83c5ca548c91e8bccb3fd6eee4cc7d5be0becb4d"
- },
- "onboard": {
- "source": "pbakaus/impeccable",
- "sourceType": "github",
- "computedHash": "1cbedf70f906150b1b8bb70b61393eaf67e2e1311e1b5e43bde3e47411bcaa2b"
+ "computedHash": "6b5fd49587616ca1e594e9c6b11bc1cef5eb0b2d137c307de54a8a650770f4ce"
},
"optimize": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "f7adc2a2e540a590978b567d82985062bfada83385f5ad5d50b13a127cdc96d6"
+ "computedHash": "979ffc76a4345c081fdf89078b7107c216d70696e027b23e8e24972dd4e457b2"
},
"overdrive": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "3b940d458ef13afcb93ccb51ff430510aca4a9733d68fbdc335927a2636a091d"
+ "computedHash": "30e2909c14b9e860b580e63f9bbe10cc1dee8de0be9b03013218c3ef8d9ede78"
},
"polish": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "33a8b5195481719e954b71762de56faaabc68c479602673894e0d0e47336756b"
+ "computedHash": "c294f2570dcc5b8865d17f0dc5ef339a700c868f1b20fa9994297f64ace2d4de"
},
"quieter": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "6066e73875e4770e624641355cc04662ce75d2b1d1a3673e24dcbd0ec8936297"
- },
- "svg-design": {
- "source": "tryopendata/skills",
- "sourceType": "github",
- "computedHash": "eb6a7aa3b08861afb48a26d3ef060b059e0855b7e9fd53f819a2b5b441099c01"
+ "computedHash": "2c20b12bb4ece445d45fc63bda020aecf78b3cdf6d593beb59c273f658293130"
},
- "teach-impeccable": {
+ "shape": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "b3b5541bb9b0a260af793c7d79c2db4a436c2cd9384be34a4024c7f28af72e62"
+ "computedHash": "8edad33758f2461f51afdb51741bfcc4cc57d84ea42e2751a84be2c6a2d48f69"
},
"typeset": {
"source": "pbakaus/impeccable",
"sourceType": "github",
- "computedHash": "0259de15644a89550cfd6a936a8e1866dcb35d20ccc96197614459233a9bcdb3"
+ "computedHash": "1cd76e560d1ba25b0bd5f7adfa2957a9f653a3ad0b031d467221154fcd1e0423"
}
}
}
diff --git a/src/shared/src/utils/email.ts b/src/shared/src/utils/email.ts
index 0efe43879..4cfee72f2 100644
--- a/src/shared/src/utils/email.ts
+++ b/src/shared/src/utils/email.ts
@@ -1,5 +1,5 @@
const DOMAIN = `@${process.env.ALOOK_DOMAIN || "alook.ai"}`
-const HANDLE_RE = /^[a-zA-Z0-9-]{4,}$/
+const HANDLE_RE = /^[a-zA-Z0-9-]{3,}$/
export function parseEmailHandle(a: string) { return a.endsWith(DOMAIN) ? a.slice(0, -DOMAIN.length) : "" }
export function toAlookAddress(h: string) { return `${h}${DOMAIN}` }
export function isValidHandle(h: string) { return HANDLE_RE.test(h) }
diff --git a/src/shared/test/utils/email.test.ts b/src/shared/test/utils/email.test.ts
index a0e268409..7c45b7bdc 100644
--- a/src/shared/test/utils/email.test.ts
+++ b/src/shared/test/utils/email.test.ts
@@ -6,7 +6,7 @@ describe("parseEmailHandle", () => {
})
describe("toAlookAddress", () => { it("appends domain", () => expect(toAlookAddress("jarvis")).toBe("[email protected]")) })
describe("isValidHandle", () => {
- it("accepts 4+ alphanum+dash", () => { expect(isValidHandle("jarvis")).toBe(true); expect(isValidHandle("my-bot")).toBe(true) })
- it("rejects <4", () => expect(isValidHandle("abc")).toBe(false))
+ it("accepts 3+ alphanum+dash", () => { expect(isValidHandle("jarvis")).toBe(true); expect(isValidHandle("my-bot")).toBe(true); expect(isValidHandle("abc")).toBe(true) })
+ it("rejects <3", () => expect(isValidHandle("ab")).toBe(false))
it("rejects spaces/underscores", () => { expect(isValidHandle("my agent")).toBe(false); expect(isValidHandle("my_bot")).toBe(false) })
})
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page.tsx
index 89d5cf849..86f05c1d3 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page.tsx
@@ -16,6 +16,7 @@ import type { Conversation, Message, TaskMessage } from "@alook/shared";
import type { Task } from "@/lib/api";
import { toast } from "sonner";
import { cn } from "@/lib/utils";
+import { Skeleton } from "@/components/ui/skeleton";
import { ArrowUp, Loader2 } from "lucide-react";
import { Streamdown } from "streamdown";
@@ -174,9 +175,40 @@ export default function AgentChatDetailPage() {
if (loading) {
return (
- <div className="flex flex-1 items-center justify-center">
- <Loader2 className="size-5 animate-spin text-muted-foreground" />
- </div>
+ <>
+ <div className="flex-1 overflow-y-auto px-5">
+ <div className="mx-auto max-w-2xl py-6 space-y-4">
+ {/* Skeleton user message */}
+ <div className="flex justify-end">
+ <Skeleton className="h-10 w-48 rounded-lg" />
+ </div>
+ {/* Skeleton assistant message */}
+ <div className="flex justify-start">
+ <div className="space-y-2 px-1 py-1">
+ <Skeleton className="h-4 w-72" />
+ <Skeleton className="h-4 w-56" />
+ <Skeleton className="h-4 w-64" />
+ </div>
+ </div>
+ {/* Another pair */}
+ <div className="flex justify-end">
+ <Skeleton className="h-10 w-36 rounded-lg" />
+ </div>
+ <div className="flex justify-start">
+ <div className="space-y-2 px-1 py-1">
+ <Skeleton className="h-4 w-64" />
+ <Skeleton className="h-4 w-48" />
+ </div>
+ </div>
+ </div>
+ </div>
+ {/* Skeleton input area */}
+ <div className="px-5 py-3">
+ <div className="mx-auto max-w-2xl">
+ <Skeleton className="h-[72px] w-full rounded-xl" />
+ </div>
+ </div>
+ </>
);
}
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/page.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/page.tsx
index c6e3bccf6..4d8efb354 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/chat/page.tsx
@@ -9,7 +9,8 @@ import type { Conversation } from "@alook/shared";
import { Button } from "@/components/ui/button";
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
import { toast } from "sonner";
-import { Plus, Loader2, Trash2 } from "lucide-react";
+import { Skeleton } from "@/components/ui/skeleton";
+import { Plus, Loader2, Trash2, MessageSquare } from "lucide-react";
function relativeTime(dateStr: string): string {
const date = new Date(dateStr);
@@ -94,6 +95,82 @@ export default function AgentChatPage() {
}
};
+ if (loading) {
+ return (
+ <div className="flex-1 overflow-y-auto px-5">
+ <div className="mx-auto max-w-2xl py-6">
+ {/* Skeleton sessions header */}
+ <div className="flex items-center justify-between mb-4">
+ <Skeleton className="h-3.5 w-16" />
+ <Skeleton className="h-7 w-[106px] rounded-md" />
+ </div>
+ {/* Skeleton session rows */}
+ <div className="space-y-2">
+ {Array.from({ length: 4 }).map((_, i) => (
+ <div
+ key={i}
+ className="rounded-lg border border-border/50 bg-background/50 px-4 py-3"
+ >
+ <Skeleton className="h-4 w-48 mb-1.5" />
+ <Skeleton className="h-3 w-32" />
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+ );
+ }
+
+ if (conversations.length === 0) {
+ return (
+ <>
+ <div className="flex flex-col flex-1">
+ <div className="px-5">
+ <div className="mx-auto max-w-2xl pt-6">
+ {/* Sessions header */}
+ <div className="flex items-center justify-between">
+ <h2 className="text-xs font-medium text-muted-foreground uppercase tracking-wider">
+ Sessions
+ </h2>
+ <Button
+ size="sm"
+ className="h-7 text-xs gap-1"
+ onClick={handleNewSession}
+ disabled={creating}
+ >
+ {creating ? (
+ <Loader2 className="size-3 animate-spin" />
+ ) : (
+ <Plus className="size-3" />
+ )}
+ New Session
+ </Button>
+ </div>
+ </div>
+ </div>
+ <div className="flex flex-col items-center justify-center flex-1 animate-[fade-up_400ms_ease-out_both]">
+ <MessageSquare className="size-8 text-muted-foreground mb-3" />
+ <p className="text-sm text-muted-foreground">No sessions yet.</p>
+ <p className="text-xs text-muted-foreground/60 mt-1">
+ Start a new session to begin chatting with this agent.
+ </p>
+ </div>
+ </div>
+
+ <ConfirmDialog
+ open={!!deleteTarget}
+ onOpenChange={(open) => {
+ if (!open) setDeleteTarget(null);
+ }}
+ title="Delete session"
+ description={`This will permanently delete "${deleteTarget?.title || "Untitled"}" and all its messages.`}
+ loading={deleting}
+ onConfirm={handleDeleteConversation}
+ />
+ </>
+ );
+ }
+
return (
<>
<div className="flex-1 overflow-y-auto px-5">
@@ -125,23 +202,8 @@ export default function AgentChatPage() {
</Button>
</div>
- {loading ? (
- <div className="flex items-center justify-center py-20">
- <Loader2 className="size-5 animate-spin text-muted-foreground" />
- </div>
- ) : conversations.length === 0 ? (
- /* Empty state */
- <div className="text-center py-20 animate-[fade-up_400ms_ease-out_both]">
- <p className="text-sm text-muted-foreground">
- No sessions yet.
- </p>
- <p className="text-xs text-muted-foreground/60 mt-1">
- Start a new session to begin chatting with this agent.
- </p>
- </div>
- ) : (
- /* Session rows */
- <div className="space-y-2">
+ {/* Session rows */}
+ <div className="space-y-2">
{conversations.map((conv) => (
<div
key={conv.id}
@@ -192,8 +254,7 @@ export default function AgentChatPage() {
</div>
</div>
))}
- </div>
- )}
+ </div>
</div>
</div>
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
index 489eb74f8..72938145b 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/email/page.tsx
@@ -9,6 +9,7 @@ import type { Email } from "@alook/shared";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
import { toast } from "sonner";
+import { Skeleton } from "@/components/ui/skeleton";
import { Loader2, Mail } from "lucide-react";
function relativeTime(dateStr: string): string {
@@ -79,8 +80,24 @@ export default function AgentEmailPage() {
if (loading) {
return (
- <div className="flex items-center justify-center flex-1">
- <Loader2 className="size-5 animate-spin text-muted-foreground" />
+ <div className="flex flex-1 min-h-0">
+ {/* Skeleton email list panel */}
+ <div className="w-2/5 min-w-[240px] max-w-[400px] border-r border-border/40">
+ {Array.from({ length: 5 }).map((_, i) => (
+ <div key={i} className="px-4 py-3 border-b border-border/30">
+ <div className="flex items-center justify-between gap-2 mb-1.5">
+ <Skeleton className="h-3.5 w-32" />
+ <Skeleton className="h-2.5 w-10" />
+ </div>
+ <Skeleton className="h-3.5 w-48 mb-1.5" />
+ <Skeleton className="h-4 w-16 rounded-full" />
+ </div>
+ ))}
+ </div>
+ {/* Skeleton detail panel */}
+ <div className="flex-1 flex items-center justify-center text-sm text-muted-foreground">
+ Select an email to view
+ </div>
</div>
);
}
@@ -88,7 +105,7 @@ export default function AgentEmailPage() {
if (emails.length === 0) {
return (
<div className="flex flex-col items-center justify-center flex-1 animate-[fade-up_400ms_ease-out_both]">
- <Mail className="size-8 text-muted-foreground/40 mb-3" />
+ <Mail className="size-8 text-muted-foreground mb-3" />
<p className="text-sm text-muted-foreground">No emails yet.</p>
<p className="text-xs text-muted-foreground/60 mt-1">
Emails sent to this agent will appear here.
diff --git a/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx b/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
index 0fc49aa76..9df47ab0a 100644
--- a/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
+++ b/src/web/src/app/(app)/w/[slug]/agents/[id]/layout.tsx
@@ -9,6 +9,7 @@ import { Button } from "@/components/ui/button";
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
import { AgentEditForm } from "@/components/agent-edit-form";
import { AgentDetailSidebar } from "@/components/agent-detail-sidebar";
+import { Skeleton } from "@/components/ui/skeleton";
import { cn } from "@/lib/utils";
import { Pencil, Trash2, X } from "lucide-react";
@@ -33,7 +34,7 @@ export default function AgentDetailLayout({ children }: { children: ReactNode })
{/* Top navbar */}
<div className="flex items-center justify-between border-b border-border/50 px-5 py-2.5">
<div className="flex items-center gap-2 min-w-0">
- {agent && (
+ {agent ? (
<Link
href={`/w/${slug}/runtimes`}
title={isOnline ? "Runtime online" : "Runtime offline"}
@@ -45,17 +46,23 @@ export default function AgentDetailLayout({ children }: { children: ReactNode })
)}
/>
</Link>
+ ) : (
+ <Skeleton className="size-2 rounded-full shrink-0" />
+ )}
+ {agent ? (
+ <Link
+ href={`/w/${slug}/agents/${agentId}/chat`}
+ onClick={() => setEditing(false)}
+ className="text-sm font-medium truncate hover:text-foreground/80 transition-colors"
+ >
+ {agent.name}
+ </Link>
+ ) : (
+ <Skeleton className="h-3.5 w-24" />
)}
- <Link
- href={`/w/${slug}/agents/${agentId}/chat`}
- onClick={() => setEditing(false)}
- className="text-sm font-medium truncate hover:text-foreground/80 transition-colors"
- >
- {agent?.name || "Agent"}
- </Link>
{editing && <span className="text-xs text-muted-foreground">/ Settings</span>}
</div>
- {agent && (
+ {agent ? (
<div className="flex items-center gap-0.5 shrink-0">
{editing ? (
<Button
@@ -90,6 +97,8 @@ export default function AgentDetailLayout({ children }: { children: ReactNode })
</>
)}
</div>
+ ) : (
+ <div className="h-7 shrink-0" />
)}
</div>
diff --git a/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx b/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
index e3e9c98b2..7b2df7fc7 100644
--- a/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
@@ -22,6 +22,7 @@ import {
} from "@/components/ui/sheet";
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
import { toast } from "sonner";
+import { Skeleton } from "@/components/ui/skeleton";
import { Loader2, Monitor, Plus } from "lucide-react";
import type { Runtime } from "@/lib/api";
import { CLI_CMD } from "@/lib/utils";
@@ -208,9 +209,41 @@ export default function RuntimesPage() {
if (loading) {
return (
- <div className="flex flex-1 items-center justify-center">
- <Loader2 className="size-5 animate-spin text-muted-foreground" />
- </div>
+ <>
+ {/* Skeleton title bar */}
+ <div className="flex items-center justify-between border-b border-border/50 px-5 py-2.5">
+ <div className="flex items-center gap-3">
+ <Skeleton className="h-4 w-16" />
+ <Skeleton className="h-3 w-52" />
+ </div>
+ <Skeleton className="h-8 w-[116px] rounded-md" />
+ </div>
+ {/* Skeleton card grid */}
+ <div className="flex-1 overflow-y-auto px-5 py-5">
+ <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
+ {Array.from({ length: 3 }).map((_, i) => (
+ <div
+ key={i}
+ className="rounded-xl border border-border/50 bg-card p-4 space-y-3"
+ >
+ <div className="flex items-center gap-2">
+ <Skeleton className="size-4 rounded" />
+ <Skeleton className="h-4 w-28" />
+ </div>
+ <div className="space-y-2">
+ <div className="flex items-center justify-between">
+ <div className="space-y-1">
+ <Skeleton className="h-3 w-20" />
+ <Skeleton className="h-3 w-28" />
+ </div>
+ <Skeleton className="h-5 w-14 rounded-full" />
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ </>
);
}
diff --git a/src/web/src/components/agent-edit-form.tsx b/src/web/src/components/agent-edit-form.tsx
index 3e08bc4f9..2308f5212 100644
--- a/src/web/src/components/agent-edit-form.tsx
+++ b/src/web/src/components/agent-edit-form.tsx
@@ -58,7 +58,7 @@ export function AgentEditForm({
const effectiveHandle = emailHandle || derivedHandle;
const handleError =
effectiveHandle && !isValidHandle(effectiveHandle)
- ? "Must be 4+ characters, letters/numbers/hyphens only"
+ ? "Must be 3+ characters, letters/numbers/hyphens only"
: "";
const handleSubmit = async (e: React.FormEvent) => {
diff --git a/src/web/src/components/app-sidebar.tsx b/src/web/src/components/app-sidebar.tsx
index 45319624c..5bb9f001f 100644
--- a/src/web/src/components/app-sidebar.tsx
+++ b/src/web/src/components/app-sidebar.tsx
@@ -5,7 +5,8 @@ import { useAgentContext } from "@/contexts/agent-context";
import { useWorkspace } from "@/contexts/workspace-context";
import { Logo } from "@/components/logo";
import { cn } from "@/lib/utils";
-import { Monitor, SunMoon, Plus, Loader2, LayoutGrid } from "lucide-react";
+import { Monitor, SunMoon, Plus, LayoutGrid } from "lucide-react";
+import { Skeleton } from "@/components/ui/skeleton";
import { useTheme } from "next-themes";
import { NavUser } from "@/components/nav-user";
@@ -51,9 +52,7 @@ export function AppSidebar() {
{/* Agent avatars */}
<div className="flex flex-1 w-full flex-col items-center gap-1.5 overflow-y-auto py-1 scrollbar-none">
{loading ? (
- <div className="flex items-center justify-center size-10">
- <Loader2 className="size-4 animate-spin text-muted-foreground" />
- </div>
+ <Skeleton className="size-10 rounded-xl" />
) : (
sorted.map((agent) => {
const isActive = activeAgentId === agent.id;
diff --git a/src/web/src/components/nav-user.tsx b/src/web/src/components/nav-user.tsx
index 1c38ab686..a959c78c1 100644
--- a/src/web/src/components/nav-user.tsx
+++ b/src/web/src/components/nav-user.tsx
@@ -13,7 +13,8 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
-import { LogOut } from "lucide-react";
+import { Skeleton } from "@/components/ui/skeleton";
+import { LogOut, User } from "lucide-react";
export function NavUser() {
const { data: session } = useSession();
@@ -25,7 +26,9 @@ export function NavUser() {
}, []);
const user = session?.user;
- if (!mounted || !user) return null;
+ if (!mounted || !user) return <Skeleton className="size-10 rounded-xl" />;
+
+ const firstLetter = (user.name || user.email || "?").charAt(0).toUpperCase();
const initials = (user.name ?? user.email ?? "?")
.split(/[\s@]/)
@@ -44,7 +47,7 @@ export function NavUser() {
/>
}
>
- <LogOut className="size-4" />
+ <User className="size-4" />
</DropdownMenuTrigger>
<DropdownMenuContent
className="min-w-52 rounded-lg"
@@ -55,12 +58,9 @@ export function NavUser() {
<DropdownMenuGroup>
<DropdownMenuLabel className="p-0 font-normal">
<div className="flex items-center gap-2 px-2 py-1.5 text-left text-sm">
- <Avatar className="size-7">
- {user.image && (
- <AvatarImage src={user.image} alt={user.name ?? ""} />
- )}
- <AvatarFallback className="text-xs">{initials}</AvatarFallback>
- </Avatar>
+ <div className="flex items-center justify-center size-7 rounded-full bg-primary text-primary-foreground text-xs font-medium shrink-0">
+ {firstLetter}
+ </div>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-medium">
{user.name ?? "User"}
diff --git a/src/web/src/components/ui/skeleton.tsx b/src/web/src/components/ui/skeleton.tsx
new file mode 100644
index 000000000..0118624f6
--- /dev/null
+++ b/src/web/src/components/ui/skeleton.tsx
@@ -0,0 +1,13 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="skeleton"
+ className={cn("animate-pulse rounded-md bg-muted", className)}
+ {...props}
+ />
+ )
+}
+
+export { Skeleton }