Summary
When Luigi.configChanged() is called while a modal is open, core-modular does not send any lifecycle events to the modal MFE. In Luigi Core, the modal correctly receives events depending on the routing.showModalPathInUrl setting.
Luigi Core behavior (verified locally)
With routing.showModalPathInUrl: true
Calling Luigi.configChanged() with a modal open:
- Main area MFE →
addContextUpdateListener fires ("Luigi Client context updated")
- Modal MFE →
addInitListener fires ("Luigi Client initialized")
- The modal is closed and re-opened from the URL, creating a new iframe
How it works: configChanged() → handleRouteChange(configChangedInitiated=true) → handleBookmarkableModalPath(true) → reads modal path from URL → openAsModal(_reuseIframeOpener=true) → resetMicrofrontendModalData() + openViewInModal()
With routing.showModalPathInUrl: false
Calling Luigi.configChanged() with a modal open:
- Main area MFE →
addContextUpdateListener fires ("Luigi Client context updated")
- Modal MFE →
addContextUpdateListener fires ("Luigi Client context updated")
- The modal stays open and receives a context update (same as main area)
Core-modular behavior (current)
Regardless of showModalPathInUrl setting:
- Main area MFE →
addContextUpdateListener fires ✓
- Modal MFE → nothing — no events received ✗
The _ui.update() method re-renders navigation and calls updateMainContent for the content area iframe, but does not propagate context updates to modal iframes and does not handle the bookmarkable modal path.
Expected behavior
showModalPathInUrl: true: On configChanged(), close and re-open modal from URL → modal MFE receives addInitListener
showModalPathInUrl: false: On configChanged(), send context update to modal iframe → modal MFE receives addContextUpdateListener
Affected e2e tests
test-context-update-listener.cy.js — "Context in modal" test is skipped until this is resolved
- Original luigirepo test:
cypress/e2e/tests/microfrontends.cy.js → "Context Update Listener test" → "Context in modal"
References
- Core:
core/src/App.svelte line 366-372 (configChanged triggers handleRouteChange)
- Core:
core/src/services/routing.js lines 524-537 (handleBookmarkableModalPath)
- Core:
core/src/App.svelte line 1462-1466 (_reuseIframeOpener logic)
Summary
When
Luigi.configChanged()is called while a modal is open, core-modular does not send any lifecycle events to the modal MFE. In Luigi Core, the modal correctly receives events depending on therouting.showModalPathInUrlsetting.Luigi Core behavior (verified locally)
With
routing.showModalPathInUrl: trueCalling
Luigi.configChanged()with a modal open:addContextUpdateListenerfires ("Luigi Client context updated")addInitListenerfires ("Luigi Client initialized")How it works:
configChanged()→handleRouteChange(configChangedInitiated=true)→handleBookmarkableModalPath(true)→ reads modal path from URL →openAsModal(_reuseIframeOpener=true)→resetMicrofrontendModalData()+openViewInModal()With
routing.showModalPathInUrl: falseCalling
Luigi.configChanged()with a modal open:addContextUpdateListenerfires ("Luigi Client context updated")addContextUpdateListenerfires ("Luigi Client context updated")Core-modular behavior (current)
Regardless of
showModalPathInUrlsetting:addContextUpdateListenerfires ✓The
_ui.update()method re-renders navigation and callsupdateMainContentfor the content area iframe, but does not propagate context updates to modal iframes and does not handle the bookmarkable modal path.Expected behavior
showModalPathInUrl: true: OnconfigChanged(), close and re-open modal from URL → modal MFE receivesaddInitListenershowModalPathInUrl: false: OnconfigChanged(), send context update to modal iframe → modal MFE receivesaddContextUpdateListenerAffected e2e tests
test-context-update-listener.cy.js— "Context in modal" test is skipped until this is resolvedcypress/e2e/tests/microfrontends.cy.js→ "Context Update Listener test" → "Context in modal"References
core/src/App.svelteline 366-372 (configChanged triggers handleRouteChange)core/src/services/routing.jslines 524-537 (handleBookmarkableModalPath)core/src/App.svelteline 1462-1466 (_reuseIframeOpener logic)