Skip to content

Commit ef08ba3

Browse files
committed
✨(frontend) hide decorative icons, label menus, avoid name duplicates
improves a11y by hiding decorative icons, labeling menus and deduping names Signed-off-by: Cyril <[email protected]>
1 parent 7a90304 commit ef08ba3

File tree

15 files changed

+86
-14
lines changed

15 files changed

+86
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to
1515
- #1349
1616
- #1271
1717
- #1341
18+
- #1362
1819

1920
### Changed
2021

src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ test.describe('Document create member', () => {
201201
await page.getByLabel('Reader').click();
202202

203203
const moreActions = userInvitation.getByRole('button', {
204-
name: 'more_horiz',
204+
name: 'Open invitation actions menu',
205205
});
206206
await moreActions.click();
207207

src/frontend/apps/impress/src/components/dropdown-menu/DropdownMenu.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export const DropdownMenu = ({
227227
$theme="greyscale"
228228
$variation={isDisabled ? '400' : '1000'}
229229
iconName={option.icon}
230+
aria-hidden="true"
230231
/>
231232
)}
232233
<Text $variation={isDisabled ? '400' : '1000'}>
@@ -235,7 +236,12 @@ export const DropdownMenu = ({
235236
</Box>
236237
{(option.isSelected ||
237238
selectedValues?.includes(option.value ?? '')) && (
238-
<Icon iconName="check" $size="20px" $theme="greyscale" />
239+
<Icon
240+
iconName="check"
241+
$size="20px"
242+
$theme="greyscale"
243+
aria-hidden="true"
244+
/>
239245
)}
240246
</BoxButton>
241247
{option.showSeparator && (

src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
250250
aria-label={t('Export the document')}
251251
/>
252252
)}
253-
<DropdownMenu options={options}>
253+
<DropdownMenu options={options} label={t('Open the document options')}>
254254
<IconOptions
255+
aria-hidden="true"
255256
isHorizontal
256257
$theme="primary"
257258
$padding={{ all: 'xs' }}
@@ -267,7 +268,6 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
267268
`
268269
: ''}
269270
`}
270-
aria-label={t('Open the document options')}
271271
/>
272272
</DropdownMenu>
273273
</Box>

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareInvitation.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ export const DocShareInvitationItem = ({
118118
<DropdownMenu
119119
data-testid="doc-share-invitation-more-actions"
120120
options={moreActions}
121+
label={t('Open invitation actions menu')}
121122
>
122-
<IconOptions isHorizontal $variation="600" />
123+
<IconOptions isHorizontal $variation="600" aria-hidden="true" />
123124
</DropdownMenu>
124125
)}
125126
</Box>
@@ -158,7 +159,12 @@ export const DocShareModalInviteUserRow = ({
158159
<Text $theme="primary" $variation="800">
159160
{t('Add')}
160161
</Text>
161-
<Icon $theme="primary" $variation="800" iconName="add" />
162+
<Icon
163+
$theme="primary"
164+
$variation="800"
165+
iconName="add"
166+
aria-hidden="true"
167+
/>
162168
</Box>
163169
}
164170
/>

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocTreeItemActions.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const DocTreeItemActions = ({
155155
options={options}
156156
isOpen={isOpen}
157157
onOpenChange={onOpenChange}
158+
aria-label={t('Open document actions menu')}
158159
>
159160
<Icon
160161
onClick={(e) => {
@@ -166,6 +167,7 @@ export const DocTreeItemActions = ({
166167
variant="filled"
167168
$theme="primary"
168169
$variation="600"
170+
aria-hidden="true"
169171
/>
170172
</DropdownMenu>
171173
{doc.abilities.children_create && (

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocGridContentList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export const DraggableDocGridContentList = ({
191191
data-testid="drag-doc-overlay"
192192
$height="auto"
193193
role="alert"
194+
aria-label={t('Drag and drop status')}
194195
>
195196
<Text $size="xs" $variation="000" $weight="500">
196197
{overlayText}

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const DocsGrid = ({
100100
)}
101101
{hasDocs && (
102102
<Box $gap="6px" $overflow="auto">
103-
<Box role="grid">
103+
<Box role="grid" aria-label={t('Documents grid')}>
104104
<Box role="rowgroup">
105105
<Box
106106
$direction="row"

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridActions.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,23 @@ export const DocsGridActions = ({
8383

8484
return (
8585
<>
86-
<DropdownMenu options={options} label={menuLabel}>
86+
<DropdownMenu
87+
options={options}
88+
label={menuLabel}
89+
aria-label={t('More options')}
90+
>
8791
<Icon
8892
data-testid={`docs-grid-actions-button-${doc.id}`}
8993
iconName="more_horiz"
9094
$theme="primary"
9195
$variation="600"
92-
aria-label={t('More options')}
9396
$css={css`
9497
cursor: pointer;
9598
&:hover {
9699
opacity: 0.8;
97100
}
98101
`}
102+
aria-hidden="true"
99103
/>
100104
</DropdownMenu>
101105

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridItem.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
9595
$variation="600"
9696
$size="14px"
9797
iconName={isPublic ? 'public' : 'vpn_lock'}
98+
aria-label={
99+
isPublic
100+
? t('Accessible to anyone')
101+
: t('Accessible to authenticated users')
102+
}
98103
/>
99104
)}
100105
{!dragMode && (
@@ -114,6 +119,11 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
114119
$variation="600"
115120
$size="14px"
116121
iconName={isPublic ? 'public' : 'vpn_lock'}
122+
aria-label={
123+
isPublic
124+
? t('Accessible to anyone')
125+
: t('Accessible to authenticated users')
126+
}
117127
/>
118128
</div>
119129
</Tooltip>

0 commit comments

Comments
 (0)