AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(copilot): friendlier 'Response stopped' banner (#13114)
John Ababseh94ebce7f633f
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-lifecycle.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-lifecycle.test.tsxindex 28e34c623e..faecaf7c39 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-lifecycle.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-lifecycle.test.tsx@@ -112,7 +112,7 @@ describe("AutoPilot streaming — submit / stop lifecycle", () => {await clickStop();expect(- await screen.findByText(/you manually stopped this chat/i, undefined, {+ await screen.findByText(/task stopped/i, undefined, {timeout: 5000,}),).toBeDefined();diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsxindex 8da708b80a..503aafb009 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx@@ -1,7 +1,7 @@import { MessageResponse } from "@/components/ai-elements/message";import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";-import { ExclamationMarkIcon } from "@phosphor-icons/react";+import { StoppedTaskCard } from "./StoppedTaskCard";import { ToolUIPart, UIDataTypes, UIMessage, UITools } from "ai";import { ArtifactCard } from "../../ArtifactCard/ArtifactCard";import { AskQuestionTool } from "../../../tools/AskQuestion/AskQuestion";@@ -134,14 +134,7 @@ export function MessagePartRenderer({lowerMarker === "operation cancelled" ||lowerMarker === "execution stopped by user";if (isCancellation) {- return (- <div- key={key}- className="my-2 flex items-center gap-1 rounded-lg bg-neutral-200/50 px-3 py-2 text-sm text-neutral-600"- >- <ExclamationMarkIcon size={16} /> You manually stopped this chat- </div>- );+ return <StoppedTaskCard key={key} />;}return (<ErrorCarddiff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/StoppedTaskCard.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/StoppedTaskCard.tsxnew file mode 100644index 0000000000..53cceb2628--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/StoppedTaskCard.tsx@@ -0,0 +1,28 @@+import { LightbulbIcon, SquareIcon } from "@phosphor-icons/react";++import { Text } from "@/components/atoms/Text/Text";++export function StoppedTaskCard() {+ return (+ <div className="my-2 flex items-start gap-3 rounded-medium border border-zinc-200 bg-zinc-50 p-4">+ <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-small bg-purple-50">+ <SquareIcon size={16} weight="fill" className="text-purple-500" />+ </div>+ <div className="min-w-0 flex-1">+ <Text variant="body-medium" className="text-zinc-900">+ Task stopped+ </Text>+ <Text variant="body" className="mt-1 text-[13px] text-zinc-600">+ The response above is incomplete. You can ask to continue or type+ something new.+ </Text>+ <div className="mt-2.5 flex items-center gap-1.5">+ <LightbulbIcon size={14} className="shrink-0 text-purple-300" />+ <Text variant="small" className="text-zinc-600">+ Try “continue” or type something new.+ </Text>+ </div>+ </div>+ </div>+ );+}