LearnNewsExamplesServices
Frontmatter
id8573
titleRefactor Portal Learn MainContainer to use Structural Injection Pattern
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtJan 12, 2026, 3:20 AM
updatedAtJan 12, 2026, 8:08 AM
githubUrlhttps://github.com/neomjs/neo/issues/8573
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 12, 2026, 3:28 AM

Refactor Portal Learn MainContainer to use Structural Injection Pattern

Closed v11.20.0 enhancementairefactoring
tobiu
tobiu commented on Jan 12, 2026, 3:20 AM

Portal.view.learn.MainContainer extends Portal.view.shared.content.Container but still uses the old configuration pattern (defining contentComponent as a top-level config).

Since Shared.Container has been refactored to use the Structural Injection Pattern (via mergeFrom and pageContainerConfig_), Learn.MainContainer must be updated to conform to this new API.

Changes:

  1. Remove contentComponent config.
  2. Override pageContainerConfig to inject the ContentComponent.
  3. Ensure any other inherited configs (like treeConfig) are handled if needed (default is null, which is fine here if not used, or if used it should be configured). Learn section likely uses the tree.

Current Code:

class MainContainer extends SharedContainer {
    static config = {
        // ...
        contentComponent: ContentComponent,
        // ...
    }
}

New Code:

class MainContainer extends SharedContainer {
    static config = {
        // ...
        pageContainerConfig: {
            contentConfig: {
                module: ContentComponent
            }
        },
        // ...
    }
}
tobiu added the enhancement label on Jan 12, 2026, 3:20 AM
tobiu added the ai label on Jan 12, 2026, 3:20 AM
tobiu added the refactoring label on Jan 12, 2026, 3:20 AM
tobiu referenced in commit 3f82493 - "fix: Resolve reference mismatches in Portal Containers and complete Learn refactor (#8572, #8573)" on Jan 12, 2026, 3:28 AM
tobiu
tobiu Jan 12, 2026, 3:28 AM

Input from Gemini 3 Pro:

✦ Refactoring complete.

  • Updated Learn.MainContainer to use the Structural Injection Pattern.
  • Fixed a bug in Shared.Container and PageContainer where beforeSetItems logic was overwriting references with object keys (e.g., sections vs page-sections-container). Renamed keys to match references.

Closing as completed.

tobiu closed this issue on Jan 12, 2026, 3:28 AM
tobiu referenced in commit 6c60262 - "feat: Implement recursive mergeFrom and refactor Portal Containers (#8571, #8572, #8573)" on Jan 12, 2026, 3:41 AM
tobiu assigned to @tobiu on Jan 12, 2026, 8:08 AM