Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
fix(avatar): localize to English, fix dark mode thumbnails, fix canvas preview
Gusc41ad4bd1756
diff --git a/src/web/src/components/agent-preview-card.tsx b/src/web/src/components/agent-preview-card.tsxindex b9144c0cb..884ad9b21 100644--- a/src/web/src/components/agent-preview-card.tsx+++ b/src/web/src/components/agent-preview-card.tsx@@ -39,17 +39,17 @@ export function AgentPreviewCard({if (isCompact) {return (<div className="flex items-center gap-2 p-0">- {agent.avatar_url ? (- <img- src={agent.avatar_url}- alt={agent.name}- className="size-8 rounded-xl object-cover shrink-0"- />- ) : (- <div className="flex items-center justify-center size-8 rounded-xl bg-secondary text-secondary-foreground text-xs font-medium shrink-0">- {agent.name.charAt(0).toUpperCase()}- </div>- )}+ {(() => {+ const avatarConfig = parseAvatarUrl(agent.avatar_url);+ if (avatarConfig) {+ return <AvatarRenderer config={avatarConfig} size={32} className="shrink-0 rounded-xl" />;+ }+ return (+ <div className="flex items-center justify-center size-8 rounded-xl bg-secondary text-secondary-foreground text-xs font-medium shrink-0">+ {agent.name.charAt(0).toUpperCase()}+ </div>+ );+ })()}<div className="min-w-0 flex-1"><div className="flex items-center gap-1.5"><p className="text-sm font-medium truncate max-w-[140px]">{agent.name}</p>diff --git a/src/web/src/components/avatar/avatar-generator.tsx b/src/web/src/components/avatar/avatar-generator.tsxindex 6e1bcc2bb..6420934d4 100644--- a/src/web/src/components/avatar/avatar-generator.tsx+++ b/src/web/src/components/avatar/avatar-generator.tsx@@ -168,17 +168,17 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata}, [layout, onChange]);const renderShapeThumb = (key: string) => (- <svg viewBox="0 0 200 200" width="40" height="40">+ <svg viewBox="0 0 200 200" width="40" height="40" className="dark:invert">{Shapes[key]?.render()}</svg>);const renderNoseThumb = (key: string) => (- <svg viewBox="-14 -10 28 20" width="36" height="24">+ <svg viewBox="-14 -10 28 20" width="36" height="24" className="dark:invert">{Noses[key]?.render()}</svg>);const renderEyeThumb = (key: string) => (- <svg viewBox="-18 -8 36 16" width="44" height="22">+ <svg viewBox="-18 -8 36 16" width="44" height="22" className="dark:invert">{Eyes[key]?.render(8)}</svg>);@@ -206,9 +206,9 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata<circle cx="16" cy="16" r="1.5" fill="currentColor" /><circle cx="12" cy="12" r="1.5" fill="currentColor" /></svg>- 随机+ Random{isHorizontal && (- <kbd className="ml-1 rounded bg-background/20 px-1.5 py-0.5 text-[10px] font-mono">空格</kbd>+ <kbd className="ml-1 rounded bg-background/20 px-1.5 py-0.5 text-[10px] font-mono">Space</kbd>)}</button></div>@@ -231,7 +231,7 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata: "border-transparent text-muted-foreground hover:text-foreground")}>- ★ 预设+ ★ Presets</button><buttontype="button"@@ -243,7 +243,7 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata: "border-transparent text-muted-foreground hover:text-foreground")}>- ⚙ 自定义+ ⚙ Custom</button></div>@@ -282,21 +282,21 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata{tab === "custom" && (<div className="flex flex-col gap-4"><Cycler- label="轮廓"+ label="Shape"keys={SHAPE_KEYS}value={config.shape}onChange={(v) => setField("shape", v)}renderThumb={renderShapeThumb}/><Cycler- label="鼻子"+ label="Nose"keys={NOSE_KEYS}value={config.nose}onChange={(v) => setField("nose", v)}renderThumb={renderNoseThumb}/><Cycler- label="眼睛"+ label="Eyes"keys={EYE_KEYS}value={config.eye}onChange={(v) => setField("eye", v)}@@ -306,9 +306,9 @@ export function AvatarGenerator({ config, onChange, layout = "vertical" }: Avata{/* Background colors */}<div><div className="mb-2 text-xs font-medium text-muted-foreground">- 背景色+ Color</div>- <div className="flex flex-wrap gap-2">+ <div className="flex flex-wrap gap-2 p-1">{BG_COLORS.map((c, i) => (<buttonkey={c.value}diff --git a/src/web/src/components/avatar/avatar-parts.tsx b/src/web/src/components/avatar/avatar-parts.tsxindex d56d0782a..67e69dc21 100644--- a/src/web/src/components/avatar/avatar-parts.tsx+++ b/src/web/src/components/avatar/avatar-parts.tsx@@ -30,18 +30,18 @@ export interface ColorOption {}export const BG_COLORS: ColorOption[] = [- { name: "紫", value: "#9B7FE8" },- { name: "青", value: "#2BAA9C" },- { name: "橙", value: "#F39A4F" },- { name: "蓝", value: "#3D7EE8" },- { name: "粉", value: "#F8B4C4" },- { name: "黄", value: "#F4C141" },- { name: "绿", value: "#7FCB6F" },- { name: "米", value: "#D6CCB8" },- { name: "红", value: "#EE5E48" },- { name: "湖蓝", value: "#3FA8C0" },- { name: "雾灰", value: "#C9D1D9" },- { name: "深紫", value: "#6A4DCC" },+ { name: "Purple", value: "#9B7FE8" },+ { name: "Teal", value: "#2BAA9C" },+ { name: "Orange", value: "#F39A4F" },+ { name: "Blue", value: "#3D7EE8" },+ { name: "Pink", value: "#F8B4C4" },+ { name: "Yellow", value: "#F4C141" },+ { name: "Green", value: "#7FCB6F" },+ { name: "Beige", value: "#D6CCB8" },+ { name: "Red", value: "#EE5E48" },+ { name: "Lake Blue", value: "#3FA8C0" },+ { name: "Gray", value: "#C9D1D9" },+ { name: "Deep Purple", value: "#6A4DCC" },];// ─────────────────────────────────────────────────────────────@@ -55,22 +55,22 @@ export interface ShapeDef {export const Shapes: Record<string, ShapeDef> = {circle: {- name: "圆形",+ name: "Circle",face: { cx: 100, cy: 105, w: 80 },render: () => <circle cx="100" cy="100" r="70" {...sp()} />,},rounded: {- name: "方形",+ name: "Rounded",face: { cx: 100, cy: 105, w: 90 },render: () => <rect x="30" y="30" width="140" height="140" rx="20" {...sp()} />,},hexagon: {- name: "六边形",+ name: "Hexagon",face: { cx: 100, cy: 105, w: 86 },render: () => <path d="M100 28 L162 64 L162 136 L100 172 L38 136 L38 64 Z" {...sp()} />,},task: {- name: "任务",+ name: "Task",face: { cx: 92, cy: 92, w: 70 },render: () => (<g>@@ -80,7 +80,7 @@ export const Shapes: Record<string, ShapeDef> = {),},book: {- name: "笔记",+ name: "Book",face: { cx: 100, cy: 105, w: 90 },render: () => (<g>@@ -91,7 +91,7 @@ export const Shapes: Record<string, ShapeDef> = {),},mail: {- name: "邮件",+ name: "Mail",face: { cx: 100, cy: 118, w: 80 },render: () => (<g>@@ -101,7 +101,7 @@ export const Shapes: Record<string, ShapeDef> = {),},calendar: {- name: "日历",+ name: "Calendar",face: { cx: 100, cy: 122, w: 80 },render: () => (<g>@@ -113,7 +113,7 @@ export const Shapes: Record<string, ShapeDef> = {),},bulb: {- name: "想法",+ name: "Bulb",face: { cx: 100, cy: 100, w: 70 },render: () => (<g>@@ -124,14 +124,14 @@ export const Shapes: Record<string, ShapeDef> = {),},folder: {- name: "文件夹",+ name: "Folder",face: { cx: 100, cy: 118, w: 90 },render: () => (<path d="M30 64 A 10 10 0 0 1 40 54 L 84 54 L 96 66 L 160 66 A 10 10 0 0 1 170 76 L 170 158 A 10 10 0 0 1 160 168 L 40 168 A 10 10 0 0 1 30 158 Z" {...sp()} />),},mountain: {- name: "目标",+ name: "Mountain",face: { cx: 100, cy: 130, w: 70 },render: () => (<g>@@ -154,12 +154,12 @@ export interface NoseDef {}export const Noses: Record<string, NoseDef> = {- dot: { name: "点", render: () => <circle cx="0" cy="0" r="3.2" {...fp} /> },- dash: { name: "横", render: () => <line x1="-8" y1="0" x2="8" y2="0" {...lpf(SW_FACE)} /> },- hookL: { name: "L 形", render: () => <path d="M-4 -6 L-4 5 L7 5" {...lpf(SW_FACE)} /> },- smile: { name: "微笑", render: () => <path d="M-8 -3 Q0 7 8 -3" {...lpf(SW_FACE)} /> },- caret: { name: "尖角", render: () => <path d="M-8 5 L0 -5 L8 5" {...lpf(SW_FACE)} /> },- arrow: { name: "小箭头", render: () => <path d="M-8 -3 L0 4 L8 -3" {...lpf(SW_FACE)} /> },+ dot: { name: "Dot", render: () => <circle cx="0" cy="0" r="3.2" {...fp} /> },+ dash: { name: "Dash", render: () => <line x1="-8" y1="0" x2="8" y2="0" {...lpf(SW_FACE)} /> },+ hookL: { name: "Hook", render: () => <path d="M-4 -6 L-4 5 L7 5" {...lpf(SW_FACE)} /> },+ smile: { name: "Smile", render: () => <path d="M-8 -3 Q0 7 8 -3" {...lpf(SW_FACE)} /> },+ caret: { name: "Caret", render: () => <path d="M-8 5 L0 -5 L8 5" {...lpf(SW_FACE)} /> },+ arrow: { name: "Arrow", render: () => <path d="M-8 -3 L0 4 L8 -3" {...lpf(SW_FACE)} /> },oh: { name: "o", render: () => <circle cx="0" cy="0" r="4" {...lpf(SW_FACE - 1)} /> },};@@ -181,9 +181,9 @@ const eye = (l: ReactNode, r: ReactNode = l) => (dx: number) => ();export const Eyes: Record<string, EyeDef> = {- dots: { name: "点点", render: eye(<circle cx="0" cy="0" r="4.5" {...fp} />) },+ dots: { name: "Dots", render: eye(<circle cx="0" cy="0" r="4.5" {...fp} />) },big: {- name: "大眼睛",+ name: "Big",render: eye(<g><circle cx="0" cy="0" r="7" {...sp(SW_FACE - 1)} />@@ -191,17 +191,17 @@ export const Eyes: Record<string, EyeDef> = {</g>),},- rings: { name: "圆圈", render: eye(<circle cx="0" cy="0" r="5" {...lpf(SW_FACE - 1)} />) },- arches: { name: "弯弯", render: eye(<path d="M-7 3 Q0 -7 7 3" {...lpf(SW_FACE)} />) },- lines: { name: "横线", render: eye(<line x1="-7" y1="0" x2="7" y2="0" {...lpf(SW_FACE)} />) },- happy: { name: "笑眼", render: eye(<path d="M-7 3 L0 -5 L7 3" {...lpf(SW_FACE)} />) },- sleepy: { name: "困困", render: eye(<path d="M-7 -2 Q0 6 7 -2" {...lpf(SW_FACE)} />) },+ rings: { name: "Rings", render: eye(<circle cx="0" cy="0" r="5" {...lpf(SW_FACE - 1)} />) },+ arches: { name: "Arches", render: eye(<path d="M-7 3 Q0 -7 7 3" {...lpf(SW_FACE)} />) },+ lines: { name: "Lines", render: eye(<line x1="-7" y1="0" x2="7" y2="0" {...lpf(SW_FACE)} />) },+ happy: { name: "Happy", render: eye(<path d="M-7 3 L0 -5 L7 3" {...lpf(SW_FACE)} />) },+ sleepy: { name: "Sleepy", render: eye(<path d="M-7 -2 Q0 6 7 -2" {...lpf(SW_FACE)} />) },shy: {- name: "半月",+ name: "Shy",render: eye(<path d="M-6 -3 A6 6 0 0 1 6 -3 L6 1 A6 6 0 0 1 -6 1 Z" {...fp} />),},wink: {- name: "俏皮",+ name: "Wink",render: (dx: number) => (<g><g transform={`translate(${-dx}, 0)`}><circle cx="0" cy="0" r="4.5" {...fp} /></g>@@ -239,18 +239,18 @@ export interface Preset {}export const PRESETS: Preset[] = [- { name: "任务", config: { shape: "task", nose: "dot", eye: "dots", bg: 0 } },- { name: "笔记", config: { shape: "book", nose: "dash", eye: "happy", bg: 1 } },- { name: "邮件", config: { shape: "mail", nose: "smile", eye: "dots", bg: 3 } },- { name: "日程", config: { shape: "calendar", nose: "dot", eye: "dots", bg: 4 } },- { name: "想法", config: { shape: "bulb", nose: "oh", eye: "rings", bg: 5 } },- { name: "项目", config: { shape: "folder", nose: "dash", eye: "lines", bg: 7 } },- { name: "目标", config: { shape: "mountain", nose: "caret", eye: "arches", bg: 8 } },- { name: "梦想", config: { shape: "circle", nose: "smile", eye: "shy", bg: 11 } },- { name: "收纳", config: { shape: "rounded", nose: "dot", eye: "sleepy", bg: 6 } },- { name: "探索", config: { shape: "hexagon", nose: "hookL", eye: "wink", bg: 9 } },- { name: "专注", config: { shape: "task", nose: "caret", eye: "lines", bg: 2 } },- { name: "收藏", config: { shape: "book", nose: "oh", eye: "rings", bg: 10 } },+ { name: "Task", config: { shape: "task", nose: "dot", eye: "dots", bg: 0 } },+ { name: "Notes", config: { shape: "book", nose: "dash", eye: "happy", bg: 1 } },+ { name: "Mail", config: { shape: "mail", nose: "smile", eye: "dots", bg: 3 } },+ { name: "Schedule", config: { shape: "calendar", nose: "dot", eye: "dots", bg: 4 } },+ { name: "Idea", config: { shape: "bulb", nose: "oh", eye: "rings", bg: 5 } },+ { name: "Project", config: { shape: "folder", nose: "dash", eye: "lines", bg: 7 } },+ { name: "Goal", config: { shape: "mountain", nose: "caret", eye: "arches", bg: 8 } },+ { name: "Dream", config: { shape: "circle", nose: "smile", eye: "shy", bg: 11 } },+ { name: "Organize", config: { shape: "rounded", nose: "dot", eye: "sleepy", bg: 6 } },+ { name: "Explore", config: { shape: "hexagon", nose: "hookL", eye: "wink", bg: 9 } },+ { name: "Focus", config: { shape: "task", nose: "caret", eye: "lines", bg: 2 } },+ { name: "Collect", config: { shape: "book", nose: "oh", eye: "rings", bg: 10 } },];// ─────────────────────────────────────────────────────────────diff --git a/src/web/src/components/avatar/avatar-picker-dialog.tsx b/src/web/src/components/avatar/avatar-picker-dialog.tsxindex 56c6d739f..b9c612c18 100644--- a/src/web/src/components/avatar/avatar-picker-dialog.tsx+++ b/src/web/src/components/avatar/avatar-picker-dialog.tsx@@ -43,7 +43,7 @@ export function AvatarPickerDialog({ config, onChange }: AvatarPickerDialogProps<DialogContent className="sm:max-w-[720px]"><DialogHeader>- <DialogTitle>选择头像</DialogTitle>+ <DialogTitle>Choose Avatar</DialogTitle></DialogHeader><AvatarGeneratorconfig={draft}diff --git a/src/web/src/components/canvas/link-sidecar.tsx b/src/web/src/components/canvas/link-sidecar.tsxindex 0b9553965..7db7368dd 100644--- a/src/web/src/components/canvas/link-sidecar.tsx+++ b/src/web/src/components/canvas/link-sidecar.tsx@@ -13,6 +13,7 @@ import { Button } from "@/components/ui/button";import { MarkdownEditor } from "@/components/ui/markdown-editor";import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";import { Trash2 } from "lucide-react";+import { AvatarRenderer, parseAvatarUrl } from "@/components/avatar";interface LinkSidecarProps {open: boolean;@@ -68,14 +69,9 @@ export function LinkSidecar({const renderAvatar = (agent: Agent | undefined) => {if (!agent) return null;- if (agent.avatar_url) {- return (- <img- src={agent.avatar_url}- alt={agent.name}- className="size-8 rounded-xl object-cover shrink-0"- />- );+ const avatarConfig = parseAvatarUrl(agent.avatar_url);+ if (avatarConfig) {+ return <AvatarRenderer config={avatarConfig} size={32} className="shrink-0 rounded-xl" />;}return (<div className="flex items-center justify-center size-8 rounded-xl bg-secondary text-secondary-foreground text-xs font-medium shrink-0">