diff --git a/.changeset/fix-settings-search-ui.md b/.changeset/fix-settings-search-ui.md new file mode 100644 index 0000000000..918aba2708 --- /dev/null +++ b/.changeset/fix-settings-search-ui.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +Fixed UI issues in Settings search bar: clipping of results and layout shift when expanding diff --git a/webview-ui/src/components/settings/SettingsSearch.tsx b/webview-ui/src/components/settings/SettingsSearch.tsx index a0cce1fefa..227e09e131 100644 --- a/webview-ui/src/components/settings/SettingsSearch.tsx +++ b/webview-ui/src/components/settings/SettingsSearch.tsx @@ -1,6 +1,7 @@ import { useRef, useEffect, useState, useCallback } from "react" import type { LucideIcon } from "lucide-react" +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" import { useSettingsSearch, SearchResult, SearchableSettingData } from "./useSettingsSearch" import { SectionName } from "./SettingsView" import { SettingsSearchInput } from "./SettingsSearchInput" @@ -98,26 +99,33 @@ export function SettingsSearch({ index, onNavigate, sections }: SettingsSearchPr }, [highlightedResultId, isOpen]) return ( -
- setIsOpen(true)} - onBlur={() => setTimeout(() => setIsOpen(false), 200)} - onKeyDown={handleSearchKeyDown} - inputRef={inputRef} - /> - {searchQuery && isOpen && ( -
- + +
+ setIsOpen(true)} + onKeyDown={handleSearchKeyDown} + inputRef={inputRef} />
- )} -
+ + e.preventDefault()} + onCloseAutoFocus={(e) => e.preventDefault()}> + + + ) } diff --git a/webview-ui/src/components/settings/SettingsSearchInput.tsx b/webview-ui/src/components/settings/SettingsSearchInput.tsx index d1b8566ef9..6e437fa013 100644 --- a/webview-ui/src/components/settings/SettingsSearchInput.tsx +++ b/webview-ui/src/components/settings/SettingsSearchInput.tsx @@ -41,33 +41,39 @@ export function SettingsSearchInput({ const isWide = isExpanded || !!value return ( -
- - onChange(e.target.value)} - onFocus={handleFocus} - onBlur={handleBlur} - onKeyDown={onKeyDown} - placeholder={isWide ? t("settings:search.placeholder") : ""} +
+
+ + onChange(e.target.value)} + onFocus={handleFocus} + onBlur={handleBlur} + onKeyDown={onKeyDown} + placeholder={isWide ? t("settings:search.placeholder") : ""} + className={cn( + "pl-8 h-7 text-sm rounded-full border border-vscode-input-border bg-vscode-input-background focus:border-vscode-focusBorder transition-all duration-200 ease-in-out w-full", + isWide ? "pr-2.5" : "pr-0 cursor-pointer", + value && "pr-7", + )} + /> + {value && ( + )} - /> - {value && ( - - )} +
) }