Skip to content

Commit 4ef5534

Browse files
Enhancement: Accessibility issues on the Welcome page (usebruno#3173)
* fix: accessibility issue in Welcome page - use button tag for collection instead of div - hide decorative image for assistive technology - give meaningful label to links in Links section * enhance: accessibility over the buttons on the welcome page * chore: fix translations --------- Co-authored-by: Shrilakshmi Shastry <[email protected]>
1 parent 641f261 commit 4ef5534

File tree

1 file changed

+46
-19
lines changed
  • packages/bruno-app/src/components/Welcome

1 file changed

+46
-19
lines changed

Diff for: packages/bruno-app/src/components/Welcome/index.js

+46-19
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const Welcome = () => {
2121
const [importCollectionLocationModalOpen, setImportCollectionLocationModalOpen] = useState(false);
2222

2323
const handleOpenCollection = () => {
24-
dispatch(openCollection()).catch(
25-
(err) => console.log(err) && toast.error(t('WELCOME.COLLECTION_OPEN_ERROR'))
26-
);
24+
dispatch(openCollection()).catch((err) => console.log(err) && toast.error(t('WELCOME.COLLECTION_OPEN_ERROR')));
2725
};
2826

2927
const handleImportCollection = ({ collection, translationLog }) => {
@@ -64,48 +62,77 @@ const Welcome = () => {
6462
/>
6563
) : null}
6664

67-
<div>
65+
<div aria-hidden className="">
6866
<Bruno width={50} />
6967
</div>
7068
<div className="text-xl font-semibold select-none">bruno</div>
7169
<div className="mt-4">{t('WELCOME.ABOUT_BRUNO')}</div>
7270

7371
<div className="uppercase font-semibold heading mt-10">{t('COMMON.COLLECTIONS')}</div>
7472
<div className="mt-4 flex items-center collection-options select-none">
75-
<div className="flex items-center" onClick={() => setCreateCollectionModalOpen(true)}>
76-
<IconPlus size={18} strokeWidth={2} />
73+
<button
74+
className="flex items-center"
75+
onClick={() => setCreateCollectionModalOpen(true)}
76+
aria-label={t('WELCOME.CREATE_COLLECTION')}
77+
>
78+
<IconPlus aria-hidden size={18} strokeWidth={2} />
7779
<span className="label ml-2" id="create-collection">
7880
{t('WELCOME.CREATE_COLLECTION')}
7981
</span>
80-
</div>
81-
<div className="flex items-center ml-6" onClick={handleOpenCollection}>
82-
<IconFolders size={18} strokeWidth={2} />
82+
</button>
83+
84+
<button className="flex items-center ml-6" onClick={handleOpenCollection} aria-label="Open Collection">
85+
<IconFolders aria-hidden size={18} strokeWidth={2} />
8386
<span className="label ml-2">{t('WELCOME.OPEN_COLLECTION')}</span>
84-
</div>
85-
<div className="flex items-center ml-6" onClick={() => setImportCollectionModalOpen(true)}>
86-
<IconDownload size={18} strokeWidth={2} />
87+
</button>
88+
89+
<button
90+
className="flex items-center ml-6"
91+
onClick={() => setImportCollectionModalOpen(true)}
92+
aria-label={t('WELCOME.IMPORT_COLLECTION')}
93+
>
94+
<IconDownload aria-hidden size={18} strokeWidth={2} />
8795
<span className="label ml-2" id="import-collection">
8896
{t('WELCOME.IMPORT_COLLECTION')}
8997
</span>
90-
</div>
98+
</button>
9199
</div>
100+
92101
<div className="uppercase font-semibold heading mt-10 pt-6">{t('WELCOME.LINKS')}</div>
93102
<div className="mt-4 flex flex-col collection-options select-none">
94103
<div className="flex items-center mt-2">
95-
<a href="https://docs.usebruno.com" target="_blank" className="inline-flex items-center">
96-
<IconBook size={18} strokeWidth={2} />
104+
<a
105+
href="https://docs.usebruno.com"
106+
aria-label="Read documentation"
107+
target="_blank"
108+
rel="noopener noreferrer"
109+
className="inline-flex items-center"
110+
>
111+
<IconBook aria-hidden size={18} strokeWidth={2} />
97112
<span className="label ml-2">{t('COMMON.DOCUMENTATION')}</span>
98113
</a>
99114
</div>
100115
<div className="flex items-center mt-2">
101-
<a href="https://github.com/usebruno/bruno/issues" target="_blank" className="inline-flex items-center">
102-
<IconSpeakerphone size={18} strokeWidth={2} />
116+
<a
117+
href="https://github.com/usebruno/bruno/issues"
118+
aria-label="Report issues on GitHub"
119+
target="_blank"
120+
rel="noopener noreferrer"
121+
className="inline-flex items-center"
122+
>
123+
<IconSpeakerphone aria-hidden size={18} strokeWidth={2} />
103124
<span className="label ml-2">{t('COMMON.REPORT_ISSUES')}</span>
104125
</a>
105126
</div>
106127
<div className="flex items-center mt-2">
107-
<a href="https://github.com/usebruno/bruno" target="_blank" className="flex items-center">
108-
<IconBrandGithub size={18} strokeWidth={2} />
128+
<a
129+
href="https://github.com/usebruno/bruno"
130+
aria-label="Go to GitHub repository"
131+
target="_blank"
132+
rel="noopener noreferrer"
133+
className="flex items-center"
134+
>
135+
<IconBrandGithub aria-hidden size={18} strokeWidth={2} />
109136
<span className="label ml-2">{t('COMMON.GITHUB')}</span>
110137
</a>
111138
</div>

0 commit comments

Comments
 (0)