The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
fix(apps): show user avatars and center access rows (#15577)
Dotta7d7f55e4be07
diff --git a/doc/screenshots/app-access-avatar/README.md b/doc/screenshots/app-access-avatar/README.mdnew file mode 100644index 0000000000..cce5d0be7a--- /dev/null+++ b/doc/screenshots/app-access-avatar/README.md@@ -0,0 +1,19 @@+# App access user avatars++Storybook: **Connections / Chat management / 2 · People and access**+(`connections-chat-management--access`).++These screenshots show the production access component with synthetic fixture+accounts: a linked account with an image, a linked account without an image,+and an account waiting for confirmation. The image fixture is an existing+Cliptoon asset used as a deterministic profile image; it is not a real person's+photo.++The avatar is centered beside both the Paperclip name and the Slack name, at+the same vertical center as Disconnect. Missing or failed images retain initials.+Truncated Paperclip names retain their full text in the native hover tooltip.++- [Desktop, 1280 × 900](desktop.png)+- [Mobile, 390 × 844](mobile.png)++The Access story checks image loading, initials, hover text, and vertical alignment.diff --git a/doc/screenshots/app-access-avatar/desktop.png b/doc/screenshots/app-access-avatar/desktop.pngnew file mode 100644index 0000000000..9d56372f29Binary files /dev/null and b/doc/screenshots/app-access-avatar/desktop.png differdiff --git a/doc/screenshots/app-access-avatar/mobile.png b/doc/screenshots/app-access-avatar/mobile.pngnew file mode 100644index 0000000000..4b5e25c33eBinary files /dev/null and b/doc/screenshots/app-access-avatar/mobile.png differdiff --git a/packages/shared/src/types/chat-channels.ts b/packages/shared/src/types/chat-channels.tsindex 42cdb36738..e83627fbad 100644--- a/packages/shared/src/types/chat-channels.ts+++ b/packages/shared/src/types/chat-channels.ts@@ -341,6 +341,7 @@ export interface ChatIdentityLink {externalDetail?: string | null;paperclipUserId?: string | null;paperclipUserLabel?: string | null;+ paperclipUserImage?: string | null;status: ChatIdentityLinkStatus;expiresAt?: string | null;confirmedAt?: string | null;diff --git a/server/src/__tests__/chat-channels.integration.test.ts b/server/src/__tests__/chat-channels.integration.test.tsindex d8c8637446..809ece2ffa 100644--- a/server/src/__tests__/chat-channels.integration.test.ts+++ b/server/src/__tests__/chat-channels.integration.test.ts@@ -6930,7 +6930,10 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => {expect(saved.setup.webhookVerifiedAt).toBeNull();expect(saved.providerAccountId).toBe("TAUTO");expect(saved.setup.slackAccount).toEqual({ externalUserId: f.installerId, paperclipUserId: actor.userId, status: "linked", welcomeStatus: "sent", dmChannelId: "DWELCOME" });- expect(await f.service.listPrincipals(f.endpoint.id)).toEqual([expect.objectContaining({ status: "linked", paperclipUserId: actor.userId })]);+ expect(await f.service.listPrincipals(f.endpoint.id)).toEqual([expect.objectContaining({ status: "linked", paperclipUserId: actor.userId, paperclipUserImage: null })]);+ await db.update(authUsers).set({ image: "https://example.test/installer.png" }).where(eq(authUsers.id, actor.userId));+ expect(await f.service.listPrincipals(f.endpoint.id)).toEqual([expect.objectContaining({ paperclipUserImage: "https://example.test/installer.png" })]);+ await db.update(authUsers).set({ image: null }).where(eq(authUsers.id, actor.userId));const [, welcome] = f.provider.mock.calls.find(([url]) => String(url).endsWith("chat.postMessage"))!;expect(new URLSearchParams(String(welcome!.body)).get("channel")).toBe(f.installerId);expect(new URLSearchParams(String(welcome!.body)).get("text")).toMatch(/^Hi, I’m .+\. Your Slack account is connected to Paperclip\.$/);diff --git a/server/src/routes/openapi.ts b/server/src/routes/openapi.tsindex 6efc1b198c..25b6c7278f 100644--- a/server/src/routes/openapi.ts+++ b/server/src/routes/openapi.ts@@ -910,6 +910,7 @@ const chatPrincipalLinkResponseSchema = zexternalDetail: z.string(),paperclipUserId: z.string().nullable(),paperclipUserLabel: z.string().nullable(),+ paperclipUserImage: z.string().nullable(),status: chatIdentityLinkStatusSchema,}).strict();diff --git a/server/src/services/chat-channels/identity-links.ts b/server/src/services/chat-channels/identity-links.tsindex 47596405f3..b45ee22db6 100644--- a/server/src/services/chat-channels/identity-links.ts+++ b/server/src/services/chat-channels/identity-links.ts@@ -56,6 +56,7 @@ export function createChatIdentityLinks(db: Db, options: ChatIdentityLinkOptionsid: authUsers.id,name: authUsers.name,email: authUsers.email,+ image: authUsers.image,}).from(authUsers).where(inArray(authUsers.id, userIds))@@ -80,6 +81,7 @@ export function createChatIdentityLinks(db: Db, options: ChatIdentityLinkOptions: principal.externalId,paperclipUserId: link?.paperclipUserId ?? null,paperclipUserLabel: user?.name ?? user?.email ?? null,+ paperclipUserImage: user?.image ?? null,status: link?.status ?? "pending",lastConnectAt: connectByPrincipal.get(principal.id) ?? null,};diff --git a/ui/src/api/chatEndpoints.ts b/ui/src/api/chatEndpoints.tsindex 79e0c43b15..d50a6756c3 100644--- a/ui/src/api/chatEndpoints.ts+++ b/ui/src/api/chatEndpoints.ts@@ -59,6 +59,7 @@ export interface ChatIdentityLink {externalDetail?: string | null;paperclipUserId?: string | null;paperclipUserLabel?: string | null;+ paperclipUserImage?: string | null;status: "linked" | "pending" | "revoked";}diff --git a/ui/src/pages/apps/chat/ChatEndpointDetail.tsx b/ui/src/pages/apps/chat/ChatEndpointDetail.tsxindex 3544343a53..2c07fc4d89 100644--- a/ui/src/pages/apps/chat/ChatEndpointDetail.tsx+++ b/ui/src/pages/apps/chat/ChatEndpointDetail.tsx@@ -1,8 +1,9 @@+import { deriveInitials } from "@/components/Identity";+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { agentAvatarUrl } from "@/lib/agent-avatar-url";import { resolveAgentAppearance } from "@paperclipai/shared";import { SlackTestMessageButton } from "./SlackTestMessageButton";import { AgentAvatar } from "@/components/AgentAvatar";-import { Identity } from "@/components/Identity";import { SlackSetupAdvanced } from "./SlackAppDetails";import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";import { SlackToolsSettings, SlackSearchAccess } from "./SlackToolSettings";@@ -782,13 +783,19 @@ function Access({role="listitem"className="flex flex-wrap items-center gap-3 py-3">- <div className="min-w-0 flex-1">- <Identity name={link.paperclipUserLabel ?? link.externalLabel} size="default" className="gap-2" />- {(link.status !== "linked" || link.externalLabel !== link.paperclipUserLabel) && <p className="pl-10 text-xs text-muted-foreground">- {link.status === "revoked" ? "Disconnected" : link.status === "linked"- ? link.externalLabel- : "Waiting for account confirmation"}- </p>}+ <div className="flex min-w-0 flex-1 items-center gap-2">+ <Avatar aria-hidden="true">+ {link.paperclipUserImage && <AvatarImage src={link.paperclipUserImage} alt="" />}+ <AvatarFallback>{deriveInitials(link.paperclipUserLabel ?? link.externalLabel)}</AvatarFallback>+ </Avatar>+ <div className="min-w-0">+ <p className="truncate text-sm" title={link.paperclipUserLabel ?? link.externalLabel}>{link.paperclipUserLabel ?? link.externalLabel}</p>+ {(link.status !== "linked" || link.externalLabel !== link.paperclipUserLabel) && <p className="text-xs text-muted-foreground">+ {link.status === "revoked" ? "Disconnected" : link.status === "linked"+ ? link.externalLabel+ : "Waiting for account confirmation"}+ </p>}+ </div></div>{link.status === "linked" ? (<Buttondiff --git a/ui/storybook/stories/chat-channels/chat-management/chat-management.stories.tsx b/ui/storybook/stories/chat-channels/chat-management/chat-management.stories.tsxindex ef3706234d..ef07eb5040 100644--- a/ui/storybook/stories/chat-channels/chat-management/chat-management.stories.tsx+++ b/ui/storybook/stories/chat-channels/chat-management/chat-management.stories.tsx@@ -1,6 +1,6 @@import { useEffect, useRef, useState } from "react";import type { Meta, StoryObj } from "@storybook/react-vite";-import { expect, userEvent, within } from "storybook/test";+import { expect, userEvent, waitFor, within } from "storybook/test";import { useQueryClient } from "@tanstack/react-query";import { Route, Routes, useNavigate } from "@/lib/router";import { queryKeys } from "@/lib/queryKeys";@@ -9,6 +9,7 @@ import { PluginLauncherProvider } from "@/plugins/launchers";import { ChatEndpointDetail } from "@/pages/apps/chat/ChatEndpointDetail";import { useCompany } from "@/context/CompanyContext";import type { ChatEndpoint, ChatEndpointResource, ChatIdentityLink } from "@/api/chatEndpoints";+import userAvatar from "../../../prototypes/slack-avatar/ceo-cliptoon.png";import { storybookAgents, storybookExecutionWorkspaces } from "../../../fixtures/paperclipData";type Scenario = "populated" | "empty" | "error" | "channel-added" | "unlinked" | "invitation-expired";@@ -33,7 +34,8 @@ function ChatManagementPage({ tab = "settings", scenario = "populated" }: { tab?{ id: "general", type: "channel", providerResourceId: "CGENERAL", label: "#general", availability: "available", enabled: false },];let principals: ChatIdentityLink[] = scenario === "empty" ? [] : [- { id: "ada", principalId: "ada", externalLabel: "@ada", paperclipUserLabel: "Ada Lovelace", paperclipUserId: "ada", status: "linked" },+ { id: "ada", principalId: "ada", externalLabel: "@ada", paperclipUserLabel: "Ada Lovelace", paperclipUserId: "ada", paperclipUserImage: userAvatar, status: "linked" },+ { id: "alan", principalId: "alan", externalLabel: "@alan", paperclipUserLabel: "Alan Turing", paperclipUserImage: null, status: "linked" },{ id: "grace", principalId: "grace", externalLabel: "Grace Hopper", status: "pending" },];let resourceReads = 0;@@ -119,7 +121,24 @@ const meta = {export default meta;type Story = StoryObj<typeof meta>;export const Settings: Story = { name: "1 · Settings" };-export const Access: Story = { name: "2 · People and access", args: { tab: "access" } };+export const Access: Story = {+ name: "2 · People and access", args: { tab: "access" },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const name = await canvas.findByText("Ada Lovelace");+ await expect(name).toHaveAttribute("title", "Ada Lovelace");+ const row = name.closest('[role="listitem"]')!;+ const avatar = row.querySelector('[data-slot="avatar"]')!;+ await waitFor(() => expect(avatar.querySelector("img")).toBeVisible());+ await expect(canvas.getByText("AT")).toBeVisible();+ const center = (element: Element) => {+ const bounds = element.getBoundingClientRect();+ return bounds.top + bounds.height / 2;+ };+ await expect(Math.abs(center(avatar) - center(name.parentElement!))).toBeLessThan(1);+ await expect(Math.abs(center(avatar) - center(within(row as HTMLElement).getByRole("button", { name: "Disconnect" })))).toBeLessThan(1);+ },+};export const InvitePeople: Story = {name: "3 · Invite people", args: { tab: "access" },play: async ({ canvasElement }) => {