The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop/settings): let searchable-select popovers size to content, not the shrink-wrapped trigger
Teknium2554a16a1dda
diff --git a/apps/desktop/src/app/settings/combobox-input.tsx b/apps/desktop/src/app/settings/combobox-input.tsxindex 63dd426068b..b092bdade5b 100644--- a/apps/desktop/src/app/settings/combobox-input.tsx+++ b/apps/desktop/src/app/settings/combobox-input.tsx@@ -81,7 +81,7 @@ export function ComboboxInput({</PopoverAnchor><PopoverContentalign="start"- className="w-[var(--radix-popover-trigger-width)] p-0"+ className="min-w-(--radix-popover-trigger-width) p-0"onOpenAutoFocus={e => e.preventDefault()}><Command shouldFilter={false}>diff --git a/apps/desktop/src/app/settings/searchable-select.test.tsx b/apps/desktop/src/app/settings/searchable-select.test.tsxindex 61f0d77ffa7..bf4b363cfff 100644--- a/apps/desktop/src/app/settings/searchable-select.test.tsx+++ b/apps/desktop/src/app/settings/searchable-select.test.tsx@@ -83,6 +83,22 @@ describe('SearchableSelect', () => {expect(screen.queryByText('System default')).toBeNull()})+ it('lets the option list size to its content instead of the shrink-wrapped trigger', () => {+ // The trigger shrink-wraps to its current value inside the settings grid+ // (~120px for "Europe/Berlin"); pinning the popover width to it clipped+ // every IANA row after "Africa/A…". The popover may grow to cover a wider+ // trigger, but must never be capped at the trigger's width.+ render(<SearchableSelect onChange={vi.fn()} options={options} value="Europe/Berlin" />)++ fireEvent.click(screen.getByRole('combobox'))++ const content = screen.getByRole('listbox', { hidden: true }).closest('[data-slot="popover-content"]')+ const classes = content?.className.split(/\s+/) ?? []++ expect(classes.some(c => c.startsWith('min-w-') && c.includes('radix-popover-trigger-width'))).toBe(true)+ expect(classes.some(c => /^w-[[(].*radix-popover-trigger-width/.test(c))).toBe(false)+ })+it('shows the placeholder when the value is blank', () => {render(<SearchableSelect onChange={vi.fn()} options={options} placeholder="Search…" value="" />)diff --git a/apps/desktop/src/app/settings/searchable-select.tsx b/apps/desktop/src/app/settings/searchable-select.tsxindex 8f679b48ba2..b557bb000ab 100644--- a/apps/desktop/src/app/settings/searchable-select.tsx+++ b/apps/desktop/src/app/settings/searchable-select.tsx@@ -88,7 +88,11 @@ export function SearchableSelect({<Codicon className="shrink-0 opacity-60" name={open ? 'chevron-up' : 'chevron-down'} size="1rem" /></button></PopoverTrigger>- <PopoverContent align="start" className="w-[var(--radix-popover-trigger-width)] p-0">+ {/* min-w, not w: the trigger shrink-wraps to its current value inside the+ settings grid, so a width pinned to it clipped every IANA row after+ "Africa/A…". The popover keeps its own width and only grows to cover a+ trigger wider than that. */}+ <PopoverContent align="start" className="min-w-(--radix-popover-trigger-width) p-0"><Command filter={rankSearchOption}><CommandInput autoFocus placeholder={placeholder} /><CommandList>