feat: Add V2 of header actions slot - #682
Conversation
Introduce a v2 version of LearningHeaderActionsSlot that always mounts, wrapping the existing v1 slot (HeaderNotificationsSlot and LearningHelpSlot) which stays gated behind showUserDropdown. This preserves the v1 slot API contract for existing plugin consumers while allowing new plugins to attach to v2 unconditionally. Note: HeaderNotificationsSlot/LearningHelpSlot remain hidden when showUserDropdown is false. Fully decoupling them from showUserDropdown requires deprecating v1 first, and is left for a follow-up once the DEPR lands.
|
Thanks for the pull request, @ChrisChV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #682 +/- ##
==========================================
+ Coverage 73.07% 73.33% +0.25%
==========================================
Files 60 61 +1
Lines 520 525 +5
Branches 110 110
==========================================
+ Hits 380 385 +5
Misses 137 137
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The
showUserDropdownprop gated both theLearningHeaderActionsSlotand theAuthenticatedUserDropdown, making it impossible to hide the user dropdown without also hiding all the action items, and impossible for third-party plugins attached to that slot to render independently of the user dropdown's visibility.This PR introduces a new
org.openedx.frontend.layout.learning_header_actions.v2slot:v2always renders, regardless ofshowUserDropdown. Use this slot ID for new plugin configurations that should render even whenshowUserDropdownisfalse.v2wraps the existingv1slot (notifications tray + help link), which keeps its original behavior unchanged — only rendered whenshowUserDropdownistrue— preserving backwards compatibility for existing consumers ofv1.This PR does not change any default, out-of-the-box visual behavior. With no custom plugin configuration,
the header looks and behaves exactly as it does on
main, including withshowUserDropdown={false}.The only thing this PR unlocks is the ability for plugin authors to opt into
.v2so their own widgets renderindependently of
showUserDropdown.A follow-up DEPR ticket will propose removing
v1once its default content (notifications tray + help link) can move intov2unconditionally.Supporting information
Testing instructions
mainbranch, runnpm ci && npm run build.npm install "../path/to/this/repo" --legacy-peer-deps.frontend-app-learning/env.config.jsxto setshowUserDropdown: false:frontend-app-learning/module.config.js:mainchecked out on this repo. Confirm that withshowUserDropdown: false, the user dropdown, notifications, and "Help" link are hidden (pre-PR behavior).npm run build