Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat(search/svelte): Support more file icons#63181

Merged
fkling merged 8 commits into
mainfrom
fkling/srch-452-support-more-file-icons
Jun 12, 2024
Merged

feat(search/svelte): Support more file icons#63181
fkling merged 8 commits into
mainfrom
fkling/srch-452-support-more-file-icons

Conversation

@fkling

@fkling fkling commented Jun 10, 2024

Copy link
Copy Markdown
Contributor

Closes SRCH-452

Until this commit both the React and Svelte apps have used the same code to determine the correct file icon. That code however still held separate logic for the two apps with the result that our file icon set for the Svelte app was a lot smaller.

This commit separates the logic and now makes use of unplugin-icons in the Svelte app.

I tried to use unplugin-icons in the React so that the code could continued to be shared but I couldn't get it to work.

Note that I didn't use the exact same icons as in the React app. I wanted to minimize the number of different icon sets we are using.

Test plan

Builds without error, manual testing.

@fkling fkling requested a review from a team June 10, 2024 10:36
@fkling fkling self-assigned this Jun 10, 2024
@cla-bot cla-bot Bot added the cla-signed label Jun 10, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my education: it's okay to add aria-hidden to this because the wrapping button has an aria-label on it, so the actual contents of the button are irrelevant to the screenreader, yes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally "images" are part of the accessibility tree and will be "read" by screenreaders. E.g. without aria-hidden it shows up like this in the accessibility tree:

2024-06-12_11-38

With the attribute the "graphics-document" just isn't there. Often icons are just decorative in which case they should be hidden to screenreaders. And yes, the button already has a label and therefore the content is irrelevant.

Alternatively we could have add text inside the button that is only visible to screenreaders, but aria-label seems simpler.

fkling added 8 commits June 12, 2024 15:45
Until this commit both the React and Svelte apps have used the same code
to determine the correct file icon. That code however still held
separate logic for the two apps with the result that our file icon set
for the Svelte app was a lot smaller.

This commit separates the logic and now makes use of `unplugin-icons` in
the Svelte app.

I tried to use `unplugin-icons` in the React so that the code could
continued to be shared but I couldn't get it to work.
@fkling fkling force-pushed the fkling/srch-452-support-more-file-icons branch from 6b9d11f to 81b8ae1 Compare June 12, 2024 13:45
@fkling fkling merged commit 1c28f46 into main Jun 12, 2024
@fkling fkling deleted the fkling/srch-452-support-more-file-icons branch June 12, 2024 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants