Skip to content

Commit 44e4ce5

Browse files
authored
Revert "Add AI sidepanel. (#2629)" (#2634)
This reverts commit 31a3a13.
1 parent 31a3a13 commit 44e4ce5

6 files changed

Lines changed: 21 additions & 549 deletions

File tree

package-lock.json

Lines changed: 12 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
"**/*.{md,mdx,ts,js,tsx,jsx,json}": "npm run format"
2929
},
3030
"dependencies": {
31-
"@docsearch/css": "4.4.0",
32-
"@docsearch/react": "4.4.0",
33-
"@docsearch/sidepanel": "4.4.0",
3431
"@apidevtools/json-schema-ref-parser": "^14.2.0",
3532
"@docusaurus/core": "3.9.2",
3633
"@docusaurus/plugin-content-docs": "3.9.2",
@@ -41,6 +38,7 @@
4138
"@docusaurus/remark-plugin-npm2yarn": "3.9.2",
4239
"@docusaurus/theme-common": "3.9.2",
4340
"@docusaurus/theme-mermaid": "3.9.2",
41+
"@intercom/messenger-js-sdk": "^0.0.14",
4442
"@lottiefiles/react-lottie-player": "^3.6.0",
4543
"@mdx-js/react": "^3.1.0",
4644
"@mermaid-js/layout-elk": "^0.1.9",

src/scss/theme/_doc-search.scss

Lines changed: 0 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -326,176 +326,3 @@
326326
}
327327
}
328328
}
329-
330-
// -----------------------------------------------------------------------------
331-
// Ask AI Sidepanel typography
332-
//
333-
// DocSearch renders AI answers into `.DocSearch-Markdown-Content`, which ships with
334-
// its own font-size/line-height that doesn't match our docs content. Override it
335-
// to use our Docusaurus/Infima typography tokens so the sidepanel reads like the
336-
// rest of the site.
337-
// -----------------------------------------------------------------------------
338-
339-
.DocSearch-Sidepanel {
340-
// Align base typography with the site
341-
font-family: var(--ifm-font-family-base) !important;
342-
color: var(--ifm-font-color-base);
343-
344-
// Header title ("Ask AI") is too small by default (0.875rem in DocSearch CSS).
345-
// Make it 1.5x bigger => 1.3125rem.
346-
.DocSearch-Sidepanel-Title {
347-
font-size: 1.3125rem !important;
348-
line-height: 1.25 !important;
349-
}
350-
351-
// Prompt disclaimer ("Answers are generated with AI..."):
352-
// set to 25% smaller than the previously increased size (1.5rem -> 1.125rem).
353-
.DocSearch-Sidepanel-Prompt--disclaimer {
354-
font-size: 1.125rem !important;
355-
line-height: 1.35 !important;
356-
}
357-
358-
.DocSearch-Sidepanel-Screen--introduction {
359-
font-size: 1.125rem !important;
360-
line-height: 1.35 !important;
361-
}
362-
363-
// Prompt input UI is too small by default (textarea is 1rem + compact padding).
364-
// Make it 1.5x larger: bump padding, textarea font-size, and action button size.
365-
.DocSearch-Sidepanel-Prompt--form {
366-
--prompt-form-padding: 1.125rem; // 0.75rem * 1.5
367-
border-radius: 0.375rem; // 0.25rem * 1.5
368-
}
369-
370-
.DocSearch-Sidepanel-Prompt--textarea {
371-
font-family: var(--ifm-font-family-base) !important;
372-
font-size: 1.5rem !important;
373-
line-height: 1.5 !important;
374-
min-height: 2.25rem !important; // 1.5rem * 1.5
375-
padding-right: 2.625rem !important; // 1.75rem * 1.5
376-
}
377-
378-
.DocSearch-Sidepanel-Prompt--actions {
379-
height: 2.25rem !important;
380-
}
381-
382-
.DocSearch-Sidepanel-Prompt--submit,
383-
.DocSearch-Sidepanel-Prompt--stop {
384-
width: 2.25rem !important;
385-
height: 2.25rem !important;
386-
border-radius: 0.375rem !important;
387-
}
388-
389-
.DocSearch-AskAiScreen-Query {
390-
font-family: var(--ifm-heading-font-family, var(--ifm-font-family-base)) !important;
391-
font-size: 1em !important;
392-
font-weight: 600 !important;
393-
line-height: 1.3 !important;
394-
}
395-
396-
.DocSearch-AskAiScreen-Response,
397-
.DocSearch-Markdown-Content {
398-
font-family: var(--ifm-font-family-base) !important;
399-
font-size: var(--ifm-font-size-base, 1.6rem) !important;
400-
line-height: var(--ifm-line-height-base, 1.6) !important;
401-
}
402-
403-
.DocSearch-Markdown-Content {
404-
p {
405-
margin: 0 0 1em;
406-
}
407-
408-
:is(ul, ol) {
409-
margin: 0 0 1em;
410-
padding-left: 1.5em;
411-
}
412-
413-
:is(h1, h2, h3, h4, h5, h6) {
414-
font-family: var(--ifm-heading-font-family, var(--ifm-font-family-base)) !important;
415-
font-weight: 600 !important;
416-
line-height: 1.25 !important;
417-
}
418-
419-
:is(code, pre, kbd, samp) {
420-
font-family: var(--ifm-font-family-monospace) !important;
421-
}
422-
}
423-
424-
// Ask AI tool-call status line ("Searched for ... found N results")
425-
// Make it slightly smaller than body markdown + use MetaMask purple
426-
// (also tints the search icon since it uses `currentColor`).
427-
.DocSearch-AskAiScreen-MessageContent-Tool.Tool--Result {
428-
font-size: 0.9em !important;
429-
color: var(--ifm-color-primary) !important;
430-
}
431-
432-
.DocSearch-AskAiScreen-MessageContent-Tool.Tool--Result .DocSearch-AskAiScreen-MessageContent-Tool-Query {
433-
color: inherit !important;
434-
}
435-
436-
// Ask AI inline code snippets should match our Prism/Docusaurus code blocks.
437-
.DocSearch-CodeSnippet {
438-
position: relative;
439-
margin: 1.4rem 0;
440-
border-radius: 0;
441-
overflow: hidden;
442-
}
443-
444-
.DocSearch-CodeSnippet pre {
445-
margin: 0;
446-
background-color: var(--general-black-light);
447-
}
448-
449-
.DocSearch-CodeSnippet code {
450-
display: block;
451-
padding: 1.6rem;
452-
font-family: var(--ifm-font-family-monospace) !important;
453-
font-size: 1.2rem;
454-
line-height: 1.5;
455-
color: var(--general-gray) !important;
456-
background: none;
457-
white-space: pre;
458-
}
459-
460-
.DocSearch-CodeSnippet pre code {
461-
padding: 0 !important;
462-
}
463-
464-
.DocSearch-CodeSnippet-CopyButton {
465-
position: absolute;
466-
top: 0.8rem;
467-
right: 0.8rem;
468-
display: inline-flex;
469-
align-items: center;
470-
gap: 0.4rem;
471-
padding: 0.4rem 0.6rem;
472-
border: 1px solid transparent;
473-
border-radius: 0 !important;
474-
background: transparent;
475-
color: var(--general-gray) !important;
476-
cursor: pointer;
477-
}
478-
479-
.DocSearch-CodeSnippet-CopyButton:hover {
480-
color: var(--ifm-color-primary) !important;
481-
border-color: var(--ifm-color-primary);
482-
}
483-
484-
.DocSearch-CodeSnippet-CopyButton-Label {
485-
display: none;
486-
}
487-
488-
// Sidepanel "Powered by Algolia" footer: reduce overall visual size ~50%
489-
.DocSearch-Sidepanel--powered-by {
490-
transform-origin: right bottom;
491-
}
492-
493-
.DocSearch-Sidepanel--powered-by .DocSearch-Label {
494-
font-size: 0.5em !important;
495-
}
496-
497-
.DocSearch-Sidepanel--powered-by svg[aria-label='Algolia'] {
498-
width: 40px !important; // default is 80px
499-
height: auto !important;
500-
}
501-
}

src/theme/Footer/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useEffect, useState } from 'react'
22
import Footer from '@theme-original/Footer'
3+
import { Intercom } from '@intercom/messenger-js-sdk'
34
import useIsBrowser from '@docusaurus/useIsBrowser'
45

56
export default function FooterWrapper(props) {
@@ -28,9 +29,13 @@ export default function FooterWrapper(props) {
2829
}
2930
}, [])
3031

31-
// Intercom is intentionally disabled (it injected a floating chatbot in production).
32-
// Keep `useIsBrowser()` for future client-only behavior here.
33-
useIsBrowser()
32+
const isBrowser = useIsBrowser()
33+
const isProd = process.env.NODE_ENV === 'production'
34+
if (isBrowser && isProd) {
35+
Intercom({
36+
app_id: 'txttgas6',
37+
})
38+
}
3439

3540
if (!canShowFooter) return null
3641

0 commit comments

Comments
 (0)