diff --git a/webui/src/components/settings/SettingsView.tsx b/webui/src/components/settings/SettingsView.tsx index 205cffd7..ab863191 100644 --- a/webui/src/components/settings/SettingsView.tsx +++ b/webui/src/components/settings/SettingsView.tsx @@ -270,6 +270,11 @@ const DEFERRED_MODEL_LIST_PROVIDERS = new Set([ const DEFERRED_MODEL_LIST_QUERY_MIN_LENGTH = 2; const CLI_APPS_REFRESH_RETRY_MS = 2_000; const CLI_APPS_REFRESH_MAX_RETRIES = 30; +const SETTINGS_SEARCH_INPUT_CLASS = cn( + "border-border/45 bg-settings-surface transition-colors hover:border-border/70", + "focus-visible:border-border/70 focus-visible:bg-background", + "focus-visible:ring-0 focus-visible:ring-offset-0", +); const FALLBACK_TIMEZONES = [ "UTC", @@ -2200,23 +2205,12 @@ function SettingsSidebar({ hostChromeInset?: boolean; }) { const { t } = useTranslation(); - const navRef = useRef(null); - const activeItemRef = useRef(null); - - useEffect(() => { - const nav = navRef.current; - const activeItem = activeItemRef.current; - if (!nav || !activeItem || nav.scrollWidth <= nav.clientWidth) return; - const navRect = nav.getBoundingClientRect(); - const itemRect = activeItem.getBoundingClientRect(); - const itemCenter = itemRect.left - navRect.left + nav.scrollLeft + itemRect.width / 2; - const targetLeft = Math.max( - 0, - Math.min(nav.scrollWidth - nav.clientWidth, itemCenter - nav.clientWidth / 2), - ); - const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches; - nav.scrollTo({ left: targetLeft, behavior: reducedMotion ? "auto" : "smooth" }); - }, [activeSection]); + const activeItem = SETTINGS_NAV_ITEMS.find((item) => item.key === activeSection) + ?? SETTINGS_NAV_ITEMS[0]; + const ActiveIcon = activeItem.icon; + const activeLabel = t(`settings.nav.${activeItem.key}`, { + defaultValue: activeItem.fallback, + }); return (