From 9cdc6e301344f7de1a4ea7824cb4bb9ca9027abb Mon Sep 17 00:00:00 2001 From: Eduard Gert Date: Thu, 18 Jun 2026 09:24:26 +0200 Subject: [PATCH] add a11y keys --- .../src/components/CopyToClipboard.tsx | 11 ++++ .../src/components/LanguagePicker.tsx | 28 ++++++++-- .../src/components/ManagementServerSwitch.tsx | 8 ++- .../ui/frontend/src/components/SquareIcon.tsx | 1 + .../frontend/src/components/VerticalTabs.tsx | 11 ++-- .../src/components/buttons/Button.tsx | 12 ++++- .../src/components/dialog/ConfirmDialog.tsx | 12 ++++- .../src/components/dialog/ConfirmModal.tsx | 12 ++++- .../frontend/src/components/dialog/Dialog.tsx | 20 +++++-- .../src/components/dialog/DialogHeading.tsx | 13 +++-- .../empty-state/DaemonOutdatedOverlay.tsx | 4 +- .../src/components/inputs/SearchInput.tsx | 19 +++++-- .../components/switches/FancyToggleSwitch.tsx | 52 ++++++++++++------- .../components/switches/SwitchItemGroup.tsx | 6 +++ .../src/components/switches/ToggleSwitch.tsx | 3 +- .../frontend/src/contexts/ViewModeContext.tsx | 4 +- client/ui/frontend/src/lib/errors.ts | 3 +- .../src/modules/error/ErrorDialog.tsx | 6 ++- .../login/LoginWaitingForBrowserDialog.tsx | 6 ++- .../main/MainConnectionStatusSwitch.tsx | 22 ++++++-- .../src/modules/main/MainExitNodeSwitcher.tsx | 17 ++++-- .../frontend/src/modules/main/MainHeader.tsx | 17 ++++-- .../ui/frontend/src/modules/main/MainPage.tsx | 12 ++++- .../src/modules/main/advanced/Navigation.tsx | 15 +++++- .../main/advanced/networks/NetworkFilters.tsx | 12 +++-- .../main/advanced/networks/Networks.tsx | 45 ++++++---------- .../main/advanced/peers/PeerDetailPanel.tsx | 31 +++++++++-- .../main/advanced/peers/PeerFilters.tsx | 12 +++-- .../src/modules/main/advanced/peers/Peers.tsx | 22 ++++---- .../modules/profiles/ProfileCreationModal.tsx | 11 +++- .../src/modules/profiles/ProfileDropdown.tsx | 37 ++++++++++--- .../src/modules/profiles/ProfilesTab.tsx | 16 ++++-- .../session/SessionExpirationDialog.tsx | 4 +- .../src/modules/settings/SettingsAbout.tsx | 21 +++++--- .../src/modules/settings/SettingsGeneral.tsx | 8 ++- .../modules/settings/SettingsNavigation.tsx | 2 +- .../src/modules/settings/SettingsSSH.tsx | 6 ++- .../src/modules/settings/SettingsSection.tsx | 8 ++- .../settings/SettingsTroubleshooting.tsx | 12 +++-- .../src/modules/welcome/WelcomeDialog.tsx | 9 +++- .../modules/welcome/WelcomeStepManagement.tsx | 4 +- .../src/modules/welcome/WelcomeStepTray.tsx | 4 +- client/ui/i18n/locales/de/common.json | 36 +++++++++++++ client/ui/i18n/locales/en/common.json | 48 +++++++++++++++++ client/ui/i18n/locales/es/common.json | 36 +++++++++++++ client/ui/i18n/locales/fr/common.json | 36 +++++++++++++ client/ui/i18n/locales/hu/common.json | 36 +++++++++++++ client/ui/i18n/locales/it/common.json | 36 +++++++++++++ client/ui/i18n/locales/pt/common.json | 36 +++++++++++++ client/ui/i18n/locales/ru/common.json | 36 +++++++++++++ client/ui/i18n/locales/zh-CN/common.json | 36 +++++++++++++ 51 files changed, 761 insertions(+), 153 deletions(-) diff --git a/client/ui/frontend/src/components/CopyToClipboard.tsx b/client/ui/frontend/src/components/CopyToClipboard.tsx index d04dc3e57..8fcbd77f3 100644 --- a/client/ui/frontend/src/components/CopyToClipboard.tsx +++ b/client/ui/frontend/src/components/CopyToClipboard.tsx @@ -1,4 +1,5 @@ import { useEffect, useRef, useState, type ReactNode } from "react"; +import { useTranslation } from "react-i18next"; import { Check, Copy } from "lucide-react"; import { cn } from "@/lib/cn"; @@ -18,6 +19,7 @@ type CopyToClipboardProps = { iconClassName?: string; alwaysShowIcon?: boolean; variant?: CopyToClipboardVariant; + "aria-label"?: string; }; export const CopyToClipboard = ({ @@ -29,7 +31,9 @@ export const CopyToClipboard = ({ iconClassName, alwaysShowIcon = false, variant = "default", + "aria-label": ariaLabel, }: CopyToClipboardProps) => { + const { t } = useTranslation(); const wrapperRef = useRef(null); const [copied, setCopied] = useState(false); const copyTimer = useRef | null>(null); @@ -55,11 +59,16 @@ export const CopyToClipboard = ({ } }; + const resolvedLabel = + ariaLabel ?? (message ? `${t("common.copy")} ${message}` : t("common.copy")); + return ( @@ -119,11 +130,19 @@ export function LanguagePicker() { )} >
-
- +
+