WIP: feat: add AiChat sidebar plugin for learning MFE notifications slot #3874
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/9143
Description (What does it do?)
This PR migrates the AI chat interface from a drawer-based implementation to a sidebar slot integration in the Learning MFE. The AiChat component now renders within the existing notifications/discussions sidebar slot instead of using a separate drawer overlay.
Removed
Added
AiChatSidebar.jsx): New React component that integrates with theorg.openedx.frontend.learning.notifications_discussions_sidebar.v1slotHow It Works
Event-driven activation: The component listens for
postMessageevents (smoot-design::tutor-drawer-openandsmoot-design::tutor-drawer-close) to show/hide the chat interfaceDynamic loading: When triggered, the component dynamically loads the
aiChat.umd.jsbundle from/static/smoot-design/aiChat.umd.jsand initializes the chat interfaceSidebar integration: The chat panel renders within the existing notifications/discussions sidebar slot, temporarily hiding default sidebar content while the chat is active
Responsive behavior:
Technical Details
DIRECT_PLUGINtype withPLUGIN_OPERATIONS.Insertto add the component to the slotkeepDefault: trueto preserve existing sidebar functionality when chat is not activeScreenshots (if appropriate):
How can this be tested?
To test this feature locally:
Set up Tutor instance locally as described in this guide
Mount frontend-app-learning locally
Enable AI Chatbot by following the configuration steps in the ol_openedx_chat plugin documentation
Install smoot-design bundle in your local learning MFE.
This copies a pre-published version of this branch into the frontend-app-learning repo
Add AiChatSidebar component: Copy
AiChatSidebar.jsxto the root of your localfrontend-app-learningrepository (alongside the.envfile)Update configuration: Update
env.config.jsxwith the content fromlearning-mfe-config.env.jsxin this PRNow, on clicking the AskTim Button, it will open the Chatbot inside the Notifications/Discussions sidebar slot.