From cd4ed988cbc3ec2af186fd77566e21ba353cc221 Mon Sep 17 00:00:00 2001 From: Cascade Bot Date: Mon, 2 Mar 2026 12:38:07 +0000 Subject: [PATCH] feat(ui): add info tooltips to all toggles in agent definition editor --- .../settings/agent-definition-editor.tsx | 267 ++++++++++-------- web/src/components/ui/tooltip.tsx | 51 ++++ 2 files changed, 205 insertions(+), 113 deletions(-) create mode 100644 web/src/components/ui/tooltip.tsx diff --git a/web/src/components/settings/agent-definition-editor.tsx b/web/src/components/settings/agent-definition-editor.tsx index 90948ac8..1fcc9fe7 100644 --- a/web/src/components/settings/agent-definition-editor.tsx +++ b/web/src/components/settings/agent-definition-editor.tsx @@ -15,9 +15,16 @@ import { } from '@/components/ui/select.js'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js'; import { Textarea } from '@/components/ui/textarea.js'; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '@/components/ui/tooltip.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import type { inferRouterOutputs } from '@trpc/server'; +import { Info } from 'lucide-react'; import { useEffect, useState } from 'react'; import { ReferencePanel } from './prompt-editor.js'; @@ -69,14 +76,29 @@ const CAPABILITY_GROUPS: Record = // Helper components (shared with form dialog) // ───────────────────────────────────────────────────────────────────────────── +function InfoTooltip({ text }: { text: string }) { + return ( + + + + + + + {text} + + ); +} + function Toggle({ checked, onChange, label, + description, }: { checked: boolean; onChange: (v: boolean) => void; label: string; + description?: string; }) { return (
@@ -97,6 +119,7 @@ function Toggle({ /> {label} + {description && }
); } @@ -343,6 +366,7 @@ function StrategiesSection({ ) } label="Include Review Comments" + description="Adds GetPRComments and ReplyToReviewComment gadgets for PR review interaction." /> @@ -366,26 +390,33 @@ function BackendSection({ checked={def.backend.enableStopHooks} onChange={(v) => setBackend('enableStopHooks', v)} label="Enable Stop Hooks" + description="Checks for uncommitted/unpushed changes before agent finishes. Enable for implementation; disable for planning/review." /> setBackend('needsGitHubToken', v)} label="Needs GitHub Token" + description="Agent receives GitHub token for API access. Required for PR creation and code reviews." /> setBackend('blockGitPush', v)} label="Block Git Push" + description="Prevents direct pushes, requiring cascade-tools for PRs. Disable for existing PR branches." /> setBackend('requiresPR', v)} label="Requires PR" + description="Agent must create a PR for the session to be considered successful." />
- +
+ + +
- +
+ + +
setAgentType(e.target.value)} - placeholder="e.g. implementation, review, debug" - className={agentTypeError ? 'border-destructive' : ''} - /> - {agentTypeError &&

{agentTypeError}

} + {/* Save is only shown for Definition / Raw JSON tabs (not Prompts which has its own save) */} + {activeTab !== 'prompts' && ( + + )} +
- )} - {activeMutation.isError && ( -

{activeMutation.error.message}

- )} + {/* Agent Type input for create mode */} + {!isEdit && ( +
+ + setAgentType(e.target.value)} + placeholder="e.g. implementation, review, debug" + className={agentTypeError ? 'border-destructive' : ''} + /> + {agentTypeError &&

{agentTypeError}

} +
+ )} - {/* Tabs */} - - - Definition - Capabilities - Triggers - {isEdit && Prompts} - Raw JSON - - - - - - - -
-

- Hint -

-
- -