Skip to content

Algolia search/side panel#2824

Merged
bgravenorst merged 14 commits intoMetaMask:mainfrom
swastik7805:algolia-search/side-panel
Apr 13, 2026
Merged

Algolia search/side panel#2824
bgravenorst merged 14 commits intoMetaMask:mainfrom
swastik7805:algolia-search/side-panel

Conversation

@swastik7805
Copy link
Copy Markdown
Contributor

@swastik7805 swastik7805 commented Apr 9, 2026

Description

This PR integrates the Algolia Ask AI Sidepanel (<DocSearchSidepanel />) into the MetaMask documentation, adding a floating "Ask AI" button that enables users to query Algolia's AI directly from the docs.

Key changes include:

  • Algolia Sidepanel Integration: Added the @docsearch/react Sidepanel component to src/theme/Root.tsx to globally render the floating button. Dynamically mapped credentials from themeConfig.algolia.
  • UI/Styling Tweaks: Override deafult styles of Ask-AI Sidepanel in src/scss/theme/_doc-search.scss to fix Sidepanel specific regressions—such as oversized textareas, misaligned submit icons, and transparent backgrounds. Tailored the chat UI to follow MetaMask's design tokens.
  • Prevent SSR hydration errors by wrapping DocSearchSidepanel with useIsBrowser.
  • Fix Sidepanel CSS overrides bleeding into the main search modal.

Feature Requested

Algolia Ask AI floating button feature

Fixes #2756 proposed by @bgravenorst

Preview

Algolia-Ask-Ai.mp4

Checklist

  • If this PR updates or adds documentation content that changes or adds technical meaning, it has received an approval from an engineer or DevRel from the relevant team.
  • If this PR updates or adds documentation content, it has received an approval from a technical writer.

External contributor checklist

  • I've read the contribution guidelines.
  • I've created a new issue (or assigned myself to an existing issue) describing what this PR addresses.

Note

Medium Risk
Adds a new third-party UI surface rendered globally from Root.tsx and applies broad CSS overrides, which could impact rendering/styling across the site and cause SSR/hydration issues if misconfigured.

Overview
Integrates Algolia’s Ask AI sidepanel into the docs by adding @docsearch/react/@docsearch/css and conditionally rendering <DocSearchSidepanel /> from src/theme/Root.tsx when themeConfig.algolia includes an assistantId (guarded by useIsBrowser).

Extends src/scss/theme/_doc-search.scss with targeted overrides for the floating “Ask AI” launcher and sidepanel UI (chat input/layout, typography, related sources, dark/light theming) to match MetaMask design tokens and avoid style bleed into the main DocSearch modal.

Reviewed by Cursor Bugbot for commit 553d40f. Bugbot is set up for automated code reviews on this repo. Configure here.

@swastik7805 swastik7805 requested review from a team as code owners April 9, 2026 04:01
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

@swastik7805 is attempting to deploy a commit to the Consensys Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 9, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​docsearch/​css@​4.2.0 ⏵ 4.6.2100 +110071 +195100
Updated@​docsearch/​react@​4.2.0 ⏵ 4.6.291 -110086 +195100

View full report

Comment thread src/scss/theme/_doc-search.scss
Comment thread src/scss/theme/_doc-search.scss Outdated
@swastik7805
Copy link
Copy Markdown
Contributor Author

swastik7805 commented Apr 9, 2026

@bgravenorst @alexandratran @AyushBherwani1998 @yashovardhan hey guys, i have successfully integrated the Algolia Ask Ai sidepanel.Tested it out and resolved SSG error builds and styling css bleed as suggessted by cursorbot.

PR is not updated and ready for review.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
metamask-docs Ready Ready Preview, Comment Apr 12, 2026 11:59pm

Request Review

Comment thread src/theme/Root.tsx
Comment thread src/scss/theme/_doc-search.scss
Comment thread src/theme/Root.tsx Outdated
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread src/theme/Root.tsx
Comment thread src/scss/theme/_doc-search.scss
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread src/theme/Root.tsx
'Have a question about integrating with MetaMask? Ask here and get an answer from the developer docs.',
},
},
}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Translations prop incorrectly nested inside panel prop

Medium Severity

The translations configuration is passed nested inside the panel prop, but according to the DocSearchSidepanel API, translations is a separate top-level prop, not a sub-property of panel. The panel prop accepts layout options like variant, side, width, etc. As a result, the custom introductionText string is silently ignored and the sidepanel displays default text instead of the intended "Have a question about integrating with MetaMask?" message.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b2101a3. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 553d40f. Configure here.

Comment thread src/scss/theme/_doc-search.scss
@bgravenorst
Copy link
Copy Markdown
Contributor

Thanks for your contribution @swastik7805 🚀

@bgravenorst bgravenorst merged commit 24b54fd into MetaMask:main Apr 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Algolia AI sidepanel

3 participants