diff --git a/src/renderer/components/composer/ComposerAddMenu.test.tsx b/src/renderer/components/composer/ComposerAddMenu.test.tsx index 3a8d5291..d9a96752 100644 --- a/src/renderer/components/composer/ComposerAddMenu.test.tsx +++ b/src/renderer/components/composer/ComposerAddMenu.test.tsx @@ -240,7 +240,7 @@ describe("ComposerAddMenu", () => { expect(screen.getByText("Enabled servers stay on for new threads")).toBeInTheDocument(); }); - it("shows a foreground-takeover subtitle for Computer Use inside the submenu", () => { + it("shows a foreground-takeover hint for Computer Use inside the submenu", () => { render( { openMcpSubmenu(); expect(screen.getByText("Computer Use")).toBeInTheDocument(); + // The explanation moved behind an info-icon tooltip to keep the row compact. expect( - screen.getByText("Takes over the desktop while the agent clicks or types"), + screen.getByRole("button", { + name: "Takes over the desktop while the agent clicks or types", + }), ).toBeInTheDocument(); }); @@ -338,7 +341,7 @@ describe("ComposerAddMenu", () => { expect(screen.getByText("No MCP servers are enabled for this run")).toBeInTheDocument(); }); - it("shows a paired-desktop subtitle for Computer Use in a remote session", () => { + it("shows a paired-desktop hint for Computer Use in a remote session", () => { bridgeMock.isRemoteSession.mockReturnValue(true); render( { }); expect( - screen.getByText("Controls the paired desktop while the agent clicks or types"), + screen.getByRole("button", { + name: "Controls the paired desktop while the agent clicks or types", + }), ).toBeInTheDocument(); }); }); diff --git a/src/renderer/components/composer/ComposerAddMenu.tsx b/src/renderer/components/composer/ComposerAddMenu.tsx index 34e74dce..9b881000 100644 --- a/src/renderer/components/composer/ComposerAddMenu.tsx +++ b/src/renderer/components/composer/ComposerAddMenu.tsx @@ -3,6 +3,7 @@ import { ChevronLeft, ChevronRight, FlaskConical, + Info, Monitor, Paperclip, Plus, @@ -10,7 +11,7 @@ import { Settings2, } from "lucide-react"; import type { Selection } from "@heroui/react"; -import { Dropdown, Label, Separator } from "@heroui/react"; +import { Dropdown, Label, Separator, Tooltip } from "@heroui/react"; import { Trans, useLingui } from "@lingui/react/macro"; import { isRemoteSession } from "@/renderer/bridge"; import { Button } from "@/renderer/components/common/Button"; @@ -82,6 +83,27 @@ function MenuSwitch(props: { checked: boolean; readOnly?: boolean }) { const readOnlyRowClassName = "flex min-h-7 cursor-default items-center gap-2 rounded px-2 py-0.5 text-xs text-foreground"; +/** + * Compact info affordance for a menu row: the explanation lives in a tooltip + * so long descriptions do not stretch the menu. The press is swallowed so + * hitting the icon does not toggle the surrounding row. + */ +function InfoHint(props: { text: string }) { + return ( + + event.stopPropagation()} + onPointerDown={(event) => event.stopPropagation()} + > + + + {props.text} + + ); +} + export function ComposerAddMenu(props: { mcpServers: readonly ComposerMcpMenuItem[]; /** User-configured servers (global + workspace) listed after the built-ins. */ @@ -124,9 +146,10 @@ export function ComposerAddMenu(props: { // Read-only mode keeps the MCP entry visible even with nothing enabled so // the user gets an explicit "none for this run" answer instead of a missing row. const hasMcpMenu = hasMcpRows || readOnly; - const computerUseSubtitle = isRemoteSession() + const computerUseHint = isRemoteSession() ? t`Controls the paired desktop while the agent clicks or types` : t`Takes over the desktop while the agent clicks or types`; + const experimentHint = t`Run one prompt with multiple agents, then compare their work.`; // Counts every enabled row the submenu shows, Computer Use included — it is // not a registry entry but it renders as one of the switches, so leaving it @@ -219,14 +242,10 @@ export function ComposerAddMenu(props: { onClick={() => experiment.onToggle(!experiment.enabled)} > - - - Experiment - - - Run one prompt with multiple agents, then compare their work. - + + Experiment + ) : null} @@ -318,12 +337,10 @@ export function ComposerAddMenu(props: { {showComputerUse && readOnly ? (
- - - Computer Use - - {computerUseSubtitle} + + Computer Use +
) : null} @@ -335,12 +352,10 @@ export function ComposerAddMenu(props: { onClick={() => computerUse.onToggle(!computerUse.enabled)} > - - - Computer Use - - {computerUseSubtitle} + + Computer Use + ) : null} @@ -398,14 +413,10 @@ export function ComposerAddMenu(props: { isDisabled={experiment.disabled} > -
- - - Run one prompt with multiple agents, then compare their work. - -
+ + ) : null} @@ -460,15 +471,11 @@ export function ComposerAddMenu(props: { ))} {showComputerUse ? (
- -
- - Computer Use - - - {computerUseSubtitle} - -
+ + + Computer Use + +
) : null} @@ -512,15 +519,11 @@ export function ComposerAddMenu(props: { ))} {showComputerUse ? ( - -
- - - {computerUseSubtitle} - -
+ + +
) : null}