fix overflowing model names in settings genai widget

This commit is contained in:
Josh Hawkins
2026-07-17 07:06:44 -05:00
parent 9105ecf363
commit bb642f4f46
@@ -227,16 +227,18 @@ export function GenAIModelWidget(props: WidgetProps) {
aria-expanded={open} aria-expanded={open}
disabled={disabled || readonly} disabled={disabled || readonly}
className={cn( className={cn(
"justify-between font-normal", "min-w-0 justify-between font-normal",
!currentLabel && "text-muted-foreground", !currentLabel && "text-muted-foreground",
fieldClassName, fieldClassName,
)} )}
> >
<span className="truncate">
{currentLabel ?? {currentLabel ??
t("configForm.genaiModel.placeholder", { t("configForm.genaiModel.placeholder", {
ns: "views/settings", ns: "views/settings",
defaultValue: "Select or enter a model…", defaultValue: "Select or enter a model…",
})} })}
</span>
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" /> <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
@@ -263,12 +265,14 @@ export function GenAIModelWidget(props: WidgetProps) {
value={trimmedSearch} value={trimmedSearch}
onSelect={() => commit(trimmedSearch)} onSelect={() => commit(trimmedSearch)}
> >
<Plus className="mr-2 h-4 w-4" /> <Plus className="mr-2 h-4 w-4 shrink-0" />
<span className="truncate">
{t("configForm.genaiModel.useCustom", { {t("configForm.genaiModel.useCustom", {
ns: "views/settings", ns: "views/settings",
value: trimmedSearch, value: trimmedSearch,
defaultValue: 'Use "{{value}}"', defaultValue: 'Use "{{value}}"',
})} })}
</span>
</CommandItem> </CommandItem>
</CommandGroup> </CommandGroup>
)} )}
@@ -287,11 +291,11 @@ export function GenAIModelWidget(props: WidgetProps) {
> >
<Check <Check
className={cn( className={cn(
"mr-2 h-4 w-4", "mr-2 h-4 w-4 shrink-0",
value === model ? "opacity-100" : "opacity-0", value === model ? "opacity-100" : "opacity-0",
)} )}
/> />
{model} <span className="truncate">{model}</span>
</CommandItem> </CommandItem>
))} ))}
</CommandGroup> </CommandGroup>