From a47caa4ff9069dea44742d6eb68517c24925e439 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Fri, 26 Jun 2026 14:37:21 +0700 Subject: [PATCH] refactor(settings): use InputGroup for the model combobox input+trigger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FormModelComboboxItem manually glued an Input and a dropdown Button by stripping adjacent borders/corners and juggling z-index on focus/hover. Replace that with the project's InputGroup primitive (single border, ghost trigger, native group focus-ring) — matching InputPassword and the ~20 other input-group usages. Also gives the icon-only trigger an accessible name. Verified live (vite dev against the docker backend): input editable, dropdown opens via the asChild trigger, option/price autofill intact. Co-Authored-By: Claude Opus 4.8 --- .../src/pages/settings/settings-provider.tsx | 157 +++++++++--------- 1 file changed, 77 insertions(+), 80 deletions(-) diff --git a/frontend/src/pages/settings/settings-provider.tsx b/frontend/src/pages/settings/settings-provider.tsx index 25d56b22..0cc0d6a4 100644 --- a/frontend/src/pages/settings/settings-provider.tsx +++ b/frontend/src/pages/settings/settings-provider.tsx @@ -57,6 +57,7 @@ import { import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'; import { FormSubmitButton } from '@/components/ui/form-submit-button'; import { Input } from '@/components/ui/input'; +import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '@/components/ui/input-group'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; @@ -438,10 +439,8 @@ function FormModelComboboxItem({ onOpenChange={setIsOpen} open={isOpen} > -
- {/* Input field - main control */} - + { const { value } = event.target; @@ -455,87 +454,85 @@ function FormModelComboboxItem({ placeholder={placeholder} value={displayValue} /> - {/* Dropdown trigger button */} - - - - - - - - -
-

- No {label.toLowerCase()} found. -

- {search && allowCustom && ( - - )} -
-
- - {filteredOptions.map((option) => ( - { - field.onChange(option.name); - onOptionSelect?.(option); + + + + + + + + + + + + + +
+

No {label.toLowerCase()} found.

+ {search && allowCustom && ( +
+
+ + {filteredOptions.map((option) => ( + { + field.onChange(option.name); + onOptionSelect?.(option); + setIsOpen(false); + setSearch(''); + }} + value={option.name} + > +
+
+ {option.name} + {option.thinking && ( + )} - /> - - ))} - - - - -
+
+ + {formatPrice(option.price)} + +
+ + + ))} + + + + {description && {description}}