The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): move searchable pickers onto the shared menu variant
brooklyn!0087827510b6
diff --git a/apps/desktop/src/app/capabilities/connectors/category-picker.tsx b/apps/desktop/src/app/capabilities/connectors/category-picker.tsxindex bd201e5134b..aae62d424b5 100644--- a/apps/desktop/src/app/capabilities/connectors/category-picker.tsx+++ b/apps/desktop/src/app/capabilities/connectors/category-picker.tsx@@ -1,7 +1,15 @@import { useRef, useState } from 'react'import { Codicon } from '@/components/ui/codicon'-import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command'+import {+ Command,+ CommandEmpty,+ CommandGroup,+ CommandInput,+ CommandItem,+ CommandItemCheck,+ CommandList+} from '@/components/ui/command'import { controlVariants } from '@/components/ui/control'import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'import { useI18n } from '@/i18n'@@ -45,24 +53,21 @@ export function CategoryPicker({ categories, onChange, value }: CategoryPickerPr<Codicon className="shrink-0 opacity-60" name="chevron-down" size="0.875rem" /></button></PopoverTrigger>- <PopoverContent align="start" className="min-w-(--radix-popover-trigger-width) p-0">- <Command>+ <PopoverContent align="start" className="min-w-(--radix-popover-trigger-width)" variant="menu">+ <Command variant="menu"><CommandInput autoFocus placeholder={copy.filterCategory} /><CommandList><CommandEmpty>{copy.tools.noMatch}</CommandEmpty><CommandGroup><CommandItem onSelect={() => pick(null)} value={copy.categoryAll}>- <Codicon className={cn('mr-2 size-4', value === null ? 'opacity-100' : 'opacity-0')} name="check" />- {copy.categoryAll}+ <span className="min-w-0 flex-1 truncate">{copy.categoryAll}</span>+ <CommandItemCheck checked={value === null} /></CommandItem>{categories.map(entry => (<CommandItem key={entry.value} onSelect={() => pick(entry.value)} value={labelFor(entry.value)}>- <Codicon- className={cn('mr-2 size-4', entry.value === value ? 'opacity-100' : 'opacity-0')}- name="check"- /><span className="min-w-0 flex-1 truncate">{labelFor(entry.value)}</span>- <span className="ml-2 shrink-0 tabular-nums text-(--ui-text-tertiary)">{entry.count}</span>+ <span className="shrink-0 tabular-nums text-(--ui-text-tertiary)">{entry.count}</span>+ <CommandItemCheck checked={entry.value === value} /></CommandItem>))}</CommandGroup>diff --git a/apps/desktop/src/app/chat/sidebar/projects/base-branch-picker.tsx b/apps/desktop/src/app/chat/sidebar/projects/base-branch-picker.tsxindex f07a3c04310..6bcb56eb6b0 100644--- a/apps/desktop/src/app/chat/sidebar/projects/base-branch-picker.tsx+++ b/apps/desktop/src/app/chat/sidebar/projects/base-branch-picker.tsx@@ -3,7 +3,15 @@ import { useCallback, useEffect, useMemo, useState } from 'react'import { Button } from '@/components/ui/button'import { Codicon } from '@/components/ui/codicon'-import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command'+import {+ Command,+ CommandEmpty,+ CommandGroup,+ CommandInput,+ CommandItem,+ CommandItemCheck,+ CommandList+} from '@/components/ui/command'import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'import type { HermesGitBaseBranch } from '@/global'import { useI18n } from '@/i18n'@@ -119,10 +127,17 @@ export function BaseBranchPicker({<span className="shrink-0">{parts.after}</span></Button></PopoverTrigger>- <PopoverContent align="start" className="z-(--z-modal-popover) min-w-(--radix-popover-trigger-width) p-0">- <Command filter={(searchValue, search) => (searchValue.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}>+ <PopoverContent+ align="start"+ className="z-(--z-modal-popover) min-w-(--radix-popover-trigger-width)"+ variant="menu"+ >+ <Command+ filter={(searchValue, search) => (searchValue.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}+ variant="menu"+ ><CommandInput autoFocus placeholder={p.baseBranchPlaceholder} />- <CommandList className="max-h-64">+ <CommandList><CommandEmpty>{p.baseBranchNone}</CommandEmpty><CommandGroup>{sorted.map(branch => (@@ -134,20 +149,14 @@ export function BaseBranchPicker({}}value={branch.name}>- <div className="flex items-center justify-start gap-1.5">- <Codicon- className="shrink-0 text-(--ui-text-tertiary)"- name={branch.isRemote ? 'repo' : 'git-branch'}- size="0.8rem"- />- {branch.isDefault && (- <span className="ml-auto shrink-0 text-[0.625rem] text-(--ui-text-tertiary)">★</span>- )}- <span className="truncate">{branch.name}</span>- {value === branch.name && (- <Codicon className="ml-auto shrink-0 text-(--ui-accent)" name="check" size="0.8rem" />- )}- </div>+ <Codicon+ className="shrink-0 text-(--ui-text-tertiary)"+ name={branch.isRemote ? 'repo' : 'git-branch'}+ size="0.8rem"+ />+ <span className="truncate">{branch.name}</span>+ {branch.isDefault && <span className="shrink-0 text-[0.625rem] text-(--ui-text-tertiary)">★</span>}+ <CommandItemCheck checked={value === branch.name} /></CommandItem>))}</CommandGroup>diff --git a/apps/desktop/src/app/chat/sidebar/projects/worktree-dialog.tsx b/apps/desktop/src/app/chat/sidebar/projects/worktree-dialog.tsxindex 22ef952ab41..75904e83b25 100644--- a/apps/desktop/src/app/chat/sidebar/projects/worktree-dialog.tsx+++ b/apps/desktop/src/app/chat/sidebar/projects/worktree-dialog.tsx@@ -3,7 +3,15 @@ import { useCallback, useEffect, useMemo, useState } from 'react'import { Button } from '@/components/ui/button'import { Codicon } from '@/components/ui/codicon'-import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command'+import {+ Command,+ CommandEmpty,+ CommandGroup,+ CommandInput,+ CommandItem,+ CommandItemCheck,+ CommandList+} from '@/components/ui/command'import {Dialog,DialogContent,@@ -242,10 +250,17 @@ export function WorktreeDialog() {<Codicon className="shrink-0 text-(--ui-text-tertiary)" name="chevron-down" size="0.75rem" /></Button></PopoverTrigger>- <PopoverContent align="start" className="z-(--z-modal-popover) min-w-(--radix-popover-trigger-width) p-0">- <Command filter={(value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}>+ <PopoverContent+ align="start"+ className="z-(--z-modal-popover) min-w-(--radix-popover-trigger-width)"+ variant="menu"+ >+ <Command+ filter={(value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}+ variant="menu"+ ><CommandInput autoFocus placeholder={p.worktreeProjectPlaceholder} />- <CommandList className="max-h-64">+ <CommandList><CommandEmpty>{p.worktreeProjectNone}</CommandEmpty><CommandGroup>{projectOptions.map(option => (@@ -263,9 +278,7 @@ export function WorktreeDialog() {><Codicon className="shrink-0 text-(--ui-text-tertiary)" name="repo" size="0.8rem" /><span className="truncate">{option.label}</span>- {option === activeOption && (- <Codicon className="ml-auto shrink-0 text-(--ui-accent)" name="check" size="0.8rem" />- )}+ <CommandItemCheck checked={option === activeOption} /></CommandItem>))}</CommandGroup>diff --git a/apps/desktop/src/app/settings/searchable-select.tsx b/apps/desktop/src/app/settings/searchable-select.tsxindex b557bb000ab..32fcc7e7b49 100644--- a/apps/desktop/src/app/settings/searchable-select.tsx+++ b/apps/desktop/src/app/settings/searchable-select.tsx@@ -1,7 +1,15 @@import { useCallback, useRef, useState } from 'react'import { Codicon } from '@/components/ui/codicon'-import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command'+import {+ Command,+ CommandEmpty,+ CommandGroup,+ CommandInput,+ CommandItem,+ CommandItemCheck,+ CommandList+} from '@/components/ui/command'import { controlVariants } from '@/components/ui/control'import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'import { cn } from '@/lib/utils'@@ -92,22 +100,22 @@ export function SearchableSelect({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 atrigger wider than that. */}- <PopoverContent align="start" className="min-w-(--radix-popover-trigger-width) p-0">- <Command filter={rankSearchOption}>+ <PopoverContent align="start" className="min-w-(--radix-popover-trigger-width)" variant="menu">+ <Command filter={rankSearchOption} variant="menu"><CommandInput autoFocus placeholder={placeholder} /><CommandList><CommandEmpty>{emptyMessage}</CommandEmpty><CommandGroup>{clearLabel && (<CommandItem onSelect={() => handleSelect('')} value={clearLabel}>- <Codicon className={cn('mr-2 size-4', value === '' ? 'opacity-100' : 'opacity-0')} name="check" />- {clearLabel}+ <span className="truncate">{clearLabel}</span>+ <CommandItemCheck checked={value === ''} /></CommandItem>)}{options.map(option => (<CommandItem key={option} onSelect={() => handleSelect(option)} value={option}>- <Codicon className={cn('mr-2 size-4', option === value ? 'opacity-100' : 'opacity-0')} name="check" />- {option}+ <span className="truncate">{option}</span>+ <CommandItemCheck checked={option === value} /></CommandItem>))}</CommandGroup>diff --git a/apps/desktop/src/components/language-switcher.tsx b/apps/desktop/src/components/language-switcher.tsxindex d9f330e1f2e..03dded62a25 100644--- a/apps/desktop/src/components/language-switcher.tsx+++ b/apps/desktop/src/components/language-switcher.tsx@@ -1,13 +1,20 @@import { useState } from 'react'import { Button } from '@/components/ui/button'-import { Command, CommandInput, CommandItem, CommandList } from '@/components/ui/command'+import {+ Command,+ CommandEmpty,+ CommandInput,+ CommandItem,+ CommandItemCheck,+ CommandList+} from '@/components/ui/command'import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet'import { useIsMobile } from '@/hooks/use-mobile'import { type Locale, LOCALE_META, useI18n } from '@/i18n'import { triggerHaptic } from '@/lib/haptics'-import { Check, ChevronDown, Globe } from '@/lib/icons'+import { ChevronDown, Globe } from '@/lib/icons'import { normalize } from '@/lib/text'import { cn } from '@/lib/utils'import { notifyError } from '@/store/notifications'@@ -26,6 +33,8 @@ interface LanguageCommandProps {noResults: stringonSelect: (code: Locale) => voidsearchPlaceholder: string+ /** `menu` inside the desktop popover; the mobile sheet keeps the palette rows. */+ variant?: 'default' | 'menu'}export function LanguageSwitcher({ className, collapsed = false, dropUp = false }: LanguageSwitcherProps) {@@ -102,7 +111,7 @@ export function LanguageSwitcher({ className, collapsed = false, dropUp = falsereturn (<Popover onOpenChange={setOpen} open={open}><PopoverTrigger asChild>{trigger}</PopoverTrigger>- <PopoverContent align="end" className="w-56 p-0" side={dropUp ? 'top' : 'bottom'}>+ <PopoverContent align="end" className="w-56" side={dropUp ? 'top' : 'bottom'} variant="menu"><LanguageCommandallLocales={allLocales}autoFocus@@ -111,6 +120,7 @@ export function LanguageSwitcher({ className, collapsed = false, dropUp = falsenoResults={t.language.noResults}onSelect={code => void selectLocale(code)}searchPlaceholder={t.language.searchPlaceholder}+ variant="menu"/></PopoverContent></Popover>@@ -124,7 +134,8 @@ function LanguageCommand({locale,noResults,onSelect,- searchPlaceholder+ searchPlaceholder,+ variant = 'default'}: LanguageCommandProps) {const [search, setSearch] = useState('')@@ -145,30 +156,27 @@ function LanguageCommand({)return (- <Command className="bg-transparent" shouldFilter={false}>+ <Command className="bg-transparent" shouldFilter={false} variant={variant}><CommandInput autoFocus={autoFocus} onValueChange={setSearch} placeholder={searchPlaceholder} value={search} />- <CommandList className="max-h-80 p-1">- {filtered.length === 0 ? (- <div className="py-6 text-center text-sm text-muted-foreground">{noResults}</div>- ) : (- filtered.map(([code, meta]) => {- const selected = code === locale-- return (- <CommandItem- className={cn(selected ? 'font-medium text-foreground' : 'text-muted-foreground')}- disabled={disabled}- key={code}- onSelect={() => onSelect(code)}- value={code}- >- <Check className={cn('size-3.5 shrink-0 text-primary', !selected && 'invisible')} />- <span className="min-w-0 flex-1 truncate">{meta.name}</span>- <span className="font-mono text-[0.65rem] uppercase text-(--ui-text-tertiary)">{code}</span>- </CommandItem>- )- })- )}+ <CommandList className={variant === 'menu' ? undefined : 'max-h-80 p-1'}>+ <CommandEmpty>{noResults}</CommandEmpty>+ {filtered.map(([code, meta]) => {+ const selected = code === locale++ return (+ <CommandItem+ className={cn(selected && 'font-medium')}+ disabled={disabled}+ key={code}+ onSelect={() => onSelect(code)}+ value={code}+ >+ <span className="min-w-0 flex-1 truncate">{meta.name}</span>+ <span className="font-mono text-[0.65rem] uppercase text-(--ui-text-tertiary)">{code}</span>+ <CommandItemCheck checked={selected} />+ </CommandItem>+ )+ })}</CommandList></Command>)