-
Notifications
You must be signed in to change notification settings - Fork 89
feat: Kapa AI integration #1157
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntegrates Kapa.AI AI assistant into the documentation by adding widget script configuration, updating Content Security Policy to permit Kapa-related endpoints and resources, inserting an "Ask AI" navbar button, modifying HubSpot script handling, and adding corresponding button styling. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @docusaurus.config.js:
- Around line 326-340: Replace the hardcoded "XXX-XXX-XXX" in the scripts entry
with the actual KAPA website id by using the existing kapaWebsiteId variable
(which should be sourced from process.env.KAPA_WEBSITE_ID) and only include the
Kapa widget script when kapaWebsiteId is truthy; update the scripts array
construction that contains the object with "data-website-id" to reference
kapaWebsiteId and wrap or filter the scripts so the widget object is omitted
entirely if kapaWebsiteId is not set to avoid loading a broken widget.
🧹 Nitpick comments (2)
src/css/custom.css (1)
44-51: Consider reducing!importantusage if possible.Multiple
!importantdeclarations can make future maintenance difficult. While often necessary when overriding Docusaurus/Infima defaults, verify these are all required by testing without them first.docusaurus.config.js (1)
63-63: Unused custom field.
kapaWebsiteIdis defined but never referenced. If you adopt the proposed fix for the script configuration (usingprocess.env.KAPA_WEBSITE_IDdirectly), this field can be removed. If you intend to expose it to client-side code, ensure it's actually consumed somewhere.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docusaurus.config.jssrc/components/SocialMedia/index.tsxsrc/css/custom.css
🔇 Additional comments (6)
src/components/SocialMedia/index.tsx (1)
23-35: LGTM!Adding the
keyprop usinglabelis appropriate here since the labels are filtered fromSOCIAL_MEDIA_ITEMSwhich contains unique values.docusaurus.config.js (3)
118-128: CSP updates look appropriate for Kapa.AI integration.The expanded directives correctly allow Kapa endpoints, captcha services (reCAPTCHA/hCaptcha), and related resources. This aligns with typical third-party widget requirements.
274-278: Button implementation looks good.The HTML structure correctly uses the CSS classes defined in
custom.css, and includes anaria-labelfor accessibility. Thedata-modal-override-open-selectorin the Kapa config (line 336) correctly references.ask-ai-button.
343-354: Good improvement to HubSpot script handling.Appending to
config.scriptsrather than replacing it preserves other scripts (like the Kapa widget). The defensiveconfig.scripts || []fallback is appropriate.src/css/custom.css (2)
53-69: All CSS variables referenced in the button styles (--ofga-color-module,--ofga-color-relation,--ofga-color-background,--ofga-neutral-darkest) are properly defined instatic/css/openfga.css. No action needed.
86-88: Avoid relying on undocumented plugin class names.The selector
.navbarSearchContainer_Bca1targets an internal class from the@easyops-cn/docusaurus-search-localplugin. This is not a documented or stable selector, meaning the class name could change between plugin versions, breaking this rule.Consider using a documented stable selector such as an ARIA role, aria-label, or unique ID. Alternatively, verify if the search plugin exposes stable CSS variables or configuration options for styling the search container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
closes #1155
Review Checklist
mainSummary by CodeRabbit
New Features
Style
Chores
✏️ Tip: You can customize this high-level summary in your review settings.