Skip to content

feat: MIT OL header and footer overrides for frontend-base MFEs#73

Open
Anas12091101 wants to merge 6 commits into
mainfrom
anas/mfe-header-footer-overrides
Open

feat: MIT OL header and footer overrides for frontend-base MFEs#73
Anas12091101 wants to merge 6 commits into
mainfrom
anas/mfe-header-footer-overrides

Conversation

@Anas12091101

@Anas12091101 Anas12091101 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

Follow-up of PR #58

Description (What does it do?)

Customize the shared frontend-base header and footer to match the legacy MIT OL learning MFE:

  • footer: logo left, a centered link row with copyright + trademark, "Powered by Open edX" at the top-right, and responsive stacking on mobile; links/logo come from the runtime site config (commonAppConfig.mitolFooter). Link set is per-deployment: mitx/mitxonline use the default (About Us · Terms of Service · Accessibility · Help), xPRO passes a custom order (About Us · Privacy Policy · Honor Code · Terms of Service · Accessibility, no Help).
  • header: custom user-menu toggle (person icon + display name + chevron), desktop-style layout kept at all widths, context-aware logo.
  • header Help link: removed for mitxonline; kept (the default frontend-base Help widget) for mitx/xPRO, pointing at the instructor-dashboard MFE's SUPPORT_URL (see the note under "How can this be tested?").
  • styling: mitx.scss (mitx + xPRO, light theme) and mitxonline.scss (dark theme) to match the legacy look (colors, spacing, borders, header height, mobile adjustments).

Split out of the instructor-dashboard MFE work (PR #58) at reviewer request so the header/footer changes can be reviewed independently.

Screenshots (if appropriate):

Note: the header screenshots below were captured before the header-height fix (the default Help link was rendering as a full-height 64px nav-link and pushing the header to 80px; it is now a plain inline link, header 64px for mitx/xPRO and 72px for mitxonline, matching legacy).

Screen.Recording.2026-06-19.at.8.41.00.PM.mov

MITx Residential
mitx-header-menu-desktop
mitx-header-menu-mobile
mitx-desktop
mitx-mobile

MITxOnline
mitxonline-header-menu-desktop
mitxonline-header-menu-mobile
mitxonline-desktop
mitxonline-mobile

xPRO
xpro-header-menu-desktop
xpro-header-menu-mobile
xpro-desktop
xpro-mobile

How can this be tested?

Two independent "Help" links — don't confuse them:

  • Header Help (mitx/xPRO): comes from the instructor-dashboard MFE's SUPPORT_URL. The LMS resolves this from the help-tokens config, which locally defaults to https://docs.openedx.org/en/latest/educators/index.html. On real deployments it resolves to the support center (e.g. MITx-QA → https://odl.zendesk.com/hc/en-us/requests/new), so the docs.openedx.org value is expected in local dev only. To make local dev match a deployment, set it explicitly with MFE_CONFIG_OVERRIDES (below). mitxonline removes the header Help link entirely.
  • Footer Help: comes from mitolFooter.supportUrl. It renders only when that key is present, so it's controlled entirely by the footer config below (omit supportUrl to hide the footer Help link).
  • The below config should be present in your LMS (private.py):
ENABLE_MFE_CONFIG_API = True

_ACTIVE_DEPLOYMENT = "xpro"  # "xpro" | "mitxonline" | "mitx"

_MITOL_FOOTERS = {
    "xpro": {
        "copyrightText": "© {year} MIT xPRO. All rights reserved.",
        "aboutUrl": "https://xpro.mit.edu/about-us",
        "privacyPolicyUrl": "https://xpro.mit.edu/privacy-policy/",
        "honorCodeUrl": "https://xpro.mit.edu/honor-code/",
        "termsOfServiceUrl": "https://xpro.mit.edu/terms-of-service/",
        "accessibilityUrl": "https://accessibility.mit.edu/",
        # No local xPRO theme; use the production xPRO logo ("MIT xPRO").
        "footerLogoUrl": "https://courses.xpro.mit.edu/static/xpro/images/logo.svg",
    },
    "mitxonline": {
        "copyrightText": "© {year} Massachusetts Institute of Technology",
        "aboutUrl": "https://learn.mit.edu/about",
        "termsOfServiceUrl": "https://learn.mit.edu/terms",
        "accessibilityUrl": "https://accessibility.mit.edu/",
        # Footer Help link. Omit this key if you don't want Help in the footer.
        "supportUrl": "https://support.learn.mit.edu/",
        "footerLogoUrl": "http://local.openedx.io:8000/static/mitxonline-theme/images/mit-logo.svg",
    },
    "mitx": {
        "copyrightText": "© {year} MITx Residential. All rights reserved.",
        "termsOfServiceUrl": "http://local.openedx.io:8000/tos",
        "accessibilityUrl": "https://accessibility.mit.edu/",
        # Footer Help link. Omit this key if you don't want Help in the footer.
        "supportUrl": "https://odl.zendesk.com/hc/en-us/requests/new",
        "footerLogoUrl": "http://local.openedx.io:8000/static/mitx-theme/images/mit-ol-logo.svg",
    },
}

# Header logo per deployment (production logo.svg). The mitxonline logo is white
# for its dark header; mitx/xpro logos are dark for their light headers.
_HEADER_LOGOS = {
    "xpro": "https://courses.xpro.mit.edu/static/xpro/images/logo.svg",
    "mitxonline": "https://courses.learn.mit.edu/static/mitxonline/images/logo.svg",
    "mitx": "https://lms.mitx.mit.edu/static/mitx/images/logo.svg",
}

# Header Help link -> instructor-dashboard MFE SUPPORT_URL. Without this, the LMS
# help-tokens default (docs.openedx.org) is served locally. Setting it here makes
# local dev match the deployment's support center. (mitxonline removes the header
# Help link, so it needs none.)
_SUPPORT_URLS = {
    "xpro": "https://xpro.zendesk.com/hc",
    "mitx": "https://odl.zendesk.com/hc/en-us/requests/new",
}
if _ACTIVE_DEPLOYMENT in _SUPPORT_URLS:
    MFE_CONFIG_OVERRIDES = {
        "instructor-dashboard": {"SUPPORT_URL": _SUPPORT_URLS[_ACTIVE_DEPLOYMENT]},
    }

FRONTEND_SITE_CONFIG = {
    "siteId": "mitol",
    "siteName": "MIT Learn (dev)",
    "baseUrl": "http://apps.local.openedx.io:8080",
    "lmsBaseUrl": "http://local.openedx.io:8000",
    "loginUrl": "http://local.openedx.io:8000/login",
    "logoutUrl": "http://local.openedx.io:8000/logout",
    "headerLogoImageUrl": _HEADER_LOGOS[_ACTIVE_DEPLOYMENT],
    "commonAppConfig": {
        "mitolHeader": {
            "mitLearnBaseUrl": "https://learn.mit.edu",
            "marketingSiteBaseUrl": "http://local.openedx.io:8000",
        },
        "mitolFooter": _MITOL_FOOTERS[_ACTIVE_DEPLOYMENT],
    },
}
  • Adjust _ACTIVE_DEPLOYMENT above as needed, then restart the LMS. The config API is cached, so also clear it after changes: ./manage.py lms shell -c "from django.core.cache import cache; cache.clear()".
  • Verify the config API returns JSON (not 404), and that the instructor-dashboard SUPPORT_URL is present in the apps array:
    curl -s -w "

HTTP %{http_code}
" http://local.openedx.io:8000/api/frontend_site_config/v1/

- Install & run the Site Project (one dev server on :8080 at a time):
 ```bash
 cd deployments/mit-ol/mfe_slot_config/frontend/mitxonline   # or mitx / xpro
 cp -R ../shared ./shared
 npm install      # pulls @openedx/frontend-app-instructor-dashboard etc. from npm
 npm run dev      # openedx dev -> webpack-dev-server on :8080
  • Open the instructor dashboard in the browser (note the /apps prefix):
    http://apps.local.openedx.io:8080/apps/instructor-dashboard/<course-key>
    (you must be course staff / superuser to view it)
  • Verify the header and footer load and match legacy. Repeat for mitx and xpro by switching _ACTIVE_DEPLOYMENT (restart LMS + clear cache + restart the matching dev server).

Additional Context

Copilot AI review requested due to automatic review settings June 22, 2026 10:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a custom desktop footer layout and an always-desktop header layout for the MIT OL deployment to match the legacy learning MFE design. Key changes include replacing the default footer layout with a horizontal row of links, adding a custom footer logo, keeping the desktop-style header layout at all viewport widths, and implementing a custom authenticated user menu. Feedback on these changes suggests adding an alt attribute to the footer logo image for accessibility, using a TypeScript type guard instead of a type assertion in the footer links, and correcting the Container prop in the header layout from size="xl" to fluid="xl" to prevent React console warnings.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +46 to 56
function FooterLogo() {
const { footerLogoUrl, footerLogoDestination } = useMITOLFooterConfig();
const { headerLogoImageUrl } = useSiteConfig();
const src = footerLogoUrl || headerLogoImageUrl;
if (!src) return null;
const img = <Image src={src} style={{ maxHeight: '2rem', height: '33px' }} />;
if (footerLogoDestination) {
return <Hyperlink destination={footerLogoDestination} className="p-0">{img}</Hyperlink>;
}
return img;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Image component for the footer logo is missing an alt attribute. Providing descriptive alternative text is important for accessibility (a11y) so screen readers can describe the image. You can use the siteName from useSiteConfig() to dynamically generate a suitable alt text.

function FooterLogo() {
	const { footerLogoUrl, footerLogoDestination } = useMITOLFooterConfig();
	const { headerLogoImageUrl, siteName } = useSiteConfig();
	const src = footerLogoUrl || headerLogoImageUrl;
	if (!src) return null;
	const img = (
		<Image
			src={src}
			alt={siteName ? siteName + " logo" : "Logo"}
			style={{ maxHeight: '2rem', height: '33px' }}
		/>
	);
	if (footerLogoDestination) {
		return <Hyperlink destination={footerLogoDestination} className="p-0">{img}</Hyperlink>;
	}
	return img;
}

Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/footer/index.tsx Outdated
Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/header/index.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR customizes the shared @openedx/frontend-base header and footer for MIT OL MFEs so they match the legacy learning MFE. It was split out of PR #58 so the header/footer styling can be reviewed independently. The changes live in the shared/ slot-config module that is bundled into each deployment's MFE build, plus the mitxonline theme SCSS.

Changes:

  • Footer: Replaces the shell's desktop footer layout with a custom one (logo left, centered link row + copyright/trademark, "Powered by Open edX" top-right), adds a config-driven FooterLogo, and reads links/logo from commonAppConfig.mitolFooter. Note this is shared across all deployments.
  • Header: Adds an AlwaysDesktopLayout/NoMobileLayout pair to keep the desktop layout at all widths, introduces a custom MITxOnlineAuthenticatedMenu user-menu toggle, and removes the default Help link (mitxonline only).
  • SCSS: Adds header.border-bottom handling (zeroing --pgn-size-border-width), spacing tweaks, and mobile adjustments.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
shared/src/footer/index.tsx New custom desktop footer layout, footer logo, single link row, and reworked slot operations
shared/src/header/index.tsx Always-desktop layout, custom authenticated user menu, Help-link removal; removed unused UserMenuToggle re-export
shared/src/styles/mitxonline.scss Header/footer styling to match legacy theme (border, box-shadow, spacing, mobile)

A couple of notes for context: the removed export { UserMenuToggle } is safe since it's only used internally; the mobile-slot replacements (mobileRight authenticated menu, mobileCenter logo) become inert once NoMobileLayout renders null, but are harmless. The footer is shared across all three deployments, so this footer rework applies to mitx and xpro as well, not just mitxonline.

The only issue I flagged is a minor accessibility nit on the new footer logo image (missing alt). The rest of the changes rely heavily on the external frontend-base shell's slot/widget IDs and produce visual output that I cannot verify here, and there are no automated tests in this repository.

Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/footer/index.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/footer/index.tsx Outdated
@Anas12091101 Anas12091101 added the Needs Review An open Pull Request that is ready for review label Jun 22, 2026
@Anas12091101
Anas12091101 requested a review from asadali145 June 22, 2026 15:06
@Anas12091101 Anas12091101 removed the Needs Review An open Pull Request that is ready for review label Jun 24, 2026
…onto main)

Rebase the header/footer overrides onto current main. main already carries the
shared header/footer wiring in the site configs (via the instructor-dashboard
work), so this brings only the branch's own deliverables on top of it:
- shared/header/index.tsx  (MITx / MITxOnline / xPRO header apps)
- shared/footer/index.tsx  (flat single-row footer matching the legacy learning MFE)
- shared/styles/mitxonline.scss
- public/index.html viewport meta tags (mitx / mitxonline / xpro)

Configs are taken from main unchanged (they already wire these apps + the
instructor dashboard). History squashed from 7 commits because the site-config
rewrites conflicted irreconcilably with main's merged versions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Anas12091101
Anas12091101 force-pushed the anas/mfe-header-footer-overrides branch from 1a25c5f to a07bd29 Compare July 6, 2026 07:39
@Anas12091101 Anas12091101 added the Needs Review An open Pull Request that is ready for review label Jul 6, 2026
@Anas12091101

Copy link
Copy Markdown
Contributor Author

@pdpinch Just an FYI, I created this PR to align the header and footer styling in the Instructor Dashboard MFE with the other legacy MFEs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

}) => (
<Dropdown className={className}>
<UserMenuToggle />
<Dropdown.Menu className="dropdown-menu-right">
Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/header/index.tsx Outdated
Comment on lines +109 to +113
style={{
display: "grid",
gridTemplateColumns: "minmax(0, 1fr) auto minmax(0, 1fr)",
columnGap: "1.5rem",
alignItems: "center",
className,
}) => (
<Dropdown className={className}>
<UserMenuToggle />

@asadali145 asadali145 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have changed the shared footer/header and it will change the header and footer for MITx, and MIT xPro.

Maybe we should go that way? But we will have to change for all MFEs and legacy as well. We should discuss it with Peter if it will make things consistent?

@asadali145 asadali145 added waiting on author and removed Needs Review An open Pull Request that is ready for review labels Jul 15, 2026
@pdpinch

pdpinch commented Jul 15, 2026

Copy link
Copy Markdown
Member

In general, I like consistency, but there are probably some necessary differences between the courses.learn, Residential MITx, and xPRO headers and footers. Logos and links come to mind.

@asadali145

Copy link
Copy Markdown
Contributor

In general, I like consistency, but there are probably some necessary differences between the courses.learn, Residential MITx, and xPRO headers and footers. Logos and links come to mind.

Yeah, that's fine, I just want the styling and format to be the same. Links and Logos will remain configurable.

Header:

  • xPro and Residential have the same header for both MFE and Legacy templates. The only difference is the text colors.
  • Learn Open edX header is Black and has a dashboard button.

Footer:

  • MFE footer is the same across the three deployments. The xPro legacy footer does not match the MFE footer.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread deployments/mit-ol/mfe_slot_config/frontend/shared/src/styles/mitx.scss Outdated
Bring the stale header/footer branch up to date with main so it includes
.github/workflows/ (added on main after this branch diverged). The CodeQL
'Analyze (actions)' job was failing with 'no source code seen' because the
branch tree had no GitHub Actions files to scan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

@Anas12091101 Anas12091101 added Needs Review An open Pull Request that is ready for review and removed waiting on author labels Jul 16, 2026
@asadali145
asadali145 requested a review from Copilot July 21, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

deployments/mit-ol/mfe_slot_config/frontend/shared/src/footer/index.tsx:116

  • The fixed three-column grid never stacks on mobile, despite the PR’s stated responsive-stacking behavior. At narrow widths the two fixed-size logo images can overflow their shrinking 1fr tracks and overlap the center links; add a mobile breakpoint that changes this layout to a vertical stack (or otherwise gives each section its own row).
					gridTemplateColumns: "minmax(0, 1fr) auto minmax(0, 1fr)",

@asadali145

Copy link
Copy Markdown
Contributor
  1. header height is a bit different for MITx and xPro.
Screenshot 2026-07-22 at 1 49 01 PM
  1. If I use the configs from the PR description, I get error when running for MITx about SUPPORT_URL
  2. If I add support URL then it loads fine but I see Help link in footer. I also, see a Help link in header but it points to https://docs.openedx.org/en/latest/educators/index.html, Header link is fine on MITx-QA.

@asadali145 asadali145 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left a comment after testing.

@asadali145 asadali145 added waiting on author and removed Needs Review An open Pull Request that is ready for review labels Jul 22, 2026
@Anas12091101
Anas12091101 requested a review from asadali145 July 23, 2026 10:39
@Anas12091101 Anas12091101 added Needs Review An open Pull Request that is ready for review and removed waiting on author labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants