Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat: add loading animations for chat bubble and task badge

Gener2ee62965f0e8
diff --git a/src/web/src/app/globals.css b/src/web/src/app/globals.css
index d7d1d97ae..b7676edda 100644
--- a/src/web/src/app/globals.css
+++ b/src/web/src/app/globals.css
@@ -67,6 +67,9 @@
--primary-foreground: oklch(0.985 0.005 80);
--secondary: oklch(0.965 0.006 80);
--secondary-foreground: oklch(0.25 0.012 60);
+ --shimmer: rgba(0, 0, 0, 0.06);
+ --shimmer-peak: rgba(0, 0, 0, 0.12);
+ --bubble-glow: rgba(255, 255, 255, 0.5);
--muted: oklch(0.93 0.008 80);
--muted-foreground: oklch(0.52 0.01 60);
--accent: oklch(0.92 0.012 80);
@@ -104,6 +107,9 @@
--primary-foreground: oklch(0.21 0.008 60);
--secondary: oklch(0.27 0.008 60);
--secondary-foreground: oklch(0.93 0.006 80);
+ --shimmer: rgba(255, 255, 255, 0.06);
+ --shimmer-peak: rgba(255, 255, 255, 0.12);
+ --bubble-glow: rgba(255, 255, 255, 0.5);
--muted: oklch(0.27 0.008 60);
--muted-foreground: oklch(0.65 0.01 70);
--accent: oklch(0.27 0.008 60);
@@ -694,6 +700,15 @@
}
}
+@keyframes shimmer {
+ 0% {
+ transform: translateX(-100%);
+ }
+ 100% {
+ transform: translateX(200%);
+ }
+}
+
/* ── Utility: hide scrollbar ── */
.scrollbar-none {
-ms-overflow-style: none;
diff --git a/src/web/src/components/agent-chat/agent-chat-view.tsx b/src/web/src/components/agent-chat/agent-chat-view.tsx
index a4df3129e..23274d0bc 100644
--- a/src/web/src/components/agent-chat/agent-chat-view.tsx
+++ b/src/web/src/components/agent-chat/agent-chat-view.tsx
@@ -870,21 +870,30 @@ export function AgentChatView() {
connectionLost={connectionLost}
/>
)}
- {msg.role === "user" ? (
- <div className="flex justify-end">
- <div className="max-w-[80%] rounded-lg px-4 py-2 bg-primary text-primary-foreground text-base">
- <div className="markdown markdown-user">
- <Streamdown controls={{ code: { copy: true, download: false }, table: { copy: false, download: false, fullscreen: false } }} linkSafety={{ enabled: false }}>{msg.content}</Streamdown>
+ {msg.role === "user" ? (() => {
+ const isLastUser = messages.length > 0 && messages[messages.length - 1].id === msg.id;
+ const awaitingRun = isLastUser && !!activeTask && activeTask.status !== "running" && !["completed", "failed", "cancelled", "superseded"].includes(activeTask.status);
+ return (
+ <div className="flex justify-end">
+ <div className={cn(
+ "max-w-[80%] rounded-lg px-4 py-2 bg-primary text-primary-foreground text-base relative",
+ )}>
+ {awaitingRun && (
+ <div className="absolute inset-0 rounded-lg animate-pulse pointer-events-none" style={{ boxShadow: "0 0 0 2px var(--bubble-glow)" }} />
+ )}
+ <div className="markdown markdown-user">
+ <Streamdown controls={{ code: { copy: true, download: false }, table: { copy: false, download: false, fullscreen: false } }} linkSafety={{ enabled: false }}>{msg.content}</Streamdown>
+ </div>
+ {msg.attachment_ids && msg.attachment_ids.length > 0 && (
+ <AttachmentChips attachmentIds={msg.attachment_ids} artifacts={artifacts} onArtifactClick={handleArtifactClick} />
+ )}
+ {!msg.attachment_ids && (
+ <PendingFileChips pendingFiles={pendingFilesMapRef.current} messageId={msg.id} />
+ )}
</div>
- {msg.attachment_ids && msg.attachment_ids.length > 0 && (
- <AttachmentChips attachmentIds={msg.attachment_ids} artifacts={artifacts} onArtifactClick={handleArtifactClick} />
- )}
- {!msg.attachment_ids && (
- <PendingFileChips pendingFiles={pendingFilesMapRef.current} messageId={msg.id} />
- )}
</div>
- </div>
- ) : !hasTaskStream ? (
+ );
+ })() : !hasTaskStream ? (
<div className="flex justify-start">
<div className="markdown max-w-full min-w-0 px-1 py-1 text-base text-foreground">
<Streamdown controls={{ code: { copy: true, download: false }, table: { copy: true, download: false, fullscreen: true } }} linkSafety={{ enabled: false }}>{msg.content}</Streamdown>
diff --git a/src/web/src/components/agent-chat/follow-up-buffer.tsx b/src/web/src/components/agent-chat/follow-up-buffer.tsx
index abc123765..40a52b197 100644
--- a/src/web/src/components/agent-chat/follow-up-buffer.tsx
+++ b/src/web/src/components/agent-chat/follow-up-buffer.tsx
@@ -45,10 +45,7 @@ export function FollowUpBuffer({
{bufferedMessages.map((msg, i) => {
const fromBottom = count - 1 - i;
const inStack = i >= count - visibleCount;
- const stackFromTop = inStack ? fromBottom : visibleCount;
- // Both states use bottom-based positioning.
- // The last card (fromBottom=0) never moves.
const collapsedBottom = inStack ? fromBottom * STACK_GAP : 0;
const expandedBottom = fromBottom * (CARD_H + EXPANDED_GAP);
@@ -72,7 +69,7 @@ export function FollowUpBuffer({
className="h-full rounded-lg border bg-background/95 backdrop-blur-sm shadow-sm
flex items-center gap-2 px-3"
>
- <span className="shrink-0 text-[11px] text-muted-foreground/50 tabular-nums w-4 text-right">
+ <span className="shrink-0 text-[11px] text-primary/60 tabular-nums w-4 text-center">
{i + 1}
</span>
<div className="min-w-0 flex-1 flex items-center gap-1.5">
diff --git a/src/web/src/components/task-stream.tsx b/src/web/src/components/task-stream.tsx
index c634b4c33..4e9d52d0a 100644
--- a/src/web/src/components/task-stream.tsx
+++ b/src/web/src/components/task-stream.tsx
@@ -271,9 +271,25 @@ export function TaskStream({
{/* Status badge */}
<div className="flex items-center gap-2">
{task.status === "running" ? (
- <Badge variant="secondary" className="gap-1.5">
+ <Badge variant="secondary" className="gap-1.5 relative overflow-hidden">
<span className="size-1.5 rounded-full bg-primary animate-pulse" />
Working
+ <div
+ className="pointer-events-none absolute inset-0 -translate-x-full animate-[shimmer_2s_ease-in-out_infinite]"
+ style={{
+ background: "linear-gradient(90deg, transparent 0%, var(--shimmer) 40%, var(--shimmer-peak) 50%, var(--shimmer) 60%, transparent 100%)",
+ }}
+ />
+ </Badge>
+ ) : isRunning ? (
+ <Badge variant="secondary" className="relative overflow-hidden">
+ {task.status}
+ <div
+ className="pointer-events-none absolute inset-0 -translate-x-full animate-[shimmer_2s_ease-in-out_infinite]"
+ style={{
+ background: "linear-gradient(90deg, transparent 0%, var(--shimmer) 40%, var(--shimmer-peak) 50%, var(--shimmer) 60%, transparent 100%)",
+ }}
+ />
</Badge>
) : (
<Badge variant="secondary">{task.status}</Badge>