This commit is contained in:
Dotta 2026-09-13 12:08:45 +00:00 committed by GitHub
commit d28507916d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 10 deletions

View File

@ -285,6 +285,29 @@ describe("TaskChatBubble accent-bubble text color", () => {
});
describe("TaskChatBubble agent page-surface treatment", () => {
it("does not show an on-behalf-of badge in the new task view", () => {
const container = document.createElement("div");
document.body.appendChild(container);
const root = createRoot(container);
flushSync(() =>
root.render(
<ThemeProvider>
<TaskChatBubble
item={{ id: "attributed", kind: "message", author: "agent", authorName: "Fable", onBehalfOfUserName: "Dotta", text: "Done." }}
/>
</ThemeProvider>,
),
);
expect(container.textContent).toContain("Fable");
expect(container.textContent).not.toContain("for Dotta");
expect(container.querySelector('[data-testid="comment-attribution-chip"]')).toBeNull();
flushSync(() => root.unmount());
container.remove();
});
it("renders agent prose without a card background or constrained width", () => {
const container = document.createElement("div");
document.body.appendChild(container);

View File

@ -11,7 +11,6 @@ import {
} from "@/components/ImageGalleryModal";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { AgentIcon } from "@/components/AgentIconPicker";
import { CommentAttributionChip } from "@/components/CommentAttributionChip";
import {
Attachment,
AttachmentContent,
@ -75,11 +74,9 @@ function initialsForName(name: string) {
export function TaskChatAgentIdentity({
agentName,
agentIcon,
onBehalfOfUserName,
}: {
agentName: string;
agentIcon?: string | null;
onBehalfOfUserName?: string;
}) {
return (
<span
@ -100,12 +97,6 @@ export function TaskChatAgentIdentity({
)}
</Avatar>
<span className="text-sm font-semibold text-foreground">{agentName}</span>
{onBehalfOfUserName ? (
<CommentAttributionChip
agentName={agentName}
userName={onBehalfOfUserName}
/>
) : null}
</span>
);
}
@ -241,7 +232,6 @@ function TaskChatBubbleContent({
<TaskChatAgentIdentity
agentName={item.authorName}
agentIcon={item.agentIcon}
onBehalfOfUserName={item.onBehalfOfUserName}
/>
) : null}
{bodyText.length > 0 ? (