Skip to content

feat: add org.openedx.frontend.layout.header_discussions.v1 plugin slot#868

Open
brian-smith-tcril wants to merge 1 commit into
openedx:masterfrom
brian-smith-tcril:header-slot
Open

feat: add org.openedx.frontend.layout.header_discussions.v1 plugin slot#868
brian-smith-tcril wants to merge 1 commit into
openedx:masterfrom
brian-smith-tcril:header-slot

Conversation

@brian-smith-tcril
Copy link
Copy Markdown
Contributor

@brian-smith-tcril brian-smith-tcril commented May 26, 2026

Summary

  • Adds a new org.openedx.frontend.layout.header_discussions.v1 plugin slot wrapping LearningHeader so the discussions header can be wrapped, modified, or replaced via the plugin framework — mirroring the HeaderSlot pattern in frontend-app-learning.
  • Wires the new HeaderSlot into DiscussionsHome in place of the direct LearningHeader import.
  • Implemented in TypeScript: prop types live on a HeaderSlotProps interface and defaults use ES6 default parameters instead of PropTypes/defaultProps.
  • Adds slot README (with border and replace examples + screenshots) and registers the slot in src/plugin-slots/README.md.

Closes #857

Test plan

  • npm run lint passes
  • npx tsc --noEmit passes
  • npm test passes
  • Manually verify the discussions header still renders unchanged with no plugin configured
  • Manually verify a Wrap plugin against the slot renders around the default header (border example)
  • Manually verify a keepDefault: false + Insert plugin fully replaces the header (custom example)

🤖 Generated with Claude Code (I copied the .jsx HeaderSlot component from frontend-app-learning and had claude convert the proptypes to typescript)

Wraps the LearningHeader in DiscussionsHome with a new
`org.openedx.frontend.layout.header_discussions.v1` plugin slot so the
discussions header can be wrapped, modified, or replaced via the plugin
framework. Implemented in TypeScript with prop types via an interface
and ES6 default parameters in place of PropTypes/defaultProps.

Closes openedx#857

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@brian-smith-tcril brian-smith-tcril changed the title feat: add HeaderSlot plugin slot feat: add org.openedx.frontend.layout.header_discussions.v1 plugin slot May 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.57%. Comparing base (f64631c) to head (1925324).

Files with missing lines Patch % Lines
src/plugin-slots/HeaderSlot/index.tsx 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #868      +/-   ##
==========================================
- Coverage   94.64%   94.57%   -0.07%     
==========================================
  Files         164      165       +1     
  Lines        3623     3632       +9     
  Branches      988      997       +9     
==========================================
+ Hits         3429     3435       +6     
- Misses        181      184       +3     
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add header slot

1 participant