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

[docs] Icons aren't searchable anymore in Algolia #43941

Open
Janpot opened this issue Sep 30, 2024 · 1 comment
Open

[docs] Icons aren't searchable anymore in Algolia #43941

Janpot opened this issue Sep 30, 2024 · 1 comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation package: icons Specific to @mui/icons regression A bug, but worse scope: docs-infra Specific to the docs-infra product

Comments

@Janpot
Copy link
Member

Janpot commented Sep 30, 2024

See #41330 (comment)

Icons used to be searchable in v4

image

But even after reverting the icons virtualization, they still aren't searchable.

Screenshot 2024-09-30 at 09 54 56

Search keywords:

@Janpot Janpot added docs Improvements or additions to the documentation status: waiting for maintainer These issues haven't been looked at yet by a maintainer scope: docs-infra Specific to the docs-infra product and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 30, 2024
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work regression A bug, but worse labels Oct 3, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 5, 2024

It used to work before because of the DOM structure match the crawler

https://v4.mui.com/components/material-icons/

vs.

https://dashboard.algolia.com/apps/TZGZ85B9TB/crawler/crawler/739c29c8-99ea-4945-bd27-17a1df391902/editor

So this should help:

diff --git a/docs/data/material/components/material-icons/SearchIcons.js b/docs/data/material/components/material-icons/SearchIcons.js
index 945dcc038f..ac636e7acd 100644
--- a/docs/data/material/components/material-icons/SearchIcons.js
+++ b/docs/data/material/components/material-icons/SearchIcons.js
@@ -200,7 +200,7 @@ function Icon(props) {
         <div className={SVG_ICON_CLASS} />
       )}
       {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- TODO: a11y */}
-      <div onClick={handleLabelClick}>{icon.importName}</div>
+      <div className="algolia-content" onClick={handleLabelClick}>{icon.importName}</div>
       {/* eslint-enable jsx-a11y/click-events-have-key-events */}
     </StyledIcon>
   );

Another challenge might be: https://docsearch.algolia.com/docs/record-extractor/#reduce-the-number-of-records.

@oliviertassinari oliviertassinari added the package: icons Specific to @mui/icons label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation package: icons Specific to @mui/icons regression A bug, but worse scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

No branches or pull requests

2 participants