Skip to content

feat: display descriptions in multi-select component #18730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ import {
CommandItem,
CommandList,
} from "components/Command/Command";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "components/Tooltip/Tooltip";
import { useDebouncedValue } from "hooks/debounce";
import { ChevronDown, X } from "lucide-react";
import { ChevronDown, Info, X } from "lucide-react";
import {
type ComponentProps,
type ComponentPropsWithoutRef,
Expand All @@ -33,6 +39,7 @@ export interface Option {
label: string;
icon?: string;
disable?: boolean;
description?: string;
/** fixed option that can't be removed. */
fixed?: boolean;
/** Group the options by providing key. */
Expand Down Expand Up @@ -662,6 +669,23 @@ export const MultiSelectCombobox = forwardRef<
/>
)}
{option.label}
{option.description && (
<TooltipProvider delayDuration={100}>
<Tooltip>
<TooltipTrigger asChild>
<span className="flex items-center pointer-events-auto">
<Info className="!w-3.5 !h-3.5 text-content-secondary" />
</span>
</TooltipTrigger>
<TooltipContent
side="right"
sideOffset={10}
>
{option.description}
</TooltipContent>
</Tooltip>
</TooltipProvider>
)}
</div>
</CommandItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ const ParameterField: FC<ParameterFieldProps> = ({
value: opt.value.value,
label: opt.name,
icon: opt.icon,
description: opt.description,
disable: false,
}));

Expand Down
Loading