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(frontend): minimal GPT-style restyle of the copilot chat (#14239)
Ubbe8cf6787cd596
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsxindex 870d73f183..19154a7126 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx@@ -18,6 +18,7 @@ import { AdminImpersonationBanner } from "../admin/components/AdminImpersonationimport { GlobalSearchOverlay } from "../components/GlobalSearchModal/GlobalSearchOverlay";import { WorkspaceFilesTrigger } from "../copilot/components/WorkspaceFilesTrigger/WorkspaceFilesTrigger";import { PaywallGate } from "../PaywallGate/PaywallGate";+import { ArtifactsPanelNavCollapse } from "./components/ArtifactsPanelNavCollapse/ArtifactsPanelNavCollapse";import { BuilderSidebarAutoClose } from "./components/BuilderSidebarAutoClose/BuilderSidebarAutoClose";import { InsetHeaderTitle } from "./components/InsetHeaderTitle/InsetHeaderTitle";import { usePlatformChrome } from "./usePlatformChrome";@@ -75,6 +76,7 @@ export function PlatformChrome({ children }: Props) {style={{ "--sidebar-width": "18.25rem" } as CSSProperties}><BuilderSidebarAutoClose />+ <ArtifactsPanelNavCollapse /><AppSidebar /><SidebarInset className="bg-[#f9f9f9]"><headerdiff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useArtifactsPanelNavCollapse.test.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useArtifactsPanelNavCollapse.test.tsnew file mode 100644index 0000000000..4ac3a795cd--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useArtifactsPanelNavCollapse.test.ts@@ -0,0 +1,115 @@+import { renderHook } from "@testing-library/react";+import { beforeEach, describe, expect, it, vi } from "vitest";++import { useArtifactsPanelNavCollapse } from "../components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse";+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";++const mockUsePathname = vi.fn<() => string | null>();+const mockSetOpen = vi.fn<(open: boolean) => void>();+let sidebarOpen = true;++vi.mock("next/navigation", () => ({+ usePathname: () => mockUsePathname(),+}));++vi.mock("@/components/ui/sidebar", () => ({+ useSidebar: () => ({ open: sidebarOpen, setOpen: mockSetOpen }),+}));++/** The docked panel — an open artifact preview, or the artifacts tab. */+function setPanelOpen(isOpen: boolean) {+ useCopilotUIStore.setState((s) => ({+ artifactPanel: {+ ...s.artifactPanel,+ isOpen,+ activeTab: isOpen ? "artifacts" : s.artifactPanel.activeTab,+ activeArtifact: null,+ },+ }));+}++function renderAt(pathname: string) {+ mockUsePathname.mockReturnValue(pathname);+ return renderHook(() => useArtifactsPanelNavCollapse());+}++beforeEach(() => {+ mockUsePathname.mockReset();+ mockSetOpen.mockReset();+ sidebarOpen = true;+ setPanelOpen(false);+});++describe("useArtifactsPanelNavCollapse", () => {+ it("collapses the nav when the artifacts panel opens", () => {+ const { rerender } = renderAt("/copilot");+ expect(mockSetOpen).not.toHaveBeenCalled();++ setPanelOpen(true);+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(false);+ });++ it("restores the nav when the panel closes", () => {+ const { rerender } = renderAt("/copilot");+ setPanelOpen(true);+ rerender();+ sidebarOpen = false;++ mockSetOpen.mockClear();+ setPanelOpen(false);+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(true);+ });++ it("leaves a nav that was already collapsed before the panel opened", () => {+ sidebarOpen = false;+ const { rerender } = renderAt("/copilot");+ setPanelOpen(true);+ rerender();++ mockSetOpen.mockClear();+ setPanelOpen(false);+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(false);+ });++ it("keeps a nav the user re-opened by hand while the panel was up", () => {+ // Starts collapsed, so the pre-panel state to restore is "closed" — the+ // case where a blind restore visibly snaps the nav shut on the user.+ sidebarOpen = false;+ const { rerender } = renderAt("/copilot");+ setPanelOpen(true);+ rerender();++ sidebarOpen = true;+ mockSetOpen.mockClear();+ setPanelOpen(false);+ rerender();++ expect(mockSetOpen).not.toHaveBeenCalled();+ });++ it("restores the nav when leaving /copilot with the panel still open", () => {+ const { rerender } = renderAt("/copilot");+ setPanelOpen(true);+ rerender();+ sidebarOpen = false;++ mockSetOpen.mockClear();+ mockUsePathname.mockReturnValue("/library");+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(true);+ });++ it("ignores an artifacts panel left open on another route", () => {+ setPanelOpen(true);+ renderAt("/library");++ expect(mockSetOpen).not.toHaveBeenCalled();+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/ArtifactsPanelNavCollapse.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/ArtifactsPanelNavCollapse.tsxnew file mode 100644index 0000000000..176d047036--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/ArtifactsPanelNavCollapse.tsx@@ -0,0 +1,12 @@+"use client";++import { useArtifactsPanelNavCollapse } from "./useArtifactsPanelNavCollapse";++// The artifacts panel needs the horizontal room, so opening it collapses the+// left navigation; closing it restores whatever state the nav had before the+// panel opened — expanded stays expanded, collapsed stays collapsed.+export function ArtifactsPanelNavCollapse() {+ useArtifactsPanelNavCollapse();++ return null;+}diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.tsnew file mode 100644index 0000000000..c1d6783a0f--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.ts@@ -0,0 +1,47 @@+import { useCopilotUIStore } from "@/app/(platform)/copilot/store";+import { useSidebar } from "@/components/ui/sidebar";+import { matchesRoute } from "@/lib/utils";+import { usePathname } from "next/navigation";+import { useEffect, useRef } from "react";++export function useArtifactsPanelNavCollapse() {+ const pathname = usePathname();+ const { open, setOpen } = useSidebar();+ const isCopilotRoute = matchesRoute(pathname, "/copilot");+ // The docked right panel: an open artifact preview or the artifacts tab.+ // The floating files card doesn't count — it overlays the chat column+ // without narrowing it. Leaving /copilot counts as closing, so the nav+ // comes back when the user navigates away with the panel still open.+ const isPanelOpen = useCopilotUIStore(+ (s) =>+ s.artifactPanel.activeArtifact != null ||+ (s.artifactPanel.isOpen && s.artifactPanel.activeTab === "artifacts"),+ );+ const collapsesNav = isCopilotRoute && isPanelOpen;++ const openBeforePanelRef = useRef<boolean | null>(null);+ const openRef = useRef(open);+ openRef.current = open;+ // setOpen's identity changes with `open`, so the effect must only act on+ // panel-open transitions — otherwise a manual re-open of the nav while the+ // panel is up would snap it shut again.+ const wasCollapsedRef = useRef(false);++ useEffect(() => {+ if (collapsesNav === wasCollapsedRef.current) return;+ wasCollapsedRef.current = collapsesNav;++ if (collapsesNav) {+ openBeforePanelRef.current = openRef.current;+ setOpen(false);+ return;+ }+ // Restore only what this hook collapsed. If the user re-opened the nav+ // by hand while the panel was up, that is a deliberate choice and closing+ // it again on panel-close would undo it in front of them.+ if (openBeforePanelRef.current !== null && openRef.current === false) {+ setOpen(openBeforePanelRef.current);+ }+ openBeforePanelRef.current = null;+ }, [collapsesNav, setOpen]);+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsxindex 1bede44bd6..71968f8649 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx@@ -165,15 +165,12 @@ function MainArea({onDroppedFilesConsumed={() => setDroppedFiles([])}hasFloatingControls={showNewLayout}/>- {/* Mounted on mobile too: it owns the session-entry reset that- forgets the previous chat's artifact, and the chat column's- artifacts button is mounted on every viewport. Only the- auto-opening is desktop-only. */}+ {/* Owns the session-entry reset that forgets the previous chat's+ artifact. */}{isArtifactsEnabled && (<ContextPanelAutoOpenkey={`context-auto-open-${sessionId ?? "new"}`}sessionId={sessionId}- canAutoOpen={!isMobile}/>)}</FileDropZone>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-integrations.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-integrations.test.tsxindex bf14662287..1ab9221bbd 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-integrations.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-integrations.test.tsx@@ -39,11 +39,7 @@ function credential(provider: string): ExpertCredentialRef {function renderHeader() {return render(- <ThreadHeader- expertIdentity={mariaIdentity}- readOnly={false}- areFilesOpen={false}- />,+ <ThreadHeader expertIdentity={mariaIdentity} readOnly={false} />,);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsxindex 2f57e41e71..25d092e99b 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx@@ -644,24 +644,15 @@ describe("ChatMessagesContainer — expert identity", () => {expect(screen.queryByTestId("expert-assistant-identity")).toBeNull();});- it("shows a scheduled-workflows button that opens the schedules drawer", async () => {+ it("opens the session activity card when the chip is clicked", async () => {+ flagState.values["artifacts"] = true;server.use(getGetExpertMockHandler(mariaExpert),- getGetV1ListExecutionSchedulesForAUserMockHandler([- {- id: "sched-1",- name: "Content Calendar",- agent_name: "Content Calendar",- user_id: "user-1",- graph_id: "graph-1",- graph_version: 1,- cron: "40 7 * * *",- input_data: {},- next_run_time: new Date(Date.now() + 60 * 60 * 1000).toISOString(),- expert_id: "expert-maria",- },- ]),+ getGetV1ListExecutionSchedulesForAUserMockHandler([]),);+ useCopilotUIStore.setState((s) => ({+ artifactPanel: { ...s.artifactPanel, isOpen: false, activeTab: "files" },+ }));render(<ChatMessagesContainermessages={[assistantMessage]}@@ -669,48 +660,48 @@ describe("ChatMessagesContainer — expert identity", () => {error={undefined}isLoading={false}expertIdentity={mariaIdentity}+ sessionID="session-1"+ canOpenActivity/>,);- const button = await screen.findByTestId("expert-schedules-button");- expect(button.textContent).toContain("1 workflow scheduled");+ await userEvent.click(+ screen.getByRole("button", { name: /Open session activity/ }),+ );- fireEvent.click(button);- expect(- await screen.findByText("Maria's scheduled workflows"),- ).toBeDefined();- expect(await screen.findByTestId("schedule-row")).toBeDefined();+ const panel = useCopilotUIStore.getState().artifactPanel;+ expect(panel.isOpen).toBe(true);+ expect(panel.activeTab).toBe("files");});- it("does not read the fired expert's detail record for the schedules button", async () => {- let expertDetailRequests = 0;+ it("stays a passive label in hosts that never mount the activity card", async () => {+ flagState.values["artifacts"] = true;+ let workspaceFileRequests = 0;server.use(- http.get("*/api/experts/expert-maria", () => {- expertDetailRequests += 1;- return HttpResponse.json(- { detail: "Expert not found" },- { status: 404 },- );+ getGetExpertMockHandler(mariaExpert),+ http.get("*/api/workspace/files", () => {+ workspaceFileRequests += 1;+ return HttpResponse.json({ files: [], offset: 0, has_more: false });}),- getGetV1ListExecutionSchedulesForAUserMockHandler([]),);+ // Same live sessionId the builder and memory panels pass — only the host's+ // canOpenActivity separates them from the copilot chat.render(<ChatMessagesContainermessages={[assistantMessage]}status="ready"error={undefined}isLoading={false}- expertIdentity={{- ...mariaIdentity,- isArchived: true,- readOnlyReason: "fired",- }}+ expertIdentity={mariaIdentity}+ sessionID="session-1"/>,);- expect(await screen.findByTestId("expert-thread-header")).toBeDefined();- expect(screen.queryByTestId("expert-schedules-button")).toBeNull();- expect(expertDetailRequests).toBe(0);+ const header = await screen.findByTestId("expert-thread-header");+ expect(+ within(header).queryByRole("button", { name: /Open session activity/ }),+ ).toBeNull();+ expect(workspaceFileRequests).toBe(0);});it("wears the Autopilot identity on plain sessions", () => {@@ -725,9 +716,31 @@ describe("ChatMessagesContainer — expert identity", () => {const header = screen.getByTestId("expert-thread-header");expect(header.textContent).toContain("Autopilot");- expect(screen.queryByTestId("expert-schedules-button")).toBeNull();expect(screen.queryByTestId("expert-assistant-identity")).toBeNull();});++ it("keeps the passive chip keyboard-reachable, since the role only exists in its tooltip", () => {+ server.use(+ getGetExpertMockHandler(mariaExpert),+ getGetV1ListExecutionSchedulesForAUserMockHandler([]),+ );+ render(+ <ChatMessagesContainer+ messages={[assistantMessage]}+ status="ready"+ error={undefined}+ isLoading={false}+ expertIdentity={mariaIdentity}+ />,+ );++ const header = screen.getByTestId("expert-thread-header");+ const chip = within(header).getByLabelText("Maria — Marketing Strategist");++ // A tooltip opens on focus as well as hover; an unfocusable trigger+ // hides the role from keyboard users entirely.+ expect(chip.getAttribute("tabindex")).toBe("0");+ });});function RecipientPickerHarness() {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/ChatContainer.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/ChatContainer.tsxindex 562c9bb28b..6a7804c8bc 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/ChatContainer.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/ChatContainer.tsx@@ -281,6 +281,7 @@ export const ChatContainer = ({bottomContentPadding={usageCardHeight}expertIdentity={expertIdentity}hasFloatingControls={hasFloatingControls}+ canOpenActivity={isArtifactsEnabled}areFilesOpen={areFilesOpen}/>{archivedExpertIdentity ? (diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsxindex 10352717c2..4654feca32 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx@@ -1,14 +1,11 @@import {- PromptInputBody,PromptInputButton,- PromptInputFooter,PromptInputSubmit,PromptInputTextarea,- PromptInputTools,} from "@/components/ai-elements/prompt-input";import { isGuidedPrompt } from "@/components/contextual/guidedPrompts";import { toast } from "@/components/molecules/Toast/use-toast";-import { InputGroup } from "@/components/ui/input-group";+import { InputGroup, InputGroupAddon } from "@/components/ui/input-group";import {Tooltip,TooltipContent,@@ -32,7 +29,6 @@ import {workspaceItemToAttachment,} from "../../helpers/workspaceAttachments";import { ComposerPlusMenu } from "./components/ComposerPlusMenu";-import { ComposerTray } from "./components/ComposerTray";import { DryRunToggleButton } from "./components/DryRunToggleButton";import { FileChips } from "./components/FileChips";import { MentionDropdown } from "./components/MentionDropdown";@@ -113,6 +109,7 @@ export function ChatInput({const showWorkspaceFiles = useGetFlag(Flag.CHAT_WORKSPACE_FILES);const [attachments, setAttachments] = useState<Attachment[]>([]);const [isPickerOpen, setIsPickerOpen] = useState(false);+ const [isMultiline, setIsMultiline] = useState(false);function handleToggleMode() {if (copilotModePinned) {@@ -242,11 +239,6 @@ export function ChatInput({isTranscribing,});- // The composer restyle (flat card, chips relocated into the tray- // below) ships with the brain-dump experience; off keeps the original- // glowing composer with pill toggles in the footer.- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);-function handleChange(e: ChangeEvent<HTMLTextAreaElement>) {if (isRecording) return;baseHandleChange(e);@@ -272,12 +264,8 @@ export function ChatInput({? "Transcribing...": placeholder;- // Narrows to string, so neither render site needs to re-test sessionId.+ // Narrows to string, so the render site needn't re-test sessionId.const devtoolSessionId = isTokenDevtoolEnabled() ? sessionId : null;- const hasTrayItems =- (showModeToggle && !isStreaming) ||- (showDryRunToggle && !hasSession) ||- Boolean(devtoolSessionId);const canSend =!disabled &&@@ -328,18 +316,14 @@ export function ChatInput({onHighlight={mentions.setHighlightedIndex}/>)}+ {/* GPT-style composer: a single pill row — plus on the left, textarea+ in the middle, quiet toggles + mic + send on the right. items-end+ keeps the controls pinned to the bottom edge as the textarea grows. */}<InputGroupclassName={cn(- isBrainDumpEnabled- ? "relative z-10 overflow-hidden border-neutral-200 shadow-none has-[[data-slot=input-group-control]:focus-visible]:border-neutral-200 has-[[data-slot=input-group-control]:focus-visible]:ring-0"- : [- "overflow-hidden border-zinc-200 has-[[data-slot=input-group-control]:focus-visible]:border-neutral-200 has-[[data-slot=input-group-control]:focus-visible]:ring-0",- "shadow-[0_2px_8px_rgba(0,0,0,0.04),0_0_32px_-4px_rgba(99,102,241,0.4)] transition-shadow has-[[data-slot=input-group-control]:focus-visible]:shadow-[0_2px_8px_rgba(0,0,0,0.04),0_0_36px_-4px_rgba(99,102,241,0.45)]",- ],+ "relative z-10 flex-col overflow-hidden !rounded-[1.75rem] border-zinc-200 shadow-[0_1px_2px_rgba(0,0,0,0.04),0_4px_20px_rgba(0,0,0,0.08)] has-[[data-slot=input-group-control]:focus-visible]:border-zinc-300 has-[[data-slot=input-group-control]:focus-visible]:ring-0",isRecording &&- (isBrainDumpEnabled- ? "border-red-400 ring-1 ring-red-400 has-[[data-slot=input-group-control]:focus-visible]:border-red-400 has-[[data-slot=input-group-control]:focus-visible]:ring-red-400"- : "border-red-400 shadow-[0_2px_8px_rgba(0,0,0,0.04),0_0_32px_-4px_rgba(248,113,113,0.45)] ring-1 ring-red-400 has-[[data-slot=input-group-control]:focus-visible]:border-red-400 has-[[data-slot=input-group-control]:focus-visible]:shadow-[0_2px_8px_rgba(0,0,0,0.04),0_0_32px_-4px_rgba(248,113,113,0.45)] has-[[data-slot=input-group-control]:focus-visible]:ring-red-400"),+ "border-red-400 ring-1 ring-red-400 has-[[data-slot=input-group-control]:focus-visible]:border-red-400 has-[[data-slot=input-group-control]:focus-visible]:ring-red-400",)}><FileChips@@ -347,34 +331,11 @@ export function ChatInput({onRemove={handleRemoveAttachment}isUploading={isUploadingFiles}/>- <PromptInputBody className="relative block w-full">- <PromptInputTextarea- id={inputId}- aria-label="Chat message input"- value={value}- onChange={handleChange}- onKeyDown={handleKeyDown}- onPaste={handlePaste}- onBlur={mentions.close}- disabled={isInputDisabled}- placeholder={resolvedPlaceholder}- />- {isRecording && !value && (- <div className="pointer-events-none absolute inset-0 flex items-center justify-center">- <RecordingIndicator- elapsedTime={elapsedTime}- audioStream={audioStream}- />- </div>- )}- </PromptInputBody>-- <span id={`${inputId}-hint`} className="sr-only">- Press Enter to send, Shift+Enter for new line, Space to record voice- </span>-- <PromptInputFooter>- <PromptInputTools>+ <div className="flex w-full flex-wrap items-end">+ <InputGroupAddon+ align="inline-start"+ className="order-none gap-1 py-1 pl-1.5"+ ><ComposerPlusMenuonFilesSelected={handleFilesSelected}onUseWorkspaceFile={() => setIsPickerOpen(true)}@@ -383,39 +344,62 @@ export function ChatInput({/>{recipientPicker}{!hasSession && <LLMRouteSelector />}- {!isBrainDumpEnabled && showModeToggle && !isStreaming && (+ </InputGroupAddon>+ {/* Must be a real flex item: `order`/`w-full` are ignored on a+ `display: contents` box, which is what PromptInputBody was. */}+ <div+ className={cn(+ "relative",+ isMultiline ? "order-first w-full" : "min-w-0 flex-1",+ )}+ >+ <PromptInputTextarea+ id={inputId}+ aria-label="Chat message input"+ value={value}+ onChange={handleChange}+ onKeyDown={handleKeyDown}+ onPaste={handlePaste}+ onBlur={mentions.close}+ disabled={isInputDisabled}+ placeholder={resolvedPlaceholder}+ onMultilineChange={setIsMultiline}+ />+ {isRecording && !value && (+ <div className="pointer-events-none absolute inset-0 flex items-center justify-center">+ <RecordingIndicator+ elapsedTime={elapsedTime}+ audioStream={audioStream}+ />+ </div>+ )}+ </div>+ <InputGroupAddon+ align="inline-end"+ className="order-none ml-auto gap-1 py-1 pr-1.5"+ >+ {showModeToggle && !isStreaming && (<><ModeToggleButton- variant="pill"mode={copilotChatMode}onToggle={handleToggleMode}pinned={copilotModePinned}/><ModelToggleButton- variant="pill"model={copilotLlmModel}onToggle={handleToggleModel}/></>)}- {!isBrainDumpEnabled && showDryRunToggle && !hasSession && (+ {showDryRunToggle && !hasSession && (<DryRunToggleButton- variant="pill"isDryRun={isDryRun}onToggle={handleToggleDryRun}/>)}- {/* ComposerTray renders only under the brain-dump flag, so the- badge is duplicated here to stay reachable in both layouts. */}- {!isBrainDumpEnabled && devtoolSessionId && (- <TokenDevtoolBadge- sessionId={devtoolSessionId}- className="ml-auto"- />+ {devtoolSessionId && (+ <TokenDevtoolBadge sessionId={devtoolSessionId} />)}- </PromptInputTools>-- <div className="flex items-center gap-4">{showMicButton && (<RecordingButtonisRecording={isRecording}@@ -463,45 +447,13 @@ export function ChatInput({) : hideSubmitWhenEmpty && !canSend ? null : (<PromptInputSubmit disabled={!canSend} />)}- </div>- </PromptInputFooter>- </InputGroup>+ </InputGroupAddon>+ </div>- {/* Mode and model are per-message settings sent with each stream request,- so they can be freely changed between turns in an existing session.- Hide only while actively streaming (too late to change for that turn).- DryRun is new-chat only: once a session exists its dry_run flag is- locked and read from session metadata (sessionDryRun in useCopilotPage),- with the banner in CopilotPage.tsx reflecting the actual state. */}- {Boolean(isBrainDumpEnabled) && hasTrayItems && (- <ComposerTray>- {showModeToggle && !isStreaming && (- <>- <ModeToggleButton- mode={copilotChatMode}- onToggle={handleToggleMode}- pinned={copilotModePinned}- />- <ModelToggleButton- model={copilotLlmModel}- onToggle={handleToggleModel}- />- </>- )}- {showDryRunToggle && !hasSession && (- <DryRunToggleButton- isDryRun={isDryRun}- onToggle={handleToggleDryRun}- />- )}- {devtoolSessionId && (- <TokenDevtoolBadge- sessionId={devtoolSessionId}- className="ml-auto"- />- )}- </ComposerTray>- )}+ <span id={`${inputId}-hint`} className="sr-only">+ Press Enter to send, Shift+Enter for new line, Space to record voice+ </span>+ </InputGroup>{showWorkspaceFiles && (<WorkspaceFilePickerdiff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsxindex c190cbb71f..e65eac4fb5 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/ChatInput.test.tsx@@ -117,12 +117,6 @@ vi.mock("../useVoiceRecording", () => ({}));vi.mock("@/components/ai-elements/prompt-input", () => ({- PromptInputBody: ({ children }: { children: React.ReactNode }) => (- <div>{children}</div>- ),- PromptInputFooter: ({ children }: { children: React.ReactNode }) => (- <div>{children}</div>- ),PromptInputSubmit: ({disabled,status,@@ -166,9 +160,6 @@ vi.mock("@/components/ai-elements/prompt-input", () => ({/>);},- PromptInputTools: ({ children }: { children: React.ReactNode }) => (- <div data-testid="tools">{children}</div>- ),PromptInputButton: ({children,onClick,@@ -184,15 +175,9 @@ vi.mock("@/components/ai-elements/prompt-input", () => ({),}));-vi.mock("@/components/ui/input-group", () => ({- InputGroup: ({- children,- className,- }: {- children: React.ReactNode;- className?: string;- }) => <div className={className}>{children}</div>,-}));+// InputGroup/InputGroupAddon render as-is: they are plain presentational+// wrappers, and stubbing them hid the addon contract (role, data-align,+// click-to-focus) that the composer relies on.vi.mock("../components/ComposerPlusMenu", () => ({ComposerPlusMenu: ({@@ -265,6 +250,34 @@ afterEach(() => {mockInitialPrompt = null;});+describe("ChatInput composer row", () => {+ it("keeps the leading and trailing addons on their declared sides", () => {+ render(<ChatInput onSend={mockOnSend} sessionId="session-1" />);++ const aligns = Array.from(+ document.querySelectorAll("[data-slot=input-group-addon]"),+ ).map((addon) => addon.getAttribute("data-align"));++ expect(aligns).toEqual(["inline-start", "inline-end"]);+ });++ it("focuses the message box when the addon gutter is clicked", () => {+ render(<ChatInput onSend={mockOnSend} sessionId="session-1" />);++ // The composer autofocuses on mount, so blur first — otherwise the+ // assertion below would pass without the addon doing anything.+ const textarea = screen.getByTestId("textarea") as HTMLTextAreaElement;+ textarea.blur();+ expect(document.activeElement).not.toBe(textarea);++ fireEvent.click(+ document.querySelector("[data-slot=input-group-addon]") as Element,+ );++ expect(document.activeElement).toBe(textarea);+ });+});+describe("ChatInput token devtool badge", () => {it("renders the badge while the brain-dump tray is disabled", () => {// The tray is brain-dump-only; the badge must not depend on that flag.@@ -358,18 +371,22 @@ describe("ChatInput mode toggle", () => {expect(screen.queryByLabelText(/AI connection:/i)).toBeNull();});- it("shows Thinking label in extended_thinking mode", () => {+ // The toggles are icon-only in the composer row, so the mode reaches+ // assistive tech through the label rather than visible text.+ it("names the switch out of extended_thinking mode", () => {mockFlagValue = true;mockCopilotMode = "extended_thinking";render(<ChatInput onSend={mockOnSend} />);- expect(screen.getByText("Thinking")).toBeDefined();+ expect(screen.getByLabelText("Switch to Fast mode")).toBeDefined();});- it("shows Fast label in fast mode", () => {+ it("names the switch out of fast mode", () => {mockFlagValue = true;mockCopilotMode = "fast";render(<ChatInput onSend={mockOnSend} />);- expect(screen.getByText("Fast")).toBeDefined();+ expect(+ screen.getByLabelText("Switch to Extended Thinking mode"),+ ).toBeDefined();});it("keeps the mode locked while pinned (building mode)", () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsxindex 10663c560b..161e5926e2 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerPlusMenu.tsx@@ -60,7 +60,7 @@ export function ComposerPlusMenu({data-testid="composer-plus-button"disabled={disabled}className={cn(- "border-neutral-200 bg-white text-zinc-500 shadow-sm hover:border-neutral-200 hover:bg-neutral-50 hover:text-zinc-700",+ "border-transparent bg-transparent text-black shadow-none hover:border-transparent hover:bg-zinc-100 hover:text-black",disabled && "opacity-40",)}>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerTray.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerTray.tsxdeleted file mode 100644index 52f7a7c865..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerTray.tsx+++ /dev/null@@ -1,18 +0,0 @@-"use client";--import type { ReactNode } from "react";--interface Props {- children: ReactNode;-}--// Secondary row tucked under the composer card (Claude-style): the card-// overlaps its top edge, so the tray only peeks out below. Rounded on its-// own bottom edge so it also reads correctly outside a clipping wrapper.-export function ComposerTray({ children }: Props) {- return (- <div className="-mt-5 flex items-center gap-2 rounded-b-xlarge bg-[#EFEFF0] px-3 pb-1.5 pt-[1.625rem]">- {children}- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/DryRunToggleButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/DryRunToggleButton.tsxindex b711c60260..ed99a8e994 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/DryRunToggleButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/DryRunToggleButton.tsx@@ -6,7 +6,6 @@ import {TooltipTrigger,} from "@/components/ui/tooltip";import { Icon } from "@/components/atoms/Icon/Icon";-import { ToggleChip } from "@/components/atoms/ToggleChip/ToggleChip";import { cn } from "@/lib/utils";import { FlaskConicalIcon } from "@hugeicons/core-free-icons";@@ -17,54 +16,33 @@ import { FlaskConicalIcon } from "@hugeicons/core-free-icons";interface Props {isDryRun: boolean;onToggle: () => void;- /** "pill" is the pre-brain-dump footer style; "chip" lives in the tray. */- variant?: "chip" | "pill";}-export function DryRunToggleButton({- isDryRun,- onToggle,- variant = "chip",-}: Props) {+export function DryRunToggleButton({ isDryRun, onToggle }: Props) {const tooltip = isDryRun? "Test mode on — new sessions run without performing real actions (click to turn off).": "Turn on test mode to try prompts without performing real actions.";const ariaLabel = isDryRun ? "Test mode active" : "Enable Test mode";- if (variant === "pill") {- return (- <Tooltip>- <TooltipTrigger asChild>- <button- type="button"- aria-pressed={isDryRun}- onClick={onToggle}- className={cn(- "inline-flex h-9 items-center justify-center gap-1 rounded-full border border-neutral-200 bg-white px-2.5 text-xs font-medium shadow-sm transition-colors hover:bg-neutral-50",- isDryRun ? "text-amber-900" : "text-zinc-950 hover:text-zinc-950",- )}- aria-label={ariaLabel}- >- <Icon icon={FlaskConicalIcon} size={14} />- <span className="hidden sm:inline">- {isDryRun ? "Test mode enabled" : "Enable test mode"}- </span>- </button>- </TooltipTrigger>- <TooltipContent>{tooltip}</TooltipContent>- </Tooltip>- );- }-return (- <ToggleChip- icon={<Icon icon={FlaskConicalIcon} size={14} />}- label={isDryRun ? "Test mode enabled" : "Enable test mode"}- tooltip={tooltip}- ariaLabel={ariaLabel}- pressed={isDryRun}- onToggle={onToggle}- className="sm:min-w-[9.5rem]"- />+ <Tooltip>+ <TooltipTrigger asChild>+ <button+ type="button"+ aria-pressed={isDryRun}+ onClick={onToggle}+ className={cn(+ "inline-flex h-8 w-8 items-center justify-center rounded-full transition-colors hover:bg-zinc-100",+ isDryRun+ ? "text-amber-600 hover:text-amber-700"+ : "text-zinc-500 hover:text-zinc-700",+ )}+ aria-label={ariaLabel}+ >+ <Icon icon={FlaskConicalIcon} size={16} />+ </button>+ </TooltipTrigger>+ <TooltipContent>{tooltip}</TooltipContent>+ </Tooltip>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsxindex 8481227b24..f27e77f939 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx@@ -6,7 +6,6 @@ import {TooltipTrigger,} from "@/components/ui/tooltip";import { Icon } from "@/components/atoms/Icon/Icon";-import { ToggleChip } from "@/components/atoms/ToggleChip/ToggleChip";import { cn } from "@/lib/utils";import { BrainIcon, FlashIcon, LockIcon } from "@hugeicons/core-free-icons";import type { CopilotMode } from "../../../store";@@ -16,16 +15,9 @@ interface Props {onToggle: () => void;/** When true the mode is locked to Extended Thinking (agent build flow). */pinned?: boolean;- /** "pill" is the pre-brain-dump footer style; "chip" lives in the tray. */- variant?: "chip" | "pill";}-export function ModeToggleButton({- mode,- onToggle,- pinned = false,- variant = "chip",-}: Props) {+export function ModeToggleButton({ mode, onToggle, pinned = false }: Props) {const isExtended = mode === "extended_thinking";const tooltipText = pinned? "Extended Thinking is required while building an agent"@@ -39,50 +31,35 @@ export function ModeToggleButton({? "Switch to Fast mode": "Switch to Extended Thinking mode";+ // The glyph carries the state on its own — a brain, a lightning bolt, or a+ // padlock — so the button stays readable without a text label.function getIcon() {- if (pinned) return <Icon icon={LockIcon} size={14} />;+ if (pinned) return <Icon icon={LockIcon} size={16} />;return isExtended ? (- <Icon icon={BrainIcon} size={14} />+ <Icon icon={BrainIcon} size={16} />) : (- <Icon icon={FlashIcon} size={14} />- );- }-- if (variant === "pill") {- return (- <Tooltip>- <TooltipTrigger asChild>- <button- type="button"- aria-pressed={isExtended}- aria-disabled={pinned}- onClick={onToggle}- className={cn(- "ml-2 inline-flex h-9 min-w-[6rem] items-center justify-center gap-1 rounded-full border border-neutral-200 bg-white px-2.5 text-xs font-medium shadow-sm transition-colors hover:bg-neutral-50",- isExtended ? "text-purple-500" : "text-orange-600",- pinned && "cursor-not-allowed opacity-70 hover:bg-white",- )}- aria-label={ariaLabel}- >- {getIcon()}- {pinned || isExtended ? "Thinking" : "Fast"}- </button>- </TooltipTrigger>- <TooltipContent>{tooltipText}</TooltipContent>- </Tooltip>+ <Icon icon={FlashIcon} size={16} />);}return (- <ToggleChip- icon={getIcon()}- label={pinned || isExtended ? "Thinking" : "Fast"}- tooltip={tooltipText}- ariaLabel={ariaLabel}- pressed={isExtended}- onToggle={onToggle}- locked={pinned}- className="sm:min-w-[5.5rem]"- />+ <Tooltip>+ <TooltipTrigger asChild>+ <button+ type="button"+ aria-pressed={isExtended}+ aria-disabled={pinned}+ onClick={onToggle}+ className={cn(+ "inline-flex h-8 w-8 items-center justify-center rounded-full text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700",+ pinned && "cursor-not-allowed opacity-70 hover:bg-transparent",+ )}+ aria-label={ariaLabel}+ >+ {getIcon()}+ </button>+ </TooltipTrigger>+ <TooltipContent>{tooltipText}</TooltipContent>+ </Tooltip>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsxindex 36c18b0f5f..6283081b22 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx@@ -6,7 +6,6 @@ import {TooltipTrigger,} from "@/components/ui/tooltip";import { Icon } from "@/components/atoms/Icon/Icon";-import { ToggleChip } from "@/components/atoms/ToggleChip/ToggleChip";import { cn } from "@/lib/utils";import { CpuIcon } from "@hugeicons/core-free-icons";import type { CopilotLlmModel } from "../../../store";@@ -14,15 +13,9 @@ import type { CopilotLlmModel } from "../../../store";interface Props {model: CopilotLlmModel;onToggle: () => void;- /** "pill" is the pre-brain-dump footer style; "chip" lives in the tray. */- variant?: "chip" | "pill";}-export function ModelToggleButton({- model,- onToggle,- variant = "chip",-}: Props) {+export function ModelToggleButton({ model, onToggle }: Props) {const isAdvanced = model === "advanced";const tooltip = isAdvanced? "Using the highest-capability model (click to switch to Balanced)."@@ -31,42 +24,27 @@ export function ModelToggleButton({? "Switch to Balanced model": "Switch to Advanced model";- if (variant === "pill") {- return (- <Tooltip>- <TooltipTrigger asChild>- <button- type="button"- aria-pressed={isAdvanced}- onClick={onToggle}- className={cn(- "inline-flex h-9 items-center justify-center gap-1 rounded-full border border-neutral-200 bg-white px-2.5 text-xs font-medium shadow-sm transition-colors hover:bg-neutral-50",- isAdvanced- ? "text-emerald-500"- : "text-sky-600 hover:text-sky-700",- )}- aria-label={ariaLabel}- >- <Icon icon={CpuIcon} size={14} />- <span className="hidden sm:inline">- {isAdvanced ? "Advanced" : "Balanced"}- </span>- </button>- </TooltipTrigger>- <TooltipContent>{tooltip}</TooltipContent>- </Tooltip>- );- }-return (- <ToggleChip- icon={<Icon icon={CpuIcon} size={14} />}- label={isAdvanced ? "Advanced" : "Balanced"}- tooltip={tooltip}- ariaLabel={ariaLabel}- pressed={isAdvanced}- onToggle={onToggle}- className="sm:min-w-[5.75rem]"- />+ <Tooltip>+ <TooltipTrigger asChild>+ <button+ type="button"+ aria-pressed={isAdvanced}+ onClick={onToggle}+ className={cn(+ "inline-flex h-8 w-8 items-center justify-center rounded-full transition-colors hover:bg-zinc-100",+ // Model tier drives cost and quality, and a tooltip never opens on+ // touch — so the raised tier has to be visible on the icon itself.+ isAdvanced+ ? "text-emerald-600 hover:text-emerald-700"+ : "text-zinc-500 hover:text-zinc-700",+ )}+ aria-label={ariaLabel}+ >+ <Icon icon={CpuIcon} size={16} />+ </button>+ </TooltipTrigger>+ <TooltipContent>{tooltip}</TooltipContent>+ </Tooltip>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/RecordingButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/RecordingButton.tsxindex f3873ce774..c86ec1418a 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/RecordingButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/RecordingButton.tsx@@ -34,7 +34,7 @@ export function RecordingButton({disabled={disabled}onClick={onClick}className={cn(- "border-neutral-200 bg-white text-zinc-500 shadow-sm hover:border-neutral-200 hover:bg-neutral-50 hover:text-zinc-700",+ "border-transparent bg-transparent text-black shadow-none hover:border-transparent hover:bg-zinc-100 hover:text-black",disabled && "opacity-40",isRecording && "animate-pulse bg-red-500 text-white hover:bg-red-600",isTranscribing && "bg-zinc-100 text-zinc-400",diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/DryRunToggleButton.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/DryRunToggleButton.test.tsxindex f48f8a40c8..2e524e8af1 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/DryRunToggleButton.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/DryRunToggleButton.test.tsx@@ -19,14 +19,26 @@ function render(ui: ReactElement) {// It has no readOnly/isStreaming props — those scenarios are handled by hiding// the button entirely at the ChatInput level when hasSession is true.describe("DryRunToggleButton", () => {- it("shows enabled label when isDryRun is true", () => {+ // The button is icon-only in the composer row, so its state has to reach+ // assistive tech through the label and show on the glyph itself — a tooltip+ // never opens on touch.+ it("names the active state for assistive tech when isDryRun is true", () => {render(<DryRunToggleButton isDryRun={true} onToggle={vi.fn()} />);- expect(screen.getByText("Test mode enabled")).toBeTruthy();+ expect(screen.getByLabelText("Test mode active")).toBeTruthy();});- it("shows enable label when isDryRun is false", () => {+ it("names the idle state for assistive tech when isDryRun is false", () => {render(<DryRunToggleButton isDryRun={false} onToggle={vi.fn()} />);- expect(screen.getByText("Enable test mode")).toBeTruthy();+ expect(screen.getByLabelText("Enable Test mode")).toBeTruthy();+ });++ it("tints the glyph so the active state is visible without a tooltip", () => {+ render(<DryRunToggleButton isDryRun={true} onToggle={vi.fn()} />);+ const active = screen.getByRole("button").className;+ cleanup();++ render(<DryRunToggleButton isDryRun={false} onToggle={vi.fn()} />);+ expect(screen.getByRole("button").className).not.toBe(active);});it("calls onToggle when clicked", () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsxindex 6193eb8694..9f4997d0bb 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx@@ -16,15 +16,22 @@ function render(ui: ReactElement) {}describe("ModelToggleButton", () => {- it("shows no text label when model is standard", () => {+ it("carries no text label — the composer row is icon-only", () => {render(<ModelToggleButton model="standard" onToggle={vi.fn()} />);expect(screen.queryByText("Standard")).toBeNull();expect(screen.queryByText("Advanced")).toBeNull();});- it("shows Advanced label when model is advanced", () => {+ // Model tier drives cost and quality, and a tooltip never opens on touch,+ // so the raised tier has to be legible on the glyph itself.+ it("tints the glyph so the advanced tier is visible without a tooltip", () => {render(<ModelToggleButton model="advanced" onToggle={vi.fn()} />);- expect(screen.getByText("Advanced")).toBeTruthy();+ const advanced = screen.getByRole("button").className;+ expect(advanced).toContain("emerald");+ cleanup();++ render(<ModelToggleButton model="standard" onToggle={vi.fn()} />);+ expect(screen.getByRole("button").className).not.toContain("emerald");});it("calls onToggle when clicked", () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsxindex bd33d0e31a..e4369dc1b0 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsx@@ -12,7 +12,6 @@ import {} from "@/components/ai-elements/message";import { Button } from "@/components/atoms/Button/Button";import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { FileUIPart, UIDataTypes, UIMessage, UITools } from "ai";import { useEffect, useLayoutEffect, useRef } from "react";import { useStickToBottomContext } from "use-stick-to-bottom";@@ -99,8 +98,11 @@ interface Props {/** The layout floats its sidebar/files controls over the chat's top-left* corner on small viewports (see ThreadHeader). */hasFloatingControls?: boolean;- /** The host's floating workspace-files card is open, so the header and- * the column slide aside for it. Only the copilot chat mounts that card;+ /** Set by the host that mounts the session activity card, so the thread+ * chip only becomes clickable where that card exists. */+ canOpenActivity?: boolean;+ /** The host's floating workspace-files card is open, so the column+ * slides aside for it. Only the copilot chat mounts that card;* every other host (share viewer, memory and builder panels) leaves this* off, whatever the persisted panel state says. */areFilesOpen?: boolean;@@ -303,14 +305,13 @@ export function ChatMessagesContainer({fileUrlBuilder,expertIdentity,hasFloatingControls = false,+ canOpenActivity = false,areFilesOpen = false,}: Props) {const messages = useMemo(() => revealKickoffMessages(allMessages),[allMessages],);- // Bubble restyle ships with the brain-dump experience.- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);// Hide the container for one frame when messages first load so// StickToBottom can scroll to the bottom before the user sees it.const [settled, setSettled] = useState(false);@@ -463,8 +464,9 @@ export function ChatMessagesContainer({<ThreadHeaderexpertIdentity={expertIdentity}readOnly={readOnly}- areFilesOpen={areFilesOpen}+ sessionId={sessionID}hasFloatingControls={hasFloatingControls}+ canOpenActivity={canOpenActivity}/><ChatMinimap messages={messages} /><Conversation@@ -479,7 +481,7 @@ export function ChatMessagesContainer({><ConversationContentclassName={cn(- "ease-[cubic-bezier(0.32,0.72,0,1)] mx-auto flex min-h-full w-full max-w-3xl flex-1 flex-col gap-6 px-6 py-4 transition-transform duration-300 will-change-transform motion-reduce:transition-none",+ "ease-[cubic-bezier(0.32,0.72,0,1)] mx-auto flex min-h-full w-full max-w-3xl flex-1 flex-col gap-6 px-6 pb-4 pt-14 transition-transform duration-300 will-change-transform motion-reduce:transition-none",areFilesOpen && "xl:-translate-x-40",)}style={@@ -603,9 +605,7 @@ export function ChatMessagesContainer({<MessageContentclassName={"text-[1rem] leading-relaxed " +- (isBrainDumpEnabled- ? "group-[.is-user]:rounded-3xl group-[.is-user]:bg-gradient-to-br group-[.is-user]:from-[#f3edff] group-[.is-user]:to-[#e4d4ff] group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-[#3b1e75] group-[.is-user]:[border-bottom-right-radius:0.5rem] "- : "group-[.is-user]:rounded-xl group-[.is-user]:bg-purple-100 group-[.is-user]:px-3 group-[.is-user]:py-2.5 group-[.is-user]:text-slate-900 group-[.is-user]:[border-bottom-right-radius:0] ") ++ "group-[.is-user]:rounded-3xl group-[.is-user]:bg-zinc-100 group-[.is-user]:px-4 group-[.is-user]:py-2.5 group-[.is-user]:text-zinc-900 " +"group-[.is-user]:[&_h1]:text-lg group-[.is-user]:[&_h1]:font-semibold group-[.is-user]:[&_h2]:text-lg group-[.is-user]:[&_h2]:font-semibold group-[.is-user]:[&_h3]:text-lg group-[.is-user]:[&_h3]:font-semibold group-[.is-user]:[&_h4]:text-lg group-[.is-user]:[&_h4]:font-semibold group-[.is-user]:[&_h5]:text-lg group-[.is-user]:[&_h5]:font-semibold group-[.is-user]:[&_h6]:text-lg group-[.is-user]:[&_h6]:font-semibold " +// Chain hover pills use negative margins that the base// overflow-hidden would clip.@@ -675,7 +675,7 @@ export function ChatMessagesContainer({);})()}{message.role === "user" && textParts.length > 0 && (- <MessageActions className="mt-1 items-center justify-end gap-2">+ <MessageActions className="mt-1 items-center justify-end gap-2 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100">{(() => {const createdAt = turnStats?.get(message.id)?.createdAt;if (!createdAt) return null;@@ -708,10 +708,20 @@ export function ChatMessagesContainer({<AssistantMessageActionsmessage={message}sessionID={sessionID ?? null}+ className={cn(+ !isLastAssistant &&+ "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",+ )}/>)}{readOnly && showActions && (- <MessageActions className="mt-1 items-center justify-start gap-2">+ <MessageActions+ className={cn(+ "mt-1 items-center justify-start gap-2",+ !isLastAssistant &&+ "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",+ )}+ ><CopyButtontext={textParts.map((p) => p.text).join("\n")}/>@@ -761,13 +771,7 @@ export function ChatMessagesContainer({{!readOnly &&queuedMessages?.map((msg, idx) => (<Message key={idx} from="user">- <MessageContent- className={- isBrainDumpEnabled- ? "flex flex-col gap-1 rounded-3xl border border-dashed border-[#b18aff] bg-gradient-to-br from-[#f3edff] to-[#e4d4ff] px-4 py-3 text-[1rem] leading-relaxed text-[#3b1e75] opacity-60 [border-bottom-right-radius:0.5rem]"- : "flex flex-col gap-1 rounded-xl border border-dashed border-purple-400 bg-purple-100 px-3 py-2.5 text-[1rem] leading-relaxed text-slate-900 opacity-60 [border-bottom-right-radius:0]"- }- >+ <MessageContent className="flex flex-col gap-1 rounded-3xl border border-dashed border-zinc-300 bg-zinc-100 px-4 py-2.5 text-[1rem] leading-relaxed text-zinc-900 opacity-60"><span>{msg}</span><span className="flex items-center gap-1 text-xs text-slate-500"><Icon icon={Clock01Icon} className="size-3" />diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/AssistantMessageActions.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/AssistantMessageActions.tsxindex d631b9990e..a82f214300 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/AssistantMessageActions.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/AssistantMessageActions.tsx@@ -19,6 +19,7 @@ import { Icon } from "@/components/atoms/Icon/Icon";interface Props {message: UIMessage<unknown, UIDataTypes, UITools>;sessionID: string | null;+ className?: string;}function extractTextFromParts(@@ -31,7 +32,11 @@ function extractTextFromParts(.trim();}-export function AssistantMessageActions({ message, sessionID }: Props) {+export function AssistantMessageActions({+ message,+ sessionID,+ className,+}: Props) {const {feedback,showFeedbackModal,@@ -46,7 +51,7 @@ export function AssistantMessageActions({ message, sessionID }: Props) {return (<>- <MessageActions className="mt-1">+ <MessageActions className={cn("mt-1", className)}><MessageActiontooltip="Copy"onClick={() => handleCopy(text)}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertAvatar/ExpertAvatar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertAvatar/ExpertAvatar.tsxindex 2751245dd9..8c3841969b 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertAvatar/ExpertAvatar.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertAvatar/ExpertAvatar.tsx@@ -4,28 +4,43 @@ import {AvatarImage,} from "@/components/atoms/Avatar/Avatar";import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";+import { cn } from "@/lib/utils";interface Props {name: string;avatarUrl: string | null;isAutopilot?: boolean;+ size?: "sm" | "md";}-export function ExpertAvatar({ name, avatarUrl, isAutopilot }: Props) {+export function ExpertAvatar({ name, avatarUrl, isAutopilot, size }: Props) {+ const isSmall = size === "sm";+ const sizeClass = isSmall ? "h-6 w-6" : "h-9 w-9";+if (isAutopilot && !avatarUrl) {return (- <span className="flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-b from-white to-zinc-100 shadow-[inset_0_1px_1px_rgba(255,255,255,0.9),inset_0_-2px_4px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-inset ring-zinc-200/70">- <AutoGPTLogo hideText viewBox="47 -1 42 42" className="size-5" />+ <span+ className={cn(+ "flex items-center justify-center rounded-xl bg-gradient-to-b from-white to-zinc-100 shadow-[inset_0_1px_1px_rgba(255,255,255,0.9),inset_0_-2px_4px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-inset ring-zinc-200/70",+ sizeClass,+ isSmall && "rounded-full",+ )}+ >+ <AutoGPTLogo+ hideText+ viewBox="47 -1 42 42"+ className={isSmall ? "size-3.5" : "size-5"}+ /></span>);}return (- <Avatar className="h-9 w-9">+ <Avatar className={sizeClass}>{avatarUrl ? <AvatarImage src={avatarUrl} alt={name} /> : null}{/* The fallback seeds a generated avatar off the name, and also coversan avatar URL that fails to load. */}- <AvatarFallback className="h-9 w-9">{name}</AvatarFallback>+ <AvatarFallback className={sizeClass}>{name}</AvatarFallback></Avatar>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/ExpertSchedulesButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/ExpertSchedulesButton.tsxdeleted file mode 100644index edc3645ec0..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/ExpertSchedulesButton.tsx+++ /dev/null@@ -1,61 +0,0 @@-"use client";--import { EditScheduleModal } from "@/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/EditScheduleModal/EditScheduleModal";-import { Button } from "@/components/atoms/Button/Button";-import { GraphScheduleListItem } from "@/components/contextual/SchedulesPanel/components/GraphScheduleListItem/GraphScheduleListItem";-import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";-import { useExpertSchedulesButton } from "./useExpertSchedulesButton";--interface Props {- expertId: string;- expertName: string;-}--export function ExpertSchedulesButton({ expertId, expertName }: Props) {- const { isOpen, setIsOpen, schedules } = useExpertSchedulesButton(expertId);-- if (schedules.length === 0) return null;-- return (- <>- <Button- variant="secondary"- size="small"- className="ml-auto shrink-0"- data-testid="expert-schedules-button"- onClick={() => setIsOpen(true)}- >- {schedules.length} {schedules.length === 1 ? "workflow" : "workflows"}{" "}- scheduled- </Button>- <Sheet open={isOpen} onOpenChange={setIsOpen}>- <SheetContent- side="right"- className="w-full overflow-y-auto sm:max-w-xl"- >- <SheetTitle>{expertName}'s scheduled workflows</SheetTitle>- <ul- className="mt-6 flex flex-col gap-3"- aria-label="Expert schedules"- >- {schedules.map((schedule) => (- <li key={schedule.id}>- <GraphScheduleListItem- schedule={schedule}- className="sm:flex-col sm:items-stretch sm:justify-start"- editAction={- <EditScheduleModal- graphId={schedule.graph_id}- schedule={schedule}- triggerClassName="shrink-0"- />- }- />- </li>- ))}- </ul>- </SheetContent>- </Sheet>- </>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/useExpertSchedulesButton.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/useExpertSchedulesButton.tsdeleted file mode 100644index 7ec980409d..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ExpertSchedulesButton/useExpertSchedulesButton.ts+++ /dev/null@@ -1,27 +0,0 @@-import { useGetExpert } from "@/app/api/__generated__/endpoints/experts/experts";-import { useGetV1ListExecutionSchedulesForAUser } from "@/app/api/__generated__/endpoints/schedules/schedules";-import { okData } from "@/app/api/helpers";-import { getExpertSchedules } from "@/app/(platform)/team/helpers";-import { useState } from "react";--export function useExpertSchedulesButton(expertId: string) {- const [isOpen, setIsOpen] = useState(false);-- const expertQuery = useGetExpert(expertId, {- query: { select: (res) => okData(res) ?? null },- });- const schedulesQuery = useGetV1ListExecutionSchedulesForAUser({- query: { select: (res) => okData(res) ?? [] },- });-- const expert = expertQuery.data ?? null;- const allSchedules = schedulesQuery.data ?? [];- // Until the expert record arrives, the expert_id stamp on schedules is- // enough to keep the count honest; the workflow-ref join in- // getExpertSchedules only adds legacy schedules created before stamping.- const schedules = expert- ? getExpertSchedules(expert, allSchedules)- : allSchedules.filter((schedule) => schedule.expert_id === expertId);-- return { isOpen, setIsOpen, schedules };-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsxindex 9764585a78..07ad2ff9e1 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/ThreadHeader.tsx@@ -1,8 +1,21 @@+"use client";++import { Icon } from "@/components/atoms/Icon/Icon";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/atoms/Tooltip/BaseTooltip";import { cn } from "@/lib/utils";+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";+import { ClockIcon, File02Icon, PlayIcon } from "@hugeicons/core-free-icons";+import { useCopilotUIStore } from "../../../store";import type { ExpertIdentity } from "../../../useExpertMap";+import { useSessionFiles } from "../../ContextPanel/components/FilesTab/useSessionFiles";+import { useSessionActivity } from "../../WorkspaceFileCards/useSessionActivity";import { ExpertAvatar } from "./ExpertAvatar/ExpertAvatar";import { ExpertIntegrations } from "./ExpertIntegrations/ExpertIntegrations";-import { ExpertSchedulesButton } from "./ExpertSchedulesButton/ExpertSchedulesButton";// Autopilot's product-facing title when a session carries no expert identity.const DEFAULT_EXPERT_ROLE = "Head of AI";@@ -10,61 +23,147 @@ const DEFAULT_EXPERT_ROLE = "Head of AI";interface Props {expertIdentity?: ExpertIdentity | null;readOnly: boolean;- /** The workspace-files card floats over the column's right side, so the- * centred row slides left to make room for it. */- areFilesOpen: boolean;+ /** Powers the chip's file/run counters and its click-through to the+ * session activity card. Without it the chip is a passive label. */+ sessionId?: string | null;+ /** Set only by the host that actually mounts the activity card. The other+ * hosts pass a real sessionId too, so the flag cannot be inferred — and+ * without it the chip would open a card that isn't there. */+ canOpenActivity?: boolean;/** The new layout floats the sidebar and workspace-files controls over the- * chat's top-left corner below `lg`; the row starts past them. */+ * chat's top-left corner below `lg`; the chip clears them. */hasFloatingControls?: boolean;}-/** Sits above the scroller rather than sticky inside it, so the bar spans the- * full chat width while its row stays aligned with the max-w-3xl message- * column. An expert session wears the expert's identity and every other- * session is Autopilot's, so the thread is never anonymous. */+/** Floats as a translucent chip pinned to the pane's top-left gutter — the+ * zero-height wrapper keeps it out of the flex flow so messages scroll+ * underneath. On narrow viewports the gutter disappears and the chip simply+ * overlaps the message column, which its translucency is built for. An+ * expert session wears the expert's identity and every other session is+ * Autopilot's, so the thread is never anonymous. Clicking the identity+ * opens the session activity card (files, runs, schedules) on the right;+ * the expert's integration logos sit beside it with their own popover. */export function ThreadHeader({expertIdentity,readOnly,- areFilesOpen,+ sessionId = null,+ canOpenActivity = false,hasFloatingControls = false,}: Props) {+ const name = expertIdentity?.name ?? "Autopilot";+ const role = expertIdentity?.role ?? DEFAULT_EXPERT_ROLE;+ const isArtifactsEnabled = useGetFlag(Flag.ARTIFACTS);+ // Only the copilot chat mounts the activity card. The builder and memory+ // panels pass a live sessionId and aren't read-only, so without the host's+ // own say-so the chip would render a button whose click writes panel state+ // and fetches a file list for a card that never appears.+ const isInteractive = Boolean(+ canOpenActivity && isArtifactsEnabled && !readOnly && sessionId,+ );+ const toggleContextPanelTab = useCopilotUIStore(+ (s) => s.toggleContextPanelTab,+ );+ const activitySessionId = isInteractive ? sessionId : null;+ const { runs, schedules } = useSessionActivity(activitySessionId);+ const { uploaded, generated } = useSessionFiles(activitySessionId);+ const fileCount = uploaded.length + generated.length;+ const runCount = runs.length;+ const scheduleCount = schedules.length;+ const showIntegrations = expertIdentity != null && !expertIdentity.isArchived;++ // The chip's own aria-label replaces its contents for screen readers, so+ // every count has to be spelled out here or it is simply never announced.+ const counters = isInteractive+ ? [+ { icon: File02Icon, count: fileCount, noun: "file" },+ { icon: PlayIcon, count: runCount, noun: "run" },+ { icon: ClockIcon, count: scheduleCount, noun: "schedule" },+ ].filter((counter) => counter.count > 0)+ : [];+ const spokenCounts = counters+ .map(({ count, noun }) => `${count} ${noun}${count === 1 ? "" : "s"}`)+ .join(", ");++ const chipContent = (+ <>+ <ExpertAvatar+ name={name}+ avatarUrl={expertIdentity?.avatarUrl ?? null}+ isAutopilot={!expertIdentity}+ size="sm"+ />+ <span className="max-w-[10rem] truncate text-sm font-medium text-zinc-800">+ {name}+ </span>+ {counters.map(({ icon, count, noun }) => (+ <span+ key={noun}+ className="flex shrink-0 items-center gap-1 text-xs font-medium tabular-nums text-zinc-500"+ >+ <Icon icon={icon} className="size-3.5" aria-hidden />+ {count}+ </span>+ ))}+ </>+ );+return (- <div- data-testid="expert-thread-header"- className="z-10 w-full border-b border-b-[#80808017] bg-[#fafafa]/80 backdrop-blur-md"- >+ <div data-testid="expert-thread-header" className="relative z-20 h-0"><divclassName={cn(- "ease-[cubic-bezier(0.32,0.72,0,1)] mx-auto flex w-full max-w-3xl items-center gap-2 px-6 py-2 transition-transform duration-300 will-change-transform motion-reduce:transition-none",- areFilesOpen && "xl:-translate-x-40",+ "pointer-events-none absolute inset-x-0 top-3 flex justify-start px-4",hasFloatingControls && "max-md:pl-28 md:max-lg:pl-20",)}>- <ExpertAvatar- name={expertIdentity?.name ?? "Autopilot"}- avatarUrl={expertIdentity?.avatarUrl ?? null}- isAutopilot={!expertIdentity}- />- <div className="flex min-w-0 flex-col">- <span className="truncate text-sm font-medium text-zinc-800">- {expertIdentity?.name ?? "Autopilot"}- </span>- <span className="truncate text-xs text-zinc-500">- {expertIdentity?.role ?? DEFAULT_EXPERT_ROLE}- </span>+ {/* The integrations popover is its own button, so the chip is a+ container and only the identity half opens the activity card —+ nesting the two triggers would be button-in-button. */}+ <div className="pointer-events-auto flex items-center whitespace-nowrap rounded-full border border-zinc-200/70 bg-white/75 py-1 pl-1.5 pr-3 shadow-sm backdrop-blur-md">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ {isInteractive ? (+ <button+ type="button"+ aria-label={+ spokenCounts+ ? `${name}, ${role}. ${spokenCounts}. Open session activity`+ : `${name}, ${role}. Open session activity`+ }+ onClick={() => toggleContextPanelTab("files")}+ className="-my-1 -ml-1.5 flex min-w-0 items-center gap-2 rounded-full py-1 pl-1.5 pr-1.5 transition-colors hover:bg-zinc-100/80"+ >+ {chipContent}+ </button>+ ) : (+ // The role lives only in the tooltip, and a tooltip opens+ // on focus as well as hover — so even this passive chip has+ // to be reachable by keyboard, or read-only viewers never+ // get the role at all.+ <div+ tabIndex={0}+ aria-label={`${name} — ${role}`}+ className="flex min-w-0 items-center gap-2 rounded-full"+ >+ {chipContent}+ </div>+ )}+ </TooltipTrigger>+ <TooltipContent+ side="bottom"+ className="bg-zinc-900 text-zinc-50 outline-none"+ >+ {role}+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ {showIntegrations && (+ <ExpertIntegrations+ expertId={expertIdentity.id}+ expertName={expertIdentity.name}+ />+ )}</div>- {expertIdentity && !expertIdentity.isArchived && (- <ExpertIntegrations- expertId={expertIdentity.id}- expertName={expertIdentity.name}- />- )}- {expertIdentity && !readOnly && !expertIdentity.isArchived && (- <ExpertSchedulesButton- expertId={expertIdentity.id}- expertName={expertIdentity.name}- />- )}</div></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/ChatMinimap.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/ChatMinimap.tsxindex d888764d77..c687d24b43 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/ChatMinimap.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/ChatMinimap.tsx@@ -57,10 +57,10 @@ export function ChatMinimap({ messages }: Props) {><motion.divclassName={cn(- "h-[3px] w-[26px] origin-left rounded-full transition-colors duration-150",+ "h-[4px] w-[32px] origin-left rounded-full transition-colors duration-150",tickColor(hovered === null ? null : Math.abs(index - hovered)),)}- initial={{ scale: 0.4 }}+ initial={{ scale: 0.6 }}animate={{ scale: tickScale(index, hovered) }}transition={reducedMotion ? { duration: 0 } : TICK_SPRING}/>@@ -73,7 +73,7 @@ export function ChatMinimap({ messages }: Props) {}animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}transition={reducedMotion ? { duration: 0 } : CARD_TRANSITION}- className="absolute left-[34px] top-1/2 z-30 w-80 origin-left -translate-y-1/2 rounded-2xl bg-white p-3.5 smooth-shadow-ring-sm"+ className="absolute left-[40px] top-1/2 z-30 w-80 origin-left -translate-y-1/2 rounded-2xl bg-white p-3.5 smooth-shadow-ring-sm"><p className="truncate text-[15px] text-zinc-900">{entry.title}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/__tests__/ChatMinimap.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/__tests__/ChatMinimap.test.tsxindex 30520c5273..2c8b34cd30 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/__tests__/ChatMinimap.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/__tests__/ChatMinimap.test.tsx@@ -86,12 +86,12 @@ describe("minimap helpers", () => {});it("swells ticks toward the cursor and tapers with distance", () => {- expect(tickScale(3, null)).toBe(0.4);+ expect(tickScale(3, null)).toBe(0.6);expect(tickScale(3, 3)).toBe(1);expect(tickScale(4, 3)).toBeCloseTo(0.8);- expect(tickScale(9, 3)).toBe(0.4);+ expect(tickScale(9, 3)).toBe(0.6);expect(tickColor(0)).toBe("bg-zinc-800");- expect(tickColor(1)).toBe("bg-zinc-400");- expect(tickColor(4)).toBe("bg-zinc-300");+ expect(tickColor(1)).toBe("bg-zinc-500");+ expect(tickColor(4)).toBe("bg-zinc-400");});});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/helpers.tsindex 452a151c24..0c4b3160f8 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMinimap/helpers.ts@@ -52,7 +52,7 @@ function truncate(value: string, max: number): string {return clean.length > max ? `${clean.slice(0, max).trimEnd()}…` : clean;}-const RESTING_SCALE = 0.4;+const RESTING_SCALE = 0.6;const FALLOFF_PER_STEP = 0.2;/** Ticks rest shrunk and swell toward the cursor, tapering one step at a@@ -67,6 +67,6 @@ export function tickScale(index: number, hovered: number | null): number {export function tickColor(distance: number | null): string {if (distance === 0) return "bg-zinc-800";- if (distance === 1) return "bg-zinc-400";- return "bg-zinc-300";+ if (distance === 1) return "bg-zinc-500";+ return "bg-zinc-400";}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelAutoOpen.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelAutoOpen.tsxindex 4ad80dc2bb..ef1ab99417 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelAutoOpen.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelAutoOpen.tsx@@ -1,20 +1,16 @@"use client";-import { useAutoOpenForFiles } from "./useAutoOpenForFiles";import { useCollapseContextPanelOnSession } from "./useCollapseContextPanelOnSession";interface Props {sessionId: string | null;- /** Auto-opening is desktop-only — on mobile the panel is a full-screen- * sheet, so opening it on session entry would bury the chat. The- * session-entry collapse below must still run on mobile: it is what- * forgets the previous chat's artifact, and the chat column mounts its- * artifacts button on every viewport. */- canAutoOpen?: boolean;}-export function ContextPanelAutoOpen({ sessionId, canAutoOpen = true }: Props) {+/** Session-entry reset: forgets the previous chat's artifact so it can't+ * bleed into the next chat. The panel no longer auto-opens on entry — the+ * top-right artifacts button carries the latest filename instead, so one+ * click reaches the same file without hijacking the layout. */+export function ContextPanelAutoOpen({ sessionId }: Props) {useCollapseContextPanelOnSession(sessionId);- useAutoOpenForFiles(sessionId, canAutoOpen);return null;}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelToggle.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelToggle.tsxindex 97d8f15e7d..732d624c03 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelToggle.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/ContextPanelToggle.tsx@@ -4,15 +4,33 @@ import { Button } from "@/components/ui/button";import { cn } from "@/lib/utils";import { useCopilotUIStore } from "../../store";import { useAreWorkspaceFileCardsOpen } from "../../useAreWorkspaceFileCardsOpen";-import { WorkspaceFilesPopover } from "../WorkspaceFileCards/components/WorkspaceFilesPopover";-import { File02Icon, SidebarRightIcon } from "@hugeicons/core-free-icons";+import { fileItemToArtifactRef } from "./components/FilesTab/helpers";+import {+ useSessionFiles,+ type SessionFile,+} from "./components/FilesTab/useSessionFiles";+import { LicenseDraftIcon } from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";interface Props {sessionId?: string | null;}-export function ContextPanelToggle({ sessionId }: Props) {+function getLastGeneratedFile(generated: SessionFile[]): SessionFile | null {+ if (generated.length === 0) return null;+ return generated.reduce((latest, file) =>+ new Date(file.item.created_at).getTime() >+ new Date(latest.item.created_at).getTime()+ ? file+ : latest,+ );+}++/** The chat's one top-right control: the artifacts toggle. It wears the name+ * of the session's most recently generated file so the current working+ * document stays visible, and clicking it opens that file directly in the+ * artifact panel. Workspace files open from the thread chip instead. */+export function ContextPanelToggle({ sessionId = null }: Props) {const isOpen = useCopilotUIStore((s) => s.artifactPanel.isOpen);const hasArtifact = useCopilotUIStore((s) => s.artifactPanel.activeArtifact != null,@@ -24,31 +42,41 @@ export function ContextPanelToggle({ sessionId }: Props) {const closeArtifactPanel = useCopilotUIStore((s) => s.closeArtifactPanel);const lastArtifact = useCopilotUIStore((s) => s.artifactPanel.lastArtifact);const openArtifact = useCopilotUIStore((s) => s.openArtifact);- // Sized and stroked like the sidebar's nav icons so the chat's top-right- // controls read as the same family.- const buttonClass =- "size-8 shrink-0 rounded-md transition-[background-color,transform] duration-150 ease-out hover:!bg-zinc-200 active:scale-[0.97] motion-reduce:transition-none";- const iconClass = "!size-4 text-sidebar-foreground/90";+ const { generated } = useSessionFiles(sessionId);+ const lastGenerated = getLastGeneratedFile(generated);+ const isFilesCardOpen = useAreWorkspaceFileCardsOpen();const isArtifactsOpen = isOpen && activeTab === "artifacts";// An open artifact preview and the artifacts tab are both faces of the- // right sidebar, so the sidebar toggle reads active for either and is the- // one control that closes them — the panel carries no close button.+ // right sidebar, so the toggle reads active for either and is the one+ // control that closes them — the panel carries no close button.const isRightSidebarOpen = hasArtifact || isArtifactsOpen;- // While the right sidebar owns that region the inline files card has- // nowhere to sit, so the workspace-files trigger becomes a popover; it- // returns to the pinned card as soon as the sidebar closes.- const showFilesAsPopover = isRightSidebarOpen;- const isFilesCardOpen = useAreWorkspaceFileCardsOpen();++ // The open activity card already lists the same file, so the labeled+ // button floating above it is pure duplication — the card's rows are the+ // way in while it shows.+ if (isFilesCardOpen) return null;++ // With the panel open its own header already names the document, so the+ // button collapses to the bare icon; closed, the name is the reminder of+ // what's being worked on.+ const showFileName = lastGenerated != null && !isRightSidebarOpen;function handleSidebarToggle() {if (hasArtifact) {closeArtifactPanel();return;}- // Reopening brings back the preview that was showing when the sidebar- // closed (e.g. hello.md), not just the tabs view.- if (!isRightSidebarOpen && lastArtifact) {- openArtifact(lastArtifact);+ if (isArtifactsOpen) {+ toggleContextPanelTab("artifacts");+ return;+ }+ // Straight to the document: the freshest generated file, then the+ // remembered preview, and only then the tabs view.+ const target =+ (lastGenerated ? fileItemToArtifactRef(lastGenerated.item) : null) ??+ lastArtifact;+ if (target) {+ openArtifact(target);return;}toggleContextPanelTab("artifacts");@@ -56,38 +84,36 @@ export function ContextPanelToggle({ sessionId }: Props) {return (<div className="flex shrink-0 items-center gap-1 p-2">- {showFilesAsPopover && sessionId ? (- <WorkspaceFilesPopover- sessionId={sessionId}- wrapperClassName="p-0"- triggerClassName={buttonClass}- iconClassName={iconClass}- />- ) : (- <Button- type="button"- variant="ghost"- size="icon"- onClick={() => toggleContextPanelTab("files")}- aria-label={- isFilesCardOpen ? "Hide workspace files" : "Open workspace files"- }- aria-pressed={isFilesCardOpen}- className={cn(buttonClass, isFilesCardOpen && "bg-zinc-200/70")}- >- <Icon icon={File02Icon} className={iconClass} />- </Button>- )}<Buttontype="button"variant="ghost"- size="icon"+ size={showFileName ? "sm" : "icon"}onClick={handleSidebarToggle}- aria-label={isRightSidebarOpen ? "Hide artifacts" : "Open artifacts"}+ aria-label={+ isRightSidebarOpen+ ? "Hide artifacts"+ : lastGenerated+ ? `Open ${lastGenerated.item.name}`+ : "Open artifacts"+ }aria-pressed={isRightSidebarOpen}- className={cn(buttonClass, isRightSidebarOpen && "bg-zinc-200/70")}+ className={cn(+ // Sized and stroked like the sidebar's nav icons so the chat's+ // top-right control reads as the same family.+ "shrink-0 rounded-md transition-[background-color,transform] duration-150 ease-out hover:bg-zinc-100 active:scale-[0.97] motion-reduce:transition-none",+ showFileName ? "h-8 gap-1.5 px-2" : "size-8",+ isRightSidebarOpen && "bg-zinc-100",+ )}>- <Icon icon={SidebarRightIcon} className={iconClass} />+ <Icon+ icon={LicenseDraftIcon}+ className="!size-4 text-sidebar-foreground/90"+ />+ {showFileName && (+ <span className="max-w-[9rem] truncate text-xs font-medium text-sidebar-foreground/90">+ {lastGenerated.item.name}+ </span>+ )}</Button></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelAutoOpen.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelAutoOpen.test.tsxindex 93188b86c9..0ae3b82608 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelAutoOpen.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelAutoOpen.test.tsx@@ -39,7 +39,7 @@ describe("ContextPanelAutoOpen", () => {}));});- test("forgets the previous chat's artifact on mobile, where auto-opening stays off", async () => {+ test("forgets the previous chat's artifact on session entry", async () => {server.use(getListWorkspaceFilesMockHandler200(withFiles()));useCopilotUIStore.setState((s) => ({artifactPanel: {@@ -54,7 +54,7 @@ describe("ContextPanelAutoOpen", () => {},},}));- render(<ContextPanelAutoOpen sessionId={SESSION} canAutoOpen={false} />);+ render(<ContextPanelAutoOpen sessionId={SESSION} />);await waitFor(() =>expect(useCopilotUIStore.getState().artifactPanel.lastArtifact,@@ -65,14 +65,12 @@ describe("ContextPanelAutoOpen", () => {expect(panel.isOpen).toBe(false);});- test("opens the last generated file in the artifact panel when the session has files", async () => {+ test("does not auto-open the artifact panel when the session has files", async () => {server.use(getListWorkspaceFilesMockHandler200(withFiles()));render(<ContextPanelAutoOpen sessionId={SESSION} />);- await waitFor(() =>- expect(- useCopilotUIStore.getState().artifactPanel.activeArtifact?.id,- ).toBe("aaaaaaaa-0000-0000-0000-000000000001"),- );- expect(useCopilotUIStore.getState().artifactPanel.isOpen).toBe(true);+ await new Promise((resolve) => setTimeout(resolve, 50));+ const panel = useCopilotUIStore.getState().artifactPanel;+ expect(panel.isOpen).toBe(false);+ expect(panel.activeArtifact).toBeNull();});});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelToggle.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelToggle.test.tsxindex 8b11eb5389..c9db666542 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelToggle.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/__tests__/ContextPanelToggle.test.tsx@@ -1,5 +1,3 @@-import { getListWorkspaceFilesMockHandler200 } from "@/app/api/__generated__/endpoints/workspace/workspace.msw";-import { server } from "@/mocks/mock-server";import { fireEvent, render, screen } from "@/tests/integrations/test-utils";import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import { useCopilotUIStore } from "../../../store";@@ -13,8 +11,6 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {return { ...actual, useGetFlag: () => false };});-const SESSION = "session-1";-const ARTIFACT = {id: "f1",title: "doc.md",@@ -34,13 +30,6 @@ function panelState() {}beforeEach(() => {- server.use(- getListWorkspaceFilesMockHandler200({- files: [],- offset: 0,- has_more: false,- }),- );setPanel({isOpen: false,activeArtifact: null,@@ -61,49 +50,16 @@ afterEach(() => {});describe("ContextPanelToggle", () => {- test("shows a files toggle button when the right sidebar is closed", () => {- render(<ContextPanelToggle sessionId={SESSION} />);-- const filesButton = screen.getByLabelText("Open workspace files");- fireEvent.click(filesButton);- expect(panelState().isOpen).toBe(true);- expect(panelState().activeTab).toBe("files");- });-- test("toggles the files card closed on a second click", () => {- setPanel({ isOpen: true, activeTab: "files" });- render(<ContextPanelToggle sessionId={SESSION} />);-- fireEvent.click(screen.getByLabelText("Hide workspace files"));- expect(panelState().isOpen).toBe(false);- });-- test("swaps the files trigger for a popover while the artifacts tab owns the sidebar", async () => {- setPanel({ isOpen: true, activeTab: "artifacts" });- render(<ContextPanelToggle sessionId={SESSION} />);+ test("renders no workspace-files trigger — the thread chip owns that", () => {+ render(<ContextPanelToggle />);expect(screen.queryByLabelText("Open workspace files")).toBeNull();- expect(screen.queryByLabelText("Hide workspace files")).toBeNull();- expect(await screen.findByLabelText("Workspace files")).toBeDefined();- });-- test("swaps the files trigger for a popover while an artifact is open", async () => {- setPanel({ activeArtifact: ARTIFACT });- render(<ContextPanelToggle sessionId={SESSION} />);-- expect(await screen.findByLabelText("Workspace files")).toBeDefined();- });-- test("falls back to the files button when no sessionId is available, even with an artifact open", () => {- setPanel({ activeArtifact: ARTIFACT });- render(<ContextPanelToggle sessionId={null} />);-- expect(screen.getByLabelText("Open workspace files")).toBeDefined();+ expect(screen.queryByLabelText("Workspace files")).toBeNull();});test("sidebar toggle closes the artifact preview via closeArtifactPanel", () => {setPanel({ activeArtifact: ARTIFACT, isOpen: true });- render(<ContextPanelToggle sessionId={SESSION} />);+ render(<ContextPanelToggle />);fireEvent.click(screen.getByLabelText("Hide artifacts"));@@ -112,7 +68,7 @@ describe("ContextPanelToggle", () => {test("sidebar toggle restores the last previewed artifact instead of opening the tabs view", () => {setPanel({ lastArtifact: ARTIFACT, isOpen: false });- render(<ContextPanelToggle sessionId={SESSION} />);+ render(<ContextPanelToggle />);fireEvent.click(screen.getByLabelText("Open artifacts"));@@ -121,7 +77,7 @@ describe("ContextPanelToggle", () => {test("sidebar toggle opens the artifacts tab when there is no remembered artifact", () => {setPanel({ lastArtifact: null, isOpen: false });- render(<ContextPanelToggle sessionId={SESSION} />);+ render(<ContextPanelToggle />);fireEvent.click(screen.getByLabelText("Open artifacts"));@@ -131,7 +87,7 @@ describe("ContextPanelToggle", () => {test("sidebar toggle reads as active when the artifacts tab is open", () => {setPanel({ isOpen: true, activeTab: "artifacts" });- render(<ContextPanelToggle sessionId={SESSION} />);+ render(<ContextPanelToggle />);expect(screen.getByLabelText("Hide artifacts")).toBeDefined();});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/components/FilesTab/useSessionFiles.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/components/FilesTab/useSessionFiles.tsindex b064722b7f..5b67af3bc6 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/components/FilesTab/useSessionFiles.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/components/FilesTab/useSessionFiles.ts@@ -3,6 +3,7 @@import { useListWorkspaceFiles } from "@/app/api/__generated__/endpoints/workspace/workspace";import type { ListFilesResponse } from "@/app/api/__generated__/models/listFilesResponse";import type { WorkspaceFileItem } from "@/app/api/__generated__/models/workspaceFileItem";+import { useMemo } from "react";import { useCopilotStreamStore } from "../../../../copilotStreamStore";import { getMessageArtifacts } from "../../../ChatMessagesContainer/helpers";import { isUploadedFile } from "./helpers";@@ -27,22 +28,31 @@ export function useSessionFiles(sessionId: string | null) {},);- const fileIdToMessageId = new Map<string, string>();- for (const message of messages ?? []) {- for (const artifact of getMessageArtifacts(message)) {- if (!fileIdToMessageId.has(artifact.id)) {- fileIdToMessageId.set(artifact.id, message.id);+ // The chip and the artifacts button both read this on every render, and+ // `messageSnapshots` is rewritten with a fresh array per streamed token —+ // so without memoising, scanning every message part (and compiling a+ // RegExp per matched workspace URI) would run at token cadence.+ const { uploaded, generated, files } = useMemo(() => {+ const fileIdToMessageId = new Map<string, string>();+ for (const message of messages ?? []) {+ for (const artifact of getMessageArtifacts(message)) {+ if (!fileIdToMessageId.has(artifact.id)) {+ fileIdToMessageId.set(artifact.id, message.id);+ }}}- }- const files: SessionFile[] = (query.data?.files ?? []).map((item) => ({- item,- messageID: fileIdToMessageId.get(item.id) ?? null,- }));+ const files: SessionFile[] = (query.data?.files ?? []).map((item) => ({+ item,+ messageID: fileIdToMessageId.get(item.id) ?? null,+ }));- const uploaded = files.filter((f) => isUploadedFile(f.item));- const generated = files.filter((f) => !isUploadedFile(f.item));+ return {+ files,+ uploaded: files.filter((f) => isUploadedFile(f.item)),+ generated: files.filter((f) => !isUploadedFile(f.item)),+ };+ }, [messages, query.data]);return {uploaded,diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/useAutoOpenForFiles.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/useAutoOpenForFiles.tsdeleted file mode 100644index 216bf96b89..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ContextPanel/useAutoOpenForFiles.ts+++ /dev/null@@ -1,53 +0,0 @@-"use client";--import { useEffect, useRef } from "react";-import { useCopilotUIStore } from "../../store";-import { fileItemToArtifactRef } from "./components/FilesTab/helpers";-import {- useSessionFiles,- type SessionFile,-} from "./components/FilesTab/useSessionFiles";--function getLastGeneratedFile(generated: SessionFile[]): SessionFile | null {- if (generated.length === 0) return null;- return generated.reduce((latest, file) =>- new Date(file.item.created_at).getTime() >- new Date(latest.item.created_at).getTime()- ? file- : latest,- );-}--/**- * The first time a session is found to have generated files, opens the Artifact- * panel directly on the most recently generated file (unless the user has- * explicitly closed the panel).- */-export function useAutoOpenForFiles(sessionId: string | null, enabled = true) {- const autoOpenArtifact = useCopilotUIStore((s) => s.autoOpenArtifact);- const { generated } = useSessionFiles(sessionId);- const lastGenerated = getLastGeneratedFile(generated);- const triggered = useRef(false);- const prevSessionIdRef = useRef(sessionId);-- // Session change: clear the per-session "already triggered" guard so the- // next session can auto-open independently. The shared `_autoOpenReady` /- // `_autoOpenUserClosed` flags are reset by `useAutoOpenArtifacts` (the- // single owner of that global state); calling `resetAutoOpenState()` here- // too races with that hook and can clobber the ready flag depending on- // mount order.- useEffect(() => {- if (prevSessionIdRef.current !== sessionId) {- triggered.current = false;- prevSessionIdRef.current = sessionId;- }- }, [sessionId]);-- useEffect(() => {- if (!enabled) return;- if (lastGenerated && !triggered.current) {- triggered.current = true;- autoOpenArtifact(fileItemToArtifactRef(lastGenerated.item));- }- }, [enabled, lastGenerated, autoOpenArtifact]);-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/TokenDevtoolBadge.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/TokenDevtoolBadge.tsxindex ceacab6c88..9e070162a0 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/TokenDevtoolBadge.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/TokenDevtoolBadge.tsx@@ -19,7 +19,6 @@ import {} from "../../tokenDevtool/tokenMath";import { BreakdownSection } from "./components/BreakdownSection";import { ContextBar } from "./components/ContextBar";-import { MiniBar } from "./components/MiniBar";import { TurnRow } from "./components/TurnRow";interface Props {@@ -63,13 +62,14 @@ export function TokenDevtoolBadge({ sessionId, className }: Props) {context === null ? "unknown" : formatTokenCount(context)}`}className={cn(- "flex items-center gap-1.5 rounded-full px-2 py-0.5 font-mono text-xs text-zinc-500 transition-colors hover:bg-zinc-200/60 hover:text-zinc-700",+ "flex h-8 w-8 items-center justify-center rounded-full text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700",className,)}>- <Icon icon={DashboardSpeed02Icon} size={14} />- {context === null ? "ctx —" : `ctx ~${formatTokenCount(context)}`}- {context !== null && <MiniBar context={context} />}+ <Icon icon={DashboardSpeed02Icon} size={16} />+ <span className="sr-only">+ {context === null ? "ctx —" : `ctx ~${formatTokenCount(context)}`}+ </span></button></PopoverTrigger>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/components/MiniBar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/components/MiniBar.tsxdeleted file mode 100644index 3b9f5d8dee..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/TokenDevtoolBadge/components/MiniBar.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { isOverAutocompact, windowPercent } from "../helpers";--interface Props {- context: number;-}--export function MiniBar({ context }: Props) {- return (- <span className="relative h-1 w-10 overflow-hidden rounded-full bg-zinc-200">- <span- className={- "absolute inset-y-0 left-0 rounded-full " +- (isOverAutocompact(context) ? "bg-amber-400" : "bg-zinc-500")- }- style={{ width: `${windowPercent(context)}%` }}- />- </span>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkCard/WorkCard.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkCard/WorkCard.tsxindex fa5d26842b..b1c9a4b506 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkCard/WorkCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkCard/WorkCard.tsx@@ -18,7 +18,7 @@ export function WorkCard({ metadata, preview }: Props) {return (<div- className="max-w-md rounded-2xl bg-white p-4 ring-1 ring-inset ring-zinc-200"+ className="max-w-md rounded-2xl bg-white p-4 ring-1 ring-inset ring-zinc-200/60"data-testid="work-card"><div className="flex items-start justify-between gap-3">diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/__tests__/WorkspaceFilesPopover.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/__tests__/WorkspaceFilesPopover.test.tsxdeleted file mode 100644index 9e9045a663..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/__tests__/WorkspaceFilesPopover.test.tsx+++ /dev/null@@ -1,202 +0,0 @@-import {- getDeleteWorkspaceFileMockHandler200,- getListWorkspaceFilesMockHandler200,-} from "@/app/api/__generated__/endpoints/workspace/workspace.msw";-import type { ListFilesResponse } from "@/app/api/__generated__/models/listFilesResponse";-import { server } from "@/mocks/mock-server";-import {- fireEvent,- render,- screen,- waitFor,-} from "@/tests/integrations/test-utils";-import type { UIMessage } from "ai";-import { afterEach, describe, expect, it, vi } from "vitest";-import { useCopilotStreamStore } from "../../../copilotStreamStore";-import { useCopilotUIStore } from "../../../store";-import { WorkspaceFilesPopover } from "../components/WorkspaceFilesPopover";--// Popover renders through a portal in real usage; mocking it as plain divs-// that still honour `open` (the trigger toggles it, the content mounts only-// while it's set) lets us assert the section content and wiring without-// fighting Radix positioning/portal internals in jsdom.-vi.mock("@/components/molecules/Popover/Popover", async () => {- const { createContext, useContext } = await import("react");- const OpenContext = createContext<{- open: boolean;- onOpenChange: (open: boolean) => void;- }>({ open: false, onOpenChange: () => {} });- function Popover({- open,- onOpenChange,- children,- }: {- open: boolean;- onOpenChange: (open: boolean) => void;- children: React.ReactNode;- }) {- return (- <OpenContext.Provider value={{ open, onOpenChange }}>- {children}- </OpenContext.Provider>- );- }- function PopoverTrigger({ children }: { children: React.ReactNode }) {- const { open, onOpenChange } = useContext(OpenContext);- return <div onClick={() => onOpenChange(!open)}>{children}</div>;- }- function PopoverContent({ children }: { children: React.ReactNode }) {- const { open } = useContext(OpenContext);- return open ? <div>{children}</div> : null;- }- return { Popover, PopoverTrigger, PopoverContent };-});--const SESSION = "session-1";--function listResponse(- files: ListFilesResponse["files"] = [],-): ListFilesResponse {- return { files, offset: 0, has_more: false };-}--function openPopover() {- fireEvent.click(screen.getByLabelText("Workspace files"));-}--// Long enough for a mounted list query to reach the MSW handler.-function flushRequests() {- return new Promise((resolve) => setTimeout(resolve, 20));-}--function activityMessages(): UIMessage[] {- return [- {- id: "m1",- role: "assistant",- parts: [- {- type: "tool-run_agent",- toolCallId: "call-1",- state: "output-available",- input: {},- output: {- execution_id: "exec-1",- status: "RUNNING",- graph_name: "Daily Digest",- graph_id: "graph-1",- },- },- ],- } as unknown as UIMessage,- ];-}--afterEach(() => {- useCopilotStreamStore.setState({ messageSnapshots: {} });-});--describe("WorkspaceFilesPopover", () => {- it("shows the empty state when there are no files, runs, or schedules", async () => {- server.use(getListWorkspaceFilesMockHandler200(listResponse()));- render(<WorkspaceFilesPopover sessionId={SESSION} />);- openPopover();-- expect(await screen.findByText("Nothing here yet.")).toBeDefined();- });-- it("lists files and opens one as an artifact preview on click", async () => {- server.use(- getListWorkspaceFilesMockHandler200(- listResponse([- {- id: "aaaaaaaa-0000-0000-0000-000000000001",- name: "result.csv",- path: "/sessions/session-1/result.csv",- mime_type: "text/csv",- size_bytes: 4096,- metadata: { origin: "agent" },- origin: "generated",- created_at: "2026-05-20T11:00:00Z",- },- ]),- ),- );- render(<WorkspaceFilesPopover sessionId={SESSION} />);- openPopover();-- fireEvent.click(await screen.findByTitle("result.csv"));-- expect(- useCopilotUIStore.getState().artifactPanel.activeArtifact?.title,- ).toBe("result.csv");- });-- it("deletes a generated file through the confirm dialog", async () => {- server.use(- getListWorkspaceFilesMockHandler200(- listResponse([- {- id: "bbbbbbbb-0000-0000-0000-000000000002",- name: "result.csv",- path: "/sessions/session-1/result.csv",- mime_type: "text/csv",- size_bytes: 4096,- metadata: { origin: "agent" },- origin: "generated",- created_at: "2026-05-20T11:00:00Z",- },- ]),- ),- );- let deleted = false;- server.use(- getDeleteWorkspaceFileMockHandler200(() => {- deleted = true;- return {- deleted: true,- file_id: "bbbbbbbb-0000-0000-0000-000000000002",- };- }),- );- render(<WorkspaceFilesPopover sessionId={SESSION} />);- openPopover();-- fireEvent.click(await screen.findByLabelText("Delete result.csv"));- fireEvent.click(await screen.findByRole("button", { name: /^Delete$/ }));-- await waitFor(() => expect(deleted).toBe(true));- });-- it("shows runs and schedules sections alongside the files section", async () => {- server.use(getListWorkspaceFilesMockHandler200(listResponse()));- useCopilotStreamStore- .getState()- .setMessageSnapshot(SESSION, activityMessages());-- render(<WorkspaceFilesPopover sessionId={SESSION} />);- openPopover();-- expect(await screen.findByText(/^Runs \(1\)/)).toBeDefined();- expect(screen.getByText("Daily Digest")).toBeDefined();- expect(screen.queryByText("Nothing here yet.")).toBeNull();- });-- it("requests the file list only once the popover opens", async () => {- let listRequests = 0;- server.use(- getListWorkspaceFilesMockHandler200(() => {- listRequests += 1;- return listResponse();- }),- );- render(<WorkspaceFilesPopover sessionId={SESSION} />);- await flushRequests();- expect(listRequests).toBe(0);-- openPopover();-- expect(await screen.findByText("Nothing here yet.")).toBeDefined();- expect(listRequests).toBeGreaterThan(0);- });-});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/StackSection.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/StackSection.tsxindex 46bef6dfb6..824c96d65c 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/StackSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/StackSection.tsx@@ -21,9 +21,9 @@ interface Props {export function StackSection({ title, icon, count, action, children }: Props) {return (<section className="flex min-w-0 flex-col">- {/* px-4 matches the card's own padding, so the title starts exactly+ {/* px-3 matches the card's own padding, so the title starts exactlywhere the row content inside does. */}- <div className="mb-1.5 flex items-center gap-1.5 px-4">+ <div className="mb-1.5 flex items-center gap-1.5 px-3"><Icon icon={icon} size={14} className="text-zinc-500" aria-hidden /><Text variant="small-medium" className="!text-zinc-700">{title}@@ -31,7 +31,7 @@ export function StackSection({ title, icon, count, action, children }: Props) {</Text>{action && <div className="ml-auto flex items-center">{action}</div>}</div>- <div className="rounded-3xl bg-white/90 px-4 py-3 backdrop-blur smooth-shadow-ring-sm">+ <div className="rounded-lg bg-white/90 px-3 py-1 backdrop-blur smooth-shadow-ring-sm">{children}</div></section>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/WorkspaceFilesPopover.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/WorkspaceFilesPopover.tsxdeleted file mode 100644index 7d373e39e6..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/components/WorkspaceFilesPopover.tsx+++ /dev/null@@ -1,210 +0,0 @@-"use client";--import { Button } from "@/components/atoms/Button/Button";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/molecules/Popover/Popover";-import { cn } from "@/lib/utils";-import { File02Icon } from "@hugeicons/core-free-icons";-import { Icon } from "@/components/atoms/Icon/Icon";-import { Fragment, useState } from "react";-import type { SessionFile } from "../../ContextPanel/components/FilesTab/useSessionFiles";-import { useSessionActivity } from "../useSessionActivity";-import { useWorkspaceFileCards } from "../useWorkspaceFileCards";-import { RunsList, SchedulesList } from "./SessionActivityContent";-import { WorkspaceFilesContent } from "./WorkspaceFilesContent";--// The stack hoists section titles above each card; one popover surface can't,-// so the labels stay inline here.-const SECTION_LABEL = "block pb-1.5 text-[15px] text-zinc-400";--interface Props {- sessionId: string;- wrapperClassName?: string;- triggerClassName?: string;- iconClassName?: string;-}--/**- * While an artifact (or the artifacts side panel) owns the right side there's- * nowhere for the inline files card to sit, so the workspace-files trigger- * swaps to this popover: same icon, same card content, anchored to the button- * instead of pinned to the chat column.- */-export function WorkspaceFilesPopover({- sessionId,- wrapperClassName,- triggerClassName,- iconClassName,-}: Props) {- const [isPopoverOpen, setIsPopoverOpen] = useState(false);- // The delete confirm renders as a modal dialog outside the popover tree —- // without the guards below the popover reads that interaction as "outside"- // and closes, unmounting the dialog mid-confirm.- const [isConfirmingDelete, setIsConfirmingDelete] = useState(false);-- // The trigger can still close the popover mid-confirm; the content (and its- // pending delete) unmounts with it, so the guard must not outlive them.- function handleOpenChange(open: boolean) {- setIsPopoverOpen(open);- if (!open) setIsConfirmingDelete(false);- }-- return (- <div className={cn("flex shrink-0 items-start p-2", wrapperClassName)}>- <Popover open={isPopoverOpen} onOpenChange={handleOpenChange}>- <PopoverTrigger asChild>- <Button- type="button"- variant="ghost"- size="icon"- aria-label="Workspace files"- // p-0: the atom's size="icon" is p-3, which on a size-8 trigger- // leaves an 8px content box and squeezes the glyph. shrink-0: the- // atom has no [&_svg]:shrink-0, so the icon would flex-shrink to- // fit regardless of its own size class.- className={cn(- "p-0",- triggerClassName ?? "size-9 rounded-xl",- isPopoverOpen && "bg-zinc-200/70 text-zinc-900",- )}- >- <Icon- icon={File02Icon}- className={cn("shrink-0", iconClassName ?? "!size-[1.15rem]")}- />- </Button>- </PopoverTrigger>- <PopoverContent- align="end"- className="w-80 rounded-3xl border-none bg-white/90 px-4 py-3 shadow-none backdrop-blur smooth-shadow-ring-sm"- onInteractOutside={(e) => {- if (isConfirmingDelete) e.preventDefault();- }}- onEscapeKeyDown={(e) => {- if (isConfirmingDelete) e.preventDefault();- }}- >- {/* Mounted only while the popover is open, so the file-list request- and the transcript scans wait for the click — as the floating- card's body does. */}- <WorkspaceFilesPopoverContent- sessionId={sessionId}- onFileOpened={() => setIsPopoverOpen(false)}- onConfirmingDeleteChange={setIsConfirmingDelete}- />- </PopoverContent>- </Popover>- </div>- );-}--interface ContentProps {- sessionId: string;- onFileOpened: () => void;- onConfirmingDeleteChange: (isConfirming: boolean) => void;-}--function WorkspaceFilesPopoverContent({- sessionId,- onFileOpened,- onConfirmingDeleteChange,-}: ContentProps) {- const {- files,- isLoading,- isError,- isDeleting,- isZipping,- pendingDelete,- setPendingDelete,- handleOpen,- handleDownload,- handleConfirmDelete,- handleDownloadAll,- } = useWorkspaceFileCards(sessionId);- const { runs, schedules } = useSessionActivity(sessionId);-- function handleOpenFile(file: SessionFile) {- handleOpen(file);- onFileOpened();- }-- function handleRequestDelete(file: SessionFile) {- setPendingDelete(file);- onConfirmingDeleteChange(true);- }-- function handleCancelDelete() {- setPendingDelete(null);- onConfirmingDeleteChange(false);- }-- async function handleConfirm() {- await handleConfirmDelete();- onConfirmingDeleteChange(false);- }-- // Mirrors the floating stack: each section only earns its space once it has- // something to show (files keep loading/error states so a slow fetch doesn't- // read as "no files"). Keyed by section identity rather than array index so- // a section dropping out doesn't reassign a neighboring section's state.- const sections = [- {- key: "files",- node: (isLoading || isError || files.length > 0) && (- <WorkspaceFilesContent- files={files}- isLoading={isLoading}- isError={isError}- isDeleting={isDeleting}- isZipping={isZipping}- pendingDelete={pendingDelete}- onOpen={handleOpenFile}- onDownload={handleDownload}- onRequestDelete={handleRequestDelete}- onConfirmDelete={handleConfirm}- onCancelDelete={handleCancelDelete}- onDownloadAll={handleDownloadAll}- />- ),- },- {- key: "runs",- node: runs.length > 0 && (- <>- <span className={SECTION_LABEL}>Runs ({runs.length})</span>- <RunsList runs={runs} />- </>- ),- },- {- key: "schedules",- node: schedules.length > 0 && (- <>- <span className={SECTION_LABEL}>Schedules ({schedules.length})</span>- <SchedulesList schedules={schedules} />- </>- ),- },- ].filter((section) => section.node);-- if (sections.length === 0) {- return (- <p className="py-2 text-center text-sm text-zinc-400">- Nothing here yet.- </p>- );- }-- // One popover can't float three cards, so the stack's card breaks become- // hairlines here.- return sections.map((section, index) => (- <Fragment key={section.key}>- {index > 0 && <div className="my-3 border-t border-zinc-100" />}- {section.node}- </Fragment>- ));-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/useSessionActivity.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/useSessionActivity.tsindex 74efd306e1..70272e8d55 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/useSessionActivity.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFileCards/useSessionActivity.ts@@ -1,5 +1,6 @@"use client";+import { useMemo } from "react";import { useCopilotStreamStore } from "../../copilotStreamStore";import { getSessionActivity } from "./helpers";@@ -7,5 +8,8 @@ export function useSessionActivity(sessionId: string | null) {const messages = useCopilotStreamStore((s) =>sessionId ? s.messageSnapshots[sessionId] : undefined,);- return getSessionActivity(messages ?? []);+ // The thread chip reads this on every render, and `messageSnapshots` is a+ // fresh array per streamed token — so the scan over every message part has+ // to be memoised, and the identity kept stable for consumers.+ return useMemo(() => getSessionActivity(messages ?? []), [messages]);}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/store.tsindex dab9b058a6..0e9d717bbd 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts@@ -197,7 +197,6 @@ interface CopilotUIState {* can never restore the previous chat's artifact. */clearLastArtifact: () => void;openContextPanelForFiles: () => void;- autoOpenArtifact: (ref: ArtifactRef) => void;showFilesTab: () => void;// Card-based auto-open: ArtifactCard registers itself on mount, the store@@ -471,21 +470,6 @@ export const useCopilotUIStore = create<CopilotUIState>((set, get) => ({}));},- // Auto-open path for sessions that already have generated files: surfaces the- // last generated file directly in the Artifact panel. Respects the user's- // explicit close, mirroring openContextPanelForFiles' guard.- autoOpenArtifact: (ref) => {- if (_autoOpenUserClosed) return;- if (isClient) storage.set(Key.COPILOT_CONTEXT_PANEL_OPEN, "true");- set((state) => ({- artifactPanel: {- ...state.artifactPanel,- isOpen: true,- activeArtifact: ref,- history: [],- },- }));- },// Explicit user action (the artifact panel's files button): drops the open// preview and hands the region to the floating files card.showFilesTab: () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/AgentTeam/components/StatusBadge.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/AgentTeam/components/StatusBadge.tsxindex 3bed204971..1901989890 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/AgentTeam/components/StatusBadge.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/AgentTeam/components/StatusBadge.tsx@@ -14,34 +14,34 @@ const STATUS_CONFIG = {working: {label: "Working",icon: Loading03Icon,- className: "bg-primary/10 text-primary",+ className: "bg-primary/10 text-primary ring-primary/20",},ready: {label: "Ready",icon: CheckmarkCircle02Icon,- className: "bg-emerald-50 text-emerald-700",+ className: "bg-emerald-50 text-emerald-700 ring-emerald-600/20",},needs_setup: {label: "Setup",icon: Settings01Icon,- className: "bg-amber-50 text-amber-700",+ className: "bg-amber-50 text-amber-800 ring-amber-500/20",},paused: {label: "Paused",icon: PauseIcon,- className: "bg-zinc-100 text-zinc-600",+ className: "bg-zinc-50 text-zinc-600 ring-zinc-500/10",},failed: {label: "Failed",icon: AlertCircleIcon,- className: "bg-rose-50 text-rose-700",+ className: "bg-red-50 text-red-700 ring-red-600/10",},};const UNKNOWN_STATUS_CONFIG = {label: "Unknown",icon: HelpCircleIcon,- className: "bg-zinc-100 text-zinc-600",+ className: "bg-zinc-50 text-zinc-600 ring-zinc-500/10",};interface Props {@@ -54,7 +54,7 @@ export function StatusBadge({ status }: Props) {return (<spanclassName={cn(- "inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium",+ "inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium ring-1 ring-inset",config.className,)}>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsxindex 8c85ea15c9..75efe82461 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertWorkflowsSection.tsx@@ -1,6 +1,7 @@"use client";import { Expert } from "@/app/api/__generated__/models/expert";+import { Badge } from "@/components/atoms/Badge/Badge";import { Button } from "@/components/atoms/Button/Button";import { safeHumanizeCronExpression } from "@/lib/cron-expression-utils";import { FlashIcon, PlusSignIcon } from "@hugeicons/core-free-icons";@@ -61,13 +62,13 @@ export function ExpertWorkflowsSection({) : null}</div>{workflowNeedsSetup(workflow) ? (- <span className="shrink-0 rounded-full bg-amber-50 px-2.5 py-1 text-xs text-amber-700 ring-1 ring-inset ring-amber-200">+ <Badge variant="warning" size="small" className="shrink-0">Needs setup- </span>+ </Badge>) : workflow.schedule_cron ? (- <span className="shrink-0 rounded-full bg-zinc-100 px-2.5 py-1 text-xs text-zinc-600">+ <Badge variant="info" size="small" className="shrink-0">{safeHumanizeCronExpression(workflow.schedule_cron)}- </span>+ </Badge>) : null}</div>))}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsxindex 733ea52b20..547566a0b4 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertTeamCard/ExpertTeamCard.tsx@@ -6,6 +6,7 @@ import {AvatarFallback,AvatarImage,} from "@/components/atoms/Avatar/Avatar";+import { Badge } from "@/components/atoms/Badge/Badge";import { Button } from "@/components/atoms/Button/Button";import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";@@ -168,10 +169,10 @@ export function ExpertTeamCard({{workflowCount} {workflowCount === 1 ? "workflow" : "workflows"}</Text>{needsSetupCount > 0 ? (- <span className="rounded-full bg-amber-50 px-2 py-0.5 text-xs text-amber-700 ring-1 ring-inset ring-amber-200">+ <Badge variant="warning" size="small">{needsSetupCount} {needsSetupCount === 1 ? "needs" : "need"}{" "}setup- </span>+ </Badge>) : null}</div></Link>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/ExpertWorkflowGroup.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/ExpertWorkflowGroup.tsxindex 516c23bb68..332123de83 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/ExpertWorkflowGroup.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/ExpertWorkflowGroup.tsx@@ -92,7 +92,7 @@ export function ExpertWorkflowGroup({ group }: Props) {<div className="ml-auto flex flex-wrap items-center justify-end gap-2">{needsSetup && !isPaused ? (<>- <Badge variant="info" className={STATUS_BADGE_CLASS}>+ <Badge variant="warning" className={STATUS_BADGE_CLASS}>Needs setup</Badge><Linkdiff --git a/autogpt_platform/frontend/src/components/ai-elements/prompt-input.tsx b/autogpt_platform/frontend/src/components/ai-elements/prompt-input.tsxindex 8d71335a89..ba4c8b0544 100644--- a/autogpt_platform/frontend/src/components/ai-elements/prompt-input.tsx+++ b/autogpt_platform/frontend/src/components/ai-elements/prompt-input.tsx@@ -4,9 +4,10 @@* Adapted from AI SDK Elements `prompt-input` component.* @see https://elements.ai-sdk.dev/components/prompt-input*- * Stripped down to only the sub-components used by the copilot ChatInput:- * PromptInput, PromptInputBody, PromptInputTextarea, PromptInputFooter,- * PromptInputTools, PromptInputButton, PromptInputSubmit.+ * Stripped down to the sub-components the copilot ChatInput builds on:+ * PromptInput, PromptInputTextarea, PromptInputButton, PromptInputSubmit.+ * The composer lays out its own rows, so the Body/Footer/Tools wrappers no+ * longer live here.*/import type { ChatStatus } from "ai";@@ -21,7 +22,6 @@ import type {import {InputGroup,- InputGroupAddon,InputGroupButton,InputGroupTextarea,} from "@/components/ui/input-group";@@ -32,7 +32,13 @@ import {TooltipTrigger,} from "@/components/ui/tooltip";import { cn } from "@/lib/utils";-import { Children, useCallback, useEffect, useRef, useState } from "react";+import {+ Children,+ useCallback,+ useLayoutEffect,+ useRef,+ useState,+} from "react";import { ArrowUp02Icon, StopIcon } from "@hugeicons/core-free-icons";import { Icon as UIIcon } from "@/components/atoms/Icon/Icon";@@ -85,23 +91,33 @@ export function PromptInput({);}-// ============================================================================-// PromptInputBody — content wrapper-// ============================================================================--export type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;--export function PromptInputBody({ className, ...props }: PromptInputBodyProps) {- return <div className={cn("contents", className)} {...props} />;-}-// ============================================================================// PromptInputTextarea — auto-resize textarea with Enter-to-submit// ============================================================================export type PromptInputTextareaProps = ComponentProps<typeof InputGroupTextarea->;+> & {+ /** Reports whether the content now spans more than one line, so a host can+ * switch between single-row and stacked composer layouts. Derived from the+ * box's own line-height rather than a shared pixel constant, which cannot+ * survive hosts that restyle the textarea. */+ onMultilineChange?: (isMultiline: boolean) => void;+};++/** True once the content needs a second line. Compared against this box's own+ * computed line-height + padding, so a host's font or padding can change+ * without silently re-tuning the threshold. */+function isWrapped(el: HTMLTextAreaElement, contentHeight: number): boolean {+ const style = getComputedStyle(el);+ const lineHeight = parseFloat(style.lineHeight);+ if (!Number.isFinite(lineHeight) || lineHeight <= 0) return false;+ const padding =+ (parseFloat(style.paddingTop) || 0) ++ (parseFloat(style.paddingBottom) || 0);+ // One pixel of slack absorbs sub-pixel rounding.+ return contentHeight > lineHeight + padding + 1;+}export function PromptInputTextarea({onKeyDown,@@ -109,21 +125,56 @@ export function PromptInputTextarea({className,placeholder = "Type your message...",value,+ onMultilineChange,...props}: PromptInputTextareaProps) {const [isComposing, setIsComposing] = useState(false);const textareaRef = useRef<HTMLTextAreaElement | null>(null);+ // Ref keeps autoResize stable inside the memoized change handler while+ // still reaching the latest callback.+ const onMultilineChangeRef = useRef(onMultilineChange);+ onMultilineChangeRef.current = onMultilineChange;function autoResize(el: HTMLTextAreaElement) {el.style.height = "auto";- el.style.height = `${el.scrollHeight}px`;+ // A host min-height floors scrollHeight (the hero composer sets 4.5rem),+ // so an empty box would report its minimum and read as already wrapped.+ // Measure the content with the floor lifted, then hand the box back.+ const ownMinHeight = el.style.minHeight;+ el.style.minHeight = "0";+ const contentHeight = el.scrollHeight;+ el.style.minHeight = ownMinHeight;+ el.style.height = `${contentHeight}px`;+ onMultilineChangeRef.current?.(isWrapped(el, contentHeight));}- // Resize when value changes externally (e.g. cleared after send)- useEffect(() => {+ // Resize when value changes externally (e.g. a guided prompt dropped in,+ // or cleared after send). Runs before paint: typing resizes synchronously+ // in handleChange, but a value set from outside would otherwise paint one+ // frame at the old height — visible as a jump when the host restyles+ // itself around a now-multiline box.+ useLayoutEffect(() => {if (textareaRef.current) autoResize(textareaRef.current);}, [value]);+ // Width changes rewrap the same text — a narrowing viewport, or a panel+ // opening beside the composer — so the box must re-measure without the+ // value moving. Only width is acted on: autoResize sets the height itself,+ // so reacting to height would loop.+ useLayoutEffect(() => {+ const el = textareaRef.current;+ if (!el) return;+ let lastWidth = -1;+ const observer = new ResizeObserver((entries) => {+ const width = entries[0]?.contentRect.width ?? 0;+ if (width === lastWidth) return;+ lastWidth = width;+ autoResize(el);+ });+ observer.observe(el);+ return () => observer.disconnect();+ }, []);+const handleChange = useCallback((e: React.ChangeEvent<HTMLTextAreaElement>) => {autoResize(e.currentTarget);@@ -173,46 +224,6 @@ export function PromptInputTextarea({);}-// ============================================================================-// PromptInputFooter — bottom bar-// ============================================================================--export type PromptInputFooterProps = Omit<- ComponentProps<typeof InputGroupAddon>,- "align"->;--export function PromptInputFooter({- className,- ...props-}: PromptInputFooterProps) {- return (- <InputGroupAddon- align="block-end"- className={cn("justify-between gap-1", className)}- {...props}- />- );-}--// ============================================================================-// PromptInputTools — left-side button group-// ============================================================================--export type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;--export function PromptInputTools({- className,- ...props-}: PromptInputToolsProps) {- return (- <div- className={cn("flex min-w-0 items-center gap-1", className)}- {...props}- />- );-}-// ============================================================================// PromptInputButton — tool button with optional tooltip// ============================================================================diff --git a/autogpt_platform/frontend/src/components/atoms/Badge/Badge.tsx b/autogpt_platform/frontend/src/components/atoms/Badge/Badge.tsxindex 012b026d0d..1466b19fa2 100644--- a/autogpt_platform/frontend/src/components/atoms/Badge/Badge.tsx+++ b/autogpt_platform/frontend/src/components/atoms/Badge/Badge.tsx@@ -11,15 +11,15 @@ interface BadgeProps {}const badgeVariants: Record<BadgeVariant, string> = {- success: "bg-green-100 text-green-800",- error: "bg-red-100 text-red-800",- warning: "bg-amber-100 text-amber-800",- info: "bg-slate-50 text-black",+ success: "bg-emerald-50 text-emerald-700 ring-emerald-600/20",+ error: "bg-red-50 text-red-700 ring-red-600/10",+ warning: "bg-amber-50 text-amber-800 ring-amber-500/20",+ info: "bg-zinc-50 text-zinc-600 ring-zinc-500/10",};const badgeSizes: Record<BadgeSize, string> = {- small: "px-[6px] py-[3px] text-[0.55rem] leading-4 tracking-widest",- medium: "px-[9px] py-[3px] text-[0.6785rem] leading-5 tracking-wider",+ small: "px-1.5 py-0.5 text-[11px] leading-4",+ medium: "px-2 py-0.5 text-xs leading-5",};export function Badge({@@ -31,15 +31,9 @@ export function Badge({return (<spanclassName={cn(- // Base styles from Figma- "inline-flex items-center gap-2 rounded-[45px]",- // Text styles- "font-sans font-medium uppercase",- // Text overflow handling+ "inline-flex items-center gap-1.5 rounded-md font-sans font-medium ring-1 ring-inset","overflow-hidden text-ellipsis",- // Size stylesbadgeSizes[size],- // Variant stylesbadgeVariants[variant],className,)}diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsxindex 7a88ef8f3f..c71df26650 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx@@ -34,7 +34,7 @@ import {FlowIcon,Folder01Icon,GridViewIcon,- Home01Icon,+ Home10Icon,NoteEditIcon,Store01Icon,UserGroup02Icon,@@ -56,7 +56,7 @@ const MAIN_LINKS: NavLink[] = [// /home 404s without the experts flag, so the entry only exists for the// cohort that has a home to go to.-const HOME_LINK: NavLink = { name: "Home", href: "/home", icon: Home01Icon };+const HOME_LINK: NavLink = { name: "Home", href: "/home", icon: Home10Icon };const WORKSPACE_LINKS: NavLink[] = [{ name: "Files", href: "/artifacts", icon: Folder01Icon },diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/ExpertChatGroup/ExpertChatGroup.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/ExpertChatGroup/ExpertChatGroup.tsxindex d860eb4612..6ae31ed25f 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/ExpertChatGroup/ExpertChatGroup.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/ExpertChatGroup/ExpertChatGroup.tsx@@ -93,7 +93,11 @@ export function ExpertChatGroup({}function GroupBody({ children }: { children: ReactNode }) {+ // A hard border reads heavier than the rail deserves — a 1px gradient+ // strip fades out toward the bottom instead.return (- <div className="ml-[17px] border-l border-zinc-200 pl-1.5">{children}</div>+ <div className="relative ml-[17px] pl-1.5 before:absolute before:inset-y-0 before:left-0 before:w-px before:bg-gradient-to-b before:from-zinc-200/70 before:to-transparent">+ {children}+ </div>);}diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsxindex d3d7cc4ef6..28a854c94a 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx@@ -155,11 +155,7 @@ export function RecentChatItem({<DropdownMenu><DropdownMenuTrigger asChild>- <SidebarMenuAction- showOnHover- aria-label="Chat actions"- className="border border-zinc-200 bg-white"- >+ <SidebarMenuAction showOnHover aria-label="Chat actions"><Iconicon={MoreHorizontalIcon}className="text-sidebar-foreground/90"