diff --git a/web/src/components/ui/command.tsx b/web/src/components/ui/command.tsx index 536caf445..698260b41 100644 --- a/web/src/components/ui/command.tsx +++ b/web/src/components/ui/command.tsx @@ -124,7 +124,7 @@ const CommandItem = React.forwardRef< g.options); - let selectedLabel = - flattenedOptions - .flatMap((o) => [o, ...(o.children || [])]) - .find((o) => o.value === value)?.label || ''; + let selectedItem = flattenedOptions + .flatMap((o) => [o, ...(o.children || [])]) + .find((o) => o.value === value); - if (!selectedLabel && value) { - selectedLabel = - findAgentStructuredOutputLabel(value, flattenedOptions)?.label ?? ''; + if (!selectedItem && value) { + selectedItem = findAgentStructuredOutputLabel(value, flattenedOptions); } // Handle clear click @@ -97,25 +100,45 @@ export function GroupedSelectWithSecondaryMenu({ role="combobox" aria-expanded={open} className={cn( - 'w-full justify-between text-sm font-normal', + '!bg-bg-input hover:bg-background border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px] [&_svg]:pointer-events-auto', !value && 'text-muted-foreground', )} > - {selectedLabel || placeholder} -
+ {value ? ( +
+ {get(selectedItem, 'parentLabel')} + / + {selectedItem?.label} +
+ ) : ( + + {placeholder || t('common.selectPlaceholder')} + + )} +
{value && ( - + <> + + + )} - +
- + {options.map((group, idx) => ( @@ -166,7 +189,7 @@ export function GroupedSelectWithSecondaryMenu({
{option.label} diff --git a/web/src/pages/agent/form/components/structured-output-secondary-menu.tsx b/web/src/pages/agent/form/components/structured-output-secondary-menu.tsx index 99ce28c5b..a003bb33a 100644 --- a/web/src/pages/agent/form/components/structured-output-secondary-menu.tsx +++ b/web/src/pages/agent/form/components/structured-output-secondary-menu.tsx @@ -6,6 +6,7 @@ import { } from '@/components/ui/hover-card'; import { cn } from '@/lib/utils'; import { get, isPlainObject } from 'lodash'; +import { ChevronRight } from 'lucide-react'; import { PropsWithChildren, ReactNode, useCallback } from 'react'; type DataItem = { label: ReactNode; value: string; parentLabel?: ReactNode }; @@ -59,8 +60,8 @@ export function StructuredOutputSecondaryMenu({ return ( -
  • - {data.label} +
  • + {data.label}