Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review how we use SVGs (icons) #3848

Closed
4 tasks done
sroy3 opened this issue May 9, 2023 · 0 comments · Fixed by #3871
Closed
4 tasks done

Review how we use SVGs (icons) #3848

sroy3 opened this issue May 9, 2023 · 0 comments · Fixed by #3871
Assignees

Comments

@sroy3
Copy link
Contributor

sroy3 commented May 9, 2023

As seen in #3844, the Codicons can get updated occasionally. That means we can get new icons (not much of a problem if we aren't using these yet), or some icons get changed (more of a problem if we are using any of these). We are not using these icons directly, and we must convert them to React components and import them into our codebase. We could use them directly, but we use this method to stay consistent with our other icons (check, chevrons, clock, copy, dots, down arrow, lines, pin, up arrow).

We have tools to help us with our icons (SVGR with a script and a Storybook story with all the icons). None of these tools work automatically at the moment.

We should change a few things to make working with icons and Codicons easy.

  • First, we should clean up our custom icons. There might be some we don't use in there and some we could directly import from Codicons. There are two places to do so. The first place is the icons directory at the root of the web view. The other one is the generated React components directory icons in the shared components of the web view. We could also remove one of the chevrons and one of the arrows to rotate them in CSS instead. (Cleanup icons #3871 )

  • Second, the script used by SVGR should have a clear list of the icons we want from Codicons and re-generate them (as a post-install script, maybe?) so that we can stay up to date. We could also import every Codicon into our codebase. Still, we need to ensure they do not all get included in our releases if we don't use them, as they will add unnecessary weight to our distribution files. (Read and transform svg icons from list #3872)

  • Third, the Storybook story should not be updated manually every time we add a new icon. Instead, the Storybook story should generate itself from the icons in the shared components directory. This way, we always get an up-to-date representation of the available icons. (Automatically add new icons to the icons story in Storybook #3873)

  • Lastly, if we do not import every Codicon in our codebase, adding a second Storybook story to visualize the available icons from Codicons before importing them could help select the right new icon. (Add available codicons to Storybook #3874)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant