From 77fe022351ed7319a4a4f6a1f98c798a3e390899 Mon Sep 17 00:00:00 2001 From: Eduard Gert Date: Thu, 18 Jun 2026 10:42:52 +0200 Subject: [PATCH] make main screen accessible --- .../src/components/CopyToClipboard.tsx | 6 +- .../src/components/buttons/IconButton.tsx | 5 +- .../src/components/switches/ToggleSwitch.tsx | 6 +- .../src/contexts/PeerDetailContext.tsx | 33 +++++- .../main/MainConnectionStatusSwitch.tsx | 14 ++- .../src/modules/main/MainExitNodeSwitcher.tsx | 33 +++++- .../src/modules/main/advanced/Navigation.tsx | 46 ++++++- .../main/advanced/networks/NetworkFilters.tsx | 2 + .../main/advanced/networks/Networks.tsx | 69 ++++++++++- .../main/advanced/peers/PeerDetailPanel.tsx | 68 ++++++++++- .../main/advanced/peers/PeerFilters.tsx | 2 + .../src/modules/main/advanced/peers/Peers.tsx | 65 +++++++++- .../src/modules/profiles/ProfileDropdown.tsx | 112 +++++++++++------- 13 files changed, 392 insertions(+), 69 deletions(-) diff --git a/client/ui/frontend/src/components/CopyToClipboard.tsx b/client/ui/frontend/src/components/CopyToClipboard.tsx index 8fcbd77f3..9a4508310 100644 --- a/client/ui/frontend/src/components/CopyToClipboard.tsx +++ b/client/ui/frontend/src/components/CopyToClipboard.tsx @@ -20,6 +20,7 @@ type CopyToClipboardProps = { alwaysShowIcon?: boolean; variant?: CopyToClipboardVariant; "aria-label"?: string; + tabIndex?: number; }; export const CopyToClipboard = ({ @@ -32,6 +33,7 @@ export const CopyToClipboard = ({ alwaysShowIcon = false, variant = "default", "aria-label": ariaLabel, + tabIndex = 0, }: CopyToClipboardProps) => { const { t } = useTranslation(); const wrapperRef = useRef(null); @@ -67,10 +69,12 @@ export const CopyToClipboard = ({ type="button" ref={wrapperRef} onClick={handleClick} + tabIndex={tabIndex} aria-label={resolvedLabel} aria-live="polite" className={cn( - "inline-flex gap-2 items-center group/copy cursor-default wails-no-draggable text-left pointer-events-auto", + "inline-flex gap-2 items-center group/copy cursor-default wails-no-draggable text-left pointer-events-auto rounded-sm outline-none", + "focus-visible:ring-2 focus-visible:ring-white/60 focus-visible:ring-offset-2 focus-visible:ring-offset-nb-gray-940", className, )} > diff --git a/client/ui/frontend/src/components/buttons/IconButton.tsx b/client/ui/frontend/src/components/buttons/IconButton.tsx index c5262bae3..3300d5ee4 100644 --- a/client/ui/frontend/src/components/buttons/IconButton.tsx +++ b/client/ui/frontend/src/components/buttons/IconButton.tsx @@ -9,16 +9,19 @@ type Props = ButtonHTMLAttributes & { }; export const IconButton = forwardRef(function IconButton( - { icon: Icon, iconSize = 17, iconClassName, className, type = "button", ...props }, + { icon: Icon, iconSize = 17, iconClassName, className, type = "button", disabled, ...props }, ref, ) { return (