File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
src/frontend/apps/impress/src/features/left-panel/components Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ and this project adheres to
1818 - ♿ add pdf outline property to enable bookmarks display #1368
1919 - ♿ hide decorative icons from assistive tech with aria-hidden #1404
2020 - ♿ remove redundant aria-label to avoid over-accessibility #1420
21+ - ♿ improve semantic structure and aria roles of leftpanel #1431
2122
2223### Fixed
2324
Original file line number Diff line number Diff line change @@ -49,8 +49,6 @@ export const LeftPanelTargetFilters = () => {
4949
5050 return (
5151 < Box
52- as = "nav"
53- aria-label = { t ( 'Document sections' ) }
5452 $justify = "center"
5553 $padding = { { horizontal : 'sm' } }
5654 $gap = { spacingsTokens [ '2xs' ] }
Original file line number Diff line number Diff line change 11import { usePathname } from 'next/navigation' ;
22import { useEffect } from 'react' ;
3+ import { useTranslation } from 'react-i18next' ;
34import { createGlobalStyle , css } from 'styled-components' ;
45
56import { Box , SeparatedSection } from '@/components' ;
@@ -22,6 +23,7 @@ const MobileLeftPanelStyle = createGlobalStyle`
2223
2324export const LeftPanel = ( ) => {
2425 const { isDesktop } = useResponsiveStore ( ) ;
26+ const { t } = useTranslation ( ) ;
2527
2628 const { colorsTokens, spacingsTokens } = useCunninghamTheme ( ) ;
2729 const { togglePanel, isPanelOpen } = useLeftPanelStore ( ) ;
@@ -45,6 +47,8 @@ export const LeftPanel = () => {
4547 border-right: 1px solid ${ colorsTokens [ 'greyscale-200' ] } ;
4648 ` }
4749 className = "--docs--left-panel-desktop"
50+ as = "nav"
51+ aria-label = { t ( 'Document sections' ) }
4852 >
4953 < Box
5054 $css = { css `
@@ -77,6 +81,8 @@ export const LeftPanel = () => {
7781 >
7882 < Box
7983 data-testid = "left-panel-mobile"
84+ as = "nav"
85+ aria-label = { t ( 'Document sections' ) }
8086 $css = { css `
8187 width : 100% ;
8288 justify-content : center;
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ export const LeftPanelFavorites = () => {
2424
2525 return (
2626 < Box
27- as = "nav "
28- aria-label = { t ( 'Pinned documents' ) }
27+ as = "section "
28+ aria-labelledby = "pinned-docs-title"
2929 className = "--docs--left-panel-favorites"
3030 >
3131 < HorizontalSeparator $withPadding = { false } />
@@ -41,6 +41,7 @@ export const LeftPanelFavorites = () => {
4141 $variation = "700"
4242 $padding = { { horizontal : '3xs' } }
4343 $weight = "700"
44+ id = "pinned-docs-title"
4445 >
4546 { t ( 'Pinned documents' ) }
4647 </ Text >
You can’t perform that action at this time.
0 commit comments