feat: Add HeaderNotificationsSlot to enable notifications tray default ON#663
feat: Add HeaderNotificationsSlot to enable notifications tray default ON#663awais-ansari wants to merge 1 commit intoopenedx:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #663 +/- ##
==========================================
+ Coverage 72.22% 72.44% +0.21%
==========================================
Files 56 57 +1
Lines 504 508 +4
Branches 108 109 +1
==========================================
+ Hits 364 368 +4
Misses 137 137
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I'd like to break down the problems listed with the current approach a bit:
I think this part should be a separate PR. I'm not sure if adding a bell to the already very limited space in the mobile header makes sense. It'd be good to get some design/product opinions on this feature.
It is my understanding that this is the main motivation for this change. Overall I agree with this PR's approach as a solution to this.
I understand why this is frustrating, but the overall vision for slots is that they refer to places things can be put, not the default content in those places. I also know that isn't currently the case for quite a few existing slots (including One of the reasons for this is that "where it goes" gives site operators more granular control over how each page/part of a page looks, instead of having one slot change how multiple pages/parts of pages look. With that in mind, I think there's a way to get the best of both worlds here:
const DesktopSecondaryMenuSlot = ({
menu,
}) => (
<PluginSlot
id="org.openedx.frontend.layout.header_desktop_secondary_menu.v1"
idAliases={['desktop_secondary_menu_slot']}
slotOptions={{
mergeProps: true,
}}
>
+ <HeaderNotificationsSlot />
<DesktopHeaderMainOrSecondaryMenu menu={menu} />
</PluginSlot>
);
Hopefully these thoughts/suggestions make sense! Please let me know if you have any questions! |




Ticket
Summery
Add a new HeaderNotificationsSlot plugin slot that renders NotificationsTray (from @edx/frontend-plugin-notifications) by default across all 5 header surfaces. This makes notifications available out-of-the-box for every Open edX community instance, while allowing operators to disable them via plugin slot configuration or the existing backend waffle flag.
Motivation
Currently, notifications in the header are enabled through tutor-contrib-platform-notifications, which injects NotificationsTray into 3 separate plugin slots:
Slots
org.openedx.frontend.layout.header_desktop_secondary_menu.v1 (Desktop Header)
org.openedx.frontend.layout.studio_header_search_button_slot.v1 (Studio Header)
org.openedx.frontend.layout.header_learning_help.v1 (Learning Header)
Problems with this approach:
Mobile headers are missed entirely. Neither the LMS Mobile Header nor the Studio Mobile Header have notifications, so users on narrow viewports don't see the notification bell.
Not default-on. Community instances must install and configure tutor-contrib-platform-notifications to get notifications. Non-Tutor deployments require manual env.config.jsx configuration.
3 separate slot configs. Operators must configure 3 different slot IDs to enable one feature, and each slot is semantically unrelated to notifications (secondary menu, search button, help link).
Proposal
Create a single new HeaderNotificationsSlot with:
Insert this slot into all 5 header surfaces for authenticated users:
How Operators Can Disable Notifications
Option 1: Plugin slot config (env.config.jsx)
Option 2:
Backend waffle flag - NotificationsTray is self-gating. It returns empty when the backend waffle flag is True. DISABLE_NOTIFICATIONS: True. Backend openedx/openedx-platform#38073