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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] @mui/icons-material in-editor preview #19697

Open
eps1lon opened this issue Feb 14, 2020 · 9 comments
Open

[docs-infra] @mui/icons-material in-editor preview #19697

eps1lon opened this issue Feb 14, 2020 · 9 comments
Labels
discussion new feature New feature or request package: icons Specific to @mui/icons ready to take Help wanted. Guidance available. There is a high chance the change will be accepted scope: docs-infra Specific to the docs-infra product

Comments

@eps1lon
Copy link
Member

eps1lon commented Feb 14, 2020

Summary 馃挕

Having a preview of the icons in the editor is similar to having autocomplete available for the API. Our icons explorer is definitely helpful and better if you need inspiration. But if you know what kind of icon you want then in-editor preview should boost productivity.

Examples 馃寛

  1. link to icons explorer in SvgIcon.d.ts jsdoc
  2. This shows a preview (vscode) when hovering over an imported icon
import SvgIcon from '@material-ui/core/SvgIcon';
/**
 * Preview: ![LockIcon](https://fonts.gstatic.com/s/i/materialicons/lock/v4/24px.svg)
 */
declare const LockIcon: typeof SvgIcon;
export default LockIcon;

credit to @leMaik for the markdown idea.
icon-preview

  1. Show icon preview in autocomplete (probably requires IDE extension)

Motivation 馃敠

Seemed like a useful thing to have to me.

Each of the examples can be explored further and implemented by whomever is looking for some work to do.

@eps1lon eps1lon added discussion docs Improvements or additions to the documentation new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted labels Feb 14, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 14, 2020

It would be slick!

For the markdown path:

  • Do we have a way to improve the contrast of the preview?
  • Would the new comments have a significant impact on the package size on npm? As long as it doesn't make installs timeout, we should be fine.

@eps1lon
Copy link
Member Author

eps1lon commented Feb 14, 2020

Do we have a way to improve the contrast of the preview?

For a particular theme, yes but not in general.

As long as it doesn't make installs timeout, we should be fine.

I have never seen an install timeout due to package size. Since these are compressed repetitive content such as this one should have minor impact.

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 14, 2020

I have never seen an install timeout due to package size. Since these are compressed repetitive content such as this one should have minor impact.

@eps1lon We have had reports about install timeout for this very package in the past: #12432.

@clifntx
Copy link

clifntx commented Feb 28, 2020

I have never seen an install timeout due to package size. Since these are compressed repetitive content such as this one should have minor impact.

@eps1lon We have had reports about install timeout for this very package in the past: #12432.

I am still having this issue when installing @material-ui/icons with yarn. I have to manually set the timeout every time.
yarn add @material-ui/icons --network-timeout 500000

@eps1lon
Copy link
Member Author

eps1lon commented Mar 1, 2020

@eps1lon We have had reports about install timeout for this very package in the past: #12432.

Was it confirmed that this is due to compressed size? And I don't think this would add much compressed size since it's repetitive text.

@mbrookes
Copy link
Member

https://www.streamlinehq.com/dsp

Using: https://github.com/AdobeXD/design-system-package-dsp

And Abode XD extension for VS Code (available 2020-10-20)

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 10, 2020

https://www.streamlinehq.com/dsp

Well, a developer can get the same experience with an iframe extension. Am I missing a major difference?

Capture d鈥檈虂cran 2020-10-10 a虁 22 09 39

@oliviertassinari oliviertassinari changed the title @material-ui/icons in-editor preview @mui/icons-material in-editor preview Nov 9, 2021
@oliviertassinari oliviertassinari added the package: icons Specific to @mui/icons label Nov 9, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 9, 2021

An update on this issue. If we work on it, we would probably need to take 3 constraints into account:

  1. Find an icon color that has high contrast for the IDE, skewing for dark mode (as I assume a lot more frequent than light mode)
  2. Use PNG instead of SVG, per SVG not rendering in Markdown code hover tooltip聽microsoft/vscode#133389 and Use rendered graphics like PNG files instead of SVG in documentation聽#28659
  3. Be careful about the icons package bundle size: Unable to install @mui/material-icons last version聽#12432

@zardoy
Copy link

zardoy commented Mar 4, 2023

IMO It would be ideal to use pngs on dark background in case if light theme in use. is there cdn link to get png instead? In this case its easy to just add links with preview in jsdoc and in this case it would also close vscodeshift/material-ui-snippets#23


oliviertassinari and @jedwards1211 Also I know this might be a little offtopic, but speaking of IDE productivity with MUI icons and #19697 (comment) will you be interested in the following idea:

Change auto-import completions from @mui/icons-material to have Icon ending.

The difference between https://github.com/vscodeshift/mui-snippets is that we can change completions and import codefix returned from TypeScript extension. Attaching a demo:

old new
Screenshot 2023-03-04 at 10 05 53 Screenshot 2023-03-04 at 10 50 42

This way, it is possible to adopt some kind of iframe extension with ui from comment above, so user have to select icons graphically instead of by typing a name first. And then its possible to insert an import using TypeScript native way (if needed).

Also if you have other ideas of imporoving MUI TS completions, would be happy to hear!

P.S. Also speaking of mui-snippets, I recommend to never use babel parser 馃槈

@samuelsycamore samuelsycamore added scope: docs-infra Specific to the docs-infra product and removed docs Improvements or additions to the documentation labels Nov 28, 2023
@samuelsycamore samuelsycamore changed the title @mui/icons-material in-editor preview [material-ui][docs-infra] @mui/icons-material in-editor preview Nov 28, 2023
@samuelsycamore samuelsycamore changed the title [material-ui][docs-infra] @mui/icons-material in-editor preview [docs-infra] @mui/icons-material in-editor preview Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion new feature New feature or request package: icons Specific to @mui/icons ready to take Help wanted. Guidance available. There is a high chance the change will be accepted scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

No branches or pull requests

6 participants