Merge 25b0d22d44 into c9e3bb7ca4
This commit is contained in:
commit
d28507916d
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue