Feat: Adjust the style of the agent operator form tool #10703 (#10841)

### What problem does this PR solve?

Feat: Adjust the style of the agent operator form tool #10703

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-10-28 19:16:49 +08:00
committed by GitHub
parent 5a200f7652
commit 11247d1a9d
4 changed files with 7 additions and 20 deletions

View File

@ -14,7 +14,7 @@ const TabsList = React.forwardRef<
<TabsPrimitive.List <TabsPrimitive.List
ref={ref} ref={ref}
className={cn( className={cn(
'inline-flex h-10 items-center justify-center rounded-md p-1 ', 'inline-flex h-10 items-center justify-center rounded-md p-1 bg-bg-card',
className, className,
)} )}
{...props} {...props}
@ -29,7 +29,7 @@ const TabsTrigger = React.forwardRef<
<TabsPrimitive.Trigger <TabsPrimitive.Trigger
ref={ref} ref={ref}
className={cn( className={cn(
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-text-title-invert data-[state=active]:text-text-primary data-[state=active]:shadow-sm', 'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-base data-[state=active]:text-text-primary data-[state=active]:shadow-sm',
className, className,
)} )}
{...props} {...props}

View File

@ -66,12 +66,10 @@ export function ToolPopover({ children }: PropsWithChildren) {
<PopoverContent className="w-80 p-4"> <PopoverContent className="w-80 p-4">
<Tabs defaultValue={ToolType.Common}> <Tabs defaultValue={ToolType.Common}>
<TabsList> <TabsList>
<TabsTrigger value={ToolType.Common} className="bg-bg-card"> <TabsTrigger value={ToolType.Common}>
{t('flow.builtIn')} {t('flow.builtIn')}
</TabsTrigger> </TabsTrigger>
<TabsTrigger value={ToolType.MCP} className="bg-bg-card"> <TabsTrigger value={ToolType.MCP}>MCP</TabsTrigger>
MCP
</TabsTrigger>
</TabsList> </TabsList>
<TabsContent value={ToolType.Common}> <TabsContent value={ToolType.Common}>
<ToolCommand <ToolCommand

View File

@ -1,5 +1,4 @@
import { CheckIcon } from 'lucide-react'; import { Checkbox } from '@/components/ui/checkbox';
import { import {
Command, Command,
CommandEmpty, CommandEmpty,
@ -9,7 +8,6 @@ import {
CommandList, CommandList,
} from '@/components/ui/command'; } from '@/components/ui/command';
import { useListMcpServer } from '@/hooks/use-mcp-request'; import { useListMcpServer } from '@/hooks/use-mcp-request';
import { cn } from '@/lib/utils';
import { Operator } from '@/pages/agent/constant'; import { Operator } from '@/pages/agent/constant';
import OperatorIcon from '@/pages/agent/operator-icon'; import OperatorIcon from '@/pages/agent/operator-icon';
import { t } from 'i18next'; import { t } from 'i18next';
@ -68,16 +66,7 @@ function ToolCommandItem({
}: ToolCommandItemProps & PropsWithChildren) { }: ToolCommandItemProps & PropsWithChildren) {
return ( return (
<CommandItem className="cursor-pointer" onSelect={() => toggleOption(id)}> <CommandItem className="cursor-pointer" onSelect={() => toggleOption(id)}>
<div <Checkbox checked={isSelected} />
className={cn(
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
isSelected
? 'bg-primary text-primary-foreground'
: 'opacity-50 [&_svg]:invisible',
)}
>
<CheckIcon className="h-4 w-4" />
</div>
{children} {children}
</CommandItem> </CommandItem>
); );

View File

@ -19,7 +19,7 @@ export function transferOutputs(outputs: Record<string, any>) {
export function Output({ list }: OutputProps) { export function Output({ list }: OutputProps) {
return ( return (
<section className="space-y-2"> <section className="space-y-2">
<div>{t('flow.output')}</div> <div className="text-sm">{t('flow.output')}</div>
<ul> <ul>
{list.map((x, idx) => ( {list.map((x, idx) => (
<li <li