fix(a11y): Add aria-label to Sidebar component (#12728)

This commit is contained in:
huangkevin-apr
2026-02-06 23:32:52 +08:00
committed by GitHub
parent 5c68b10983
commit 8cd8c011b2
3 changed files with 21 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import React from "react";
import { useLocation } from "react-router";
import { useTranslation } from "react-i18next";
import { useGitUser } from "#/hooks/query/use-git-user";
import { UserActions } from "./user-actions";
import { OpenHandsLogoButton } from "#/components/shared/buttons/openhands-logo-button";
@@ -12,10 +13,12 @@ import { ConversationPanelWrapper } from "../conversation-panel/conversation-pan
import { useLogout } from "#/hooks/mutation/use-logout";
import { useConfig } from "#/hooks/query/use-config";
import { displayErrorToast } from "#/utils/custom-toast-handlers";
import { I18nKey } from "#/i18n/declaration";
import { MicroagentManagementButton } from "#/components/shared/buttons/microagent-management-button";
import { cn } from "#/utils/utils";
export function Sidebar() {
const { t } = useTranslation();
const { pathname } = useLocation();
const user = useGitUser();
const { data: config } = useConfig();
@@ -64,6 +67,7 @@ export function Sidebar() {
return (
<>
<aside
aria-label={t(I18nKey.SIDEBAR$NAVIGATION_LABEL)}
className={cn(
"h-[54px] p-3 md:p-0 md:h-[40px] md:h-auto flex flex-row md:flex-col gap-1 bg-base md:w-[75px] md:min-w-[75px] sm:pt-0 sm:px-2 md:pt-[14px] md:px-0",
pathname === "/" && "md:pt-6.5 md:pb-3",

View File

@@ -449,6 +449,7 @@ export enum I18nKey {
BUTTON$REFRESH = "BUTTON$REFRESH",
ERROR$REQUIRED_FIELD = "ERROR$REQUIRED_FIELD",
PLANNER$EMPTY_MESSAGE = "PLANNER$EMPTY_MESSAGE",
SIDEBAR$NAVIGATION_LABEL = "SIDEBAR$NAVIGATION_LABEL",
FEEDBACK$PUBLIC_LABEL = "FEEDBACK$PUBLIC_LABEL",
FEEDBACK$PRIVATE_LABEL = "FEEDBACK$PRIVATE_LABEL",
SIDEBAR$CONVERSATIONS = "SIDEBAR$CONVERSATIONS",

View File

@@ -7182,6 +7182,22 @@
"pt": "Atualmente não há plano para este repositório",
"es": "Actualmente no hay un plan para este repositorio",
"tr": "Şu anda bu depo için bir plan yok"
},
"SIDEBAR$NAVIGATION_LABEL": {
"en": "Sidebar navigation",
"zh-CN": "侧边栏导航",
"zh-TW": "側邊欄導航",
"de": "Seitenleisten-Navigation",
"ko-KR": "사이드바 탐색",
"no": "Navigasjon i sidepanel",
"it": "Navigazione barra laterale",
"pt": "Navegação da barra lateral",
"es": "Navegación de la barra lateral",
"ar": "تنقل الشريط الجانبي",
"fr": "Navigation de la barre latérale",
"tr": "Kenar çubuğu gezintisi",
"ja": "サイドバーのナビゲーション",
"uk": "Навігація бічної панелі"
},
"FEEDBACK$PUBLIC_LABEL": {
"en": "Public",