diff --git a/client/ui/frontend/src/components/DropdownMenu.tsx b/client/ui/frontend/src/components/DropdownMenu.tsx index 8cedcea03..aa3ced05f 100644 --- a/client/ui/frontend/src/components/DropdownMenu.tsx +++ b/client/ui/frontend/src/components/DropdownMenu.tsx @@ -1,6 +1,6 @@ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { cva } from "class-variance-authority"; -import { Check, ChevronRight, Circle } from "lucide-react"; +import { Check, ChevronRight } from "lucide-react"; import * as React from "react"; import { cn } from "@/lib/cn"; @@ -159,19 +159,23 @@ const DropdownMenuRadioItem = React.forwardRef< - + {children} + - + - {children} )); DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName; diff --git a/client/ui/frontend/src/components/LanguagePicker.tsx b/client/ui/frontend/src/components/LanguagePicker.tsx index 35ef7d5b5..d0a95906f 100644 --- a/client/ui/frontend/src/components/LanguagePicker.tsx +++ b/client/ui/frontend/src/components/LanguagePicker.tsx @@ -89,7 +89,11 @@ export function LanguagePicker() { tabIndex={0} disabled={busy || languages.length === 0} onKeyDown={handleTriggerKeyDown} - aria-label={t("settings.general.language.label")} + aria-label={ + current + ? `${t("settings.general.language.label")}: ${labelFor(current)}` + : t("settings.general.language.label") + } aria-haspopup={"listbox"} aria-expanded={open} className={cn( diff --git a/client/ui/frontend/src/components/ThemePicker.tsx b/client/ui/frontend/src/components/ThemePicker.tsx index c3dc70d1e..3acb11a99 100644 --- a/client/ui/frontend/src/components/ThemePicker.tsx +++ b/client/ui/frontend/src/components/ThemePicker.tsx @@ -1,18 +1,10 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { ChevronDown, MonitorIcon, MoonIcon, SunMediumIcon, type LucideIcon } from "lucide-react"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, -} from "@/components/DropdownMenu"; +import { MonitorIcon, MoonIcon, SunMediumIcon, type LucideIcon } from "lucide-react"; +import { Select } from "@/components/inputs/Select"; import { HelpText } from "@/components/typography/HelpText"; import { Label } from "@/components/typography/Label"; import { useTheme, type ThemePreference } from "@/contexts/ThemeContext"; -import { useFocusVisible } from "@/hooks/useFocusVisible"; -import { cn } from "@/lib/cn"; import { errorDialog, formatErrorMessage } from "@/lib/errors"; const OPTIONS: { value: ThemePreference; icon: LucideIcon; labelKey: string }[] = [ @@ -25,16 +17,12 @@ export function ThemePicker() { const { t } = useTranslation(); const { theme, setTheme } = useTheme(); const [busy, setBusy] = useState(false); - const isFocusVisible = useFocusVisible(); - const current = OPTIONS.find((o) => o.value === theme) ?? OPTIONS[0]; - const CurrentIcon = current.icon; - - const select = async (value: string) => { + const select = async (value: ThemePreference) => { if (busy || value === theme) return; setBusy(true); try { - await setTheme(value as ThemePreference); + await setTheme(value); } catch (e) { await errorDialog({ Title: t("settings.error.saveTitle"), @@ -52,57 +40,17 @@ export function ThemePicker() { {t("settings.general.theme.help")}
- - - - - - void select(v)}> - {OPTIONS.map(({ value, icon: Icon, labelKey }) => ( - - - {t(labelKey)} - - ))} - - - + ({ + value, + icon, + label: t(`settings.troubleshooting.anonymize.${value}`), + }))} + onChange={setAnonymizeLevel} + ariaLabel={t("settings.troubleshooting.anonymize.label")} + />