From d7bdfc422cadcc407f2945e211833a8382b80117 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:06:50 -0500 Subject: [PATCH] fix(ui): show agent avatar and align chat header controls (#14726) ## Thinking Path > - Paperclip helps people manage AI agents and their work. > - Agent chat shows which agent receives each message. > - The chat header used initials instead of the agent avatar. > - The name and controls did not use the same center alignment. > - This change uses the shared avatar and centers the header content. > - Users can identify the agent and open its settings from the same row. ## Linked Issues or Issue Description **What happened?** The agent chat header showed initials instead of the agent avatar. The settings control did not align with the name and avatar. **Expected behavior** Show the agent avatar. Put the avatar, name, and settings control on the same horizontal center line. **Steps to reproduce** 1. Enable Agent Chat in Experimental settings. 2. Open a conversation with an agent that has an appearance set. 3. Check the avatar and settings control in the top bar. Related navigation work: #14706. ## What Changed - Use `AgentAvatar` in the conversation breadcrumb. - Update the breadcrumb key when the agent appearance changes. - Center breadcrumb labels that have an adjacent action. Keep task identifier baseline alignment unchanged. - Add regression checks for avatar props, appearance changes, and center alignment. ## Verification - PASS: affected Vitest suites, 129 tests. - PASS: `pnpm check:token-gates`. - PASS: `pnpm --filter @paperclipai/ui typecheck` on an isolated retry. - PASS: `pnpm --filter @paperclipai/ui build`. - PASS: browser checks at 1000 and 390 CSS pixels. Avatar, name, and settings control all have center Y = 29.5 CSS pixels. - Screenshots use the real header and avatar renderer with isolated context fixtures. No screenshot or fixture is part of this diff. - Full typecheck and build cannot complete because Cargo is not installed. - Full tests stopped with SIGKILL. The first UI typecheck also stopped with exit 137. These runs do not prove full-suite success. ## Risks - Low risk. The change only affects UI rendering. It changes no API or database contract. - Breadcrumbs with adjacent actions now use center alignment. Ordinary task identifiers keep baseline alignment. ## Model Used OpenAI Codex agent, with code editing, shell tools, and browser checks. The runtime did not expose the exact model ID or context-window size. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge No behavior or command documentation needs an update for this rendering fix. The execution environment requires the assigned branch name to stay unchanged. Pending review gates are not marked complete. Co-authored-by: Paperclip --- ui/src/components/BreadcrumbBar.test.tsx | 2 ++ ui/src/components/BreadcrumbBar.tsx | 2 +- ui/src/pages/IssueDetail.test.tsx | 14 ++++++++++++++ ui/src/pages/IssueDetail.tsx | 5 ++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ui/src/components/BreadcrumbBar.test.tsx b/ui/src/components/BreadcrumbBar.test.tsx index fbbec3d59d5..8ba15e379e5 100644 --- a/ui/src/components/BreadcrumbBar.test.tsx +++ b/ui/src/components/BreadcrumbBar.test.tsx @@ -131,6 +131,8 @@ describe("BreadcrumbBar", () => { await act(async () => root.render()); const label = container.querySelector('[data-slot="breadcrumb-page"]'); expect(label?.textContent).toBe("CCCodexCoder"); + expect(label?.classList.contains("items-center")).toBe(true); + expect(label?.classList.contains("items-baseline")).toBe(false); expect(container.querySelector("h1")).toBeNull(); const settings = container.querySelector('button[aria-label="Configure CodexCoder"]'); expect(settings?.closest('[data-slot="breadcrumb-item"]')).toBe(label?.closest('[data-slot="breadcrumb-item"]')); diff --git a/ui/src/components/BreadcrumbBar.tsx b/ui/src/components/BreadcrumbBar.tsx index e67958336ce..9684c360b44 100644 --- a/ui/src/components/BreadcrumbBar.tsx +++ b/ui/src/components/BreadcrumbBar.tsx @@ -137,7 +137,7 @@ export function BreadcrumbBar({ taskDetailLayout = false }: { taskDetailLayout?: {isLast || !crumb.href ? ( crumb.leading || crumb.identifier ? ( - + {crumb.leading && ( {crumb.leading} )} diff --git a/ui/src/pages/IssueDetail.test.tsx b/ui/src/pages/IssueDetail.test.tsx index a45a721f358..057c8570fb6 100644 --- a/ui/src/pages/IssueDetail.test.tsx +++ b/ui/src/pages/IssueDetail.test.tsx @@ -1,3 +1,4 @@ +import { AgentAvatar } from "../components/AgentAvatar"; import { TaskChatPausedTakeover, type TaskComposerPause } from "../components/task-chat/TaskChatPausedTakeover"; // @vitest-environment jsdom @@ -1437,6 +1438,19 @@ describe("IssueDetail", () => { await flushReact(); expect(mockNavigate).not.toHaveBeenCalled(); expect(mockIssuesApi.markRead).toHaveBeenCalledWith(canonical.id); + const [breadcrumbs] = mockSetBreadcrumbs.mock.calls.at(-1)!; + expect(breadcrumbs[0].leading.type).toBe(AgentAvatar); + expect(breadcrumbs[0].leading.props).toMatchObject({ agent, size: 24 }); + expect(breadcrumbs[0].leadingKey).toBe(`agent:${agent.id}:${JSON.stringify(agent.appearance)}`); + const updatedAgent = { ...agent, appearance: { schemaVersion: 1, characterVersion: "cap-v1", paletteId: "deep-tide" } } as Agent; + await act(async () => { + root.render( canonical }} />); + }); + await flushReact(); + const [updatedBreadcrumbs] = mockSetBreadcrumbs.mock.calls.at(-1)!; + expect(updatedBreadcrumbs[0].leading.props.agent).toEqual(updatedAgent); + expect(updatedBreadcrumbs[0].leadingKey).not.toBe(breadcrumbs[0].leadingKey); + }); it.each(["message", "attachment"])("creates an unused conversation only for the first %s and updates its canonical cache", async (kind) => { diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx index dd56db1f287..dff1a70b223 100644 --- a/ui/src/pages/IssueDetail.tsx +++ b/ui/src/pages/IssueDetail.tsx @@ -9,7 +9,6 @@ import { clearLegacyChatMessageRequests } from "@/lib/chat-message-request"; import { agentChatDraft } from "@/lib/agent-chat-draft"; import { Settings as ChatSettings } from "lucide-react"; import { agentDetailHref } from "./agent-detail-navigation"; -import { deriveInitials } from "@/components/Identity"; import { ExecutionBlockerNotice } from "../components/ExecutionBlockerNotice"; import type { TaskComposerPause } from "../components/task-chat/TaskChatPausedTakeover"; import { TaskDetailTasksPanel } from "@/components/task-detail/TaskDetailTasksPanel"; @@ -5437,8 +5436,8 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS if (conversationAgent) { setBreadcrumbs([{ label: conversationAgent.name, - leading: {deriveInitials(conversationAgent.name)}, - leadingKey: `agent:${conversationAgent.id}`, + leading: , + leadingKey: `agent:${conversationAgent.id}:${JSON.stringify(conversationAgent.appearance)}`, trailing: , trailingKey: `configure:${conversationAgent.id}`, }]);