LearnNewsExamplesServices
Frontmatter
id8572
titleRefactor Portal Shared Containers to use native mergeFrom
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtJan 12, 2026, 3:02 AM
updatedAtJan 12, 2026, 3:18 AM
githubUrlhttps://github.com/neomjs/neo/issues/8572
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 12, 2026, 3:18 AM

Refactor Portal Shared Containers to use native mergeFrom

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

Refactor Portal.view.shared.content.Container (and subclasses) to leverage the newly implemented native mergeFrom symbol feature in Neo.container.Base.

Changes:

  1. Import mergeFrom from Neo.core.ConfigSymbols.
  2. Update contentItems_ in Shared.Container to use [mergeFrom]: 'treeConfig' and [mergeFrom]: 'pageContainerConfig' for the respective items.
  3. Remove the manual injection logic from afterSetContentItems.
  4. Remove the afterSetContentItems method entirely if it's only doing this.items = value.
    • Correction: Wait, items setter is needed to trigger createItems. However, contentItems_ is a proxy config. Does afterSetContentItems need to manually set this.items = value? Yes, because contentItems is not items.
    • So, afterSetContentItems will simplify to just this.items = value.

Verification: Verify that Tickets and Release views still function correctly with their overrides merging seamlessly.

tobiu added the enhancement label on Jan 12, 2026, 3:03 AM
tobiu added the ai label on Jan 12, 2026, 3:03 AM
tobiu added the refactoring label on Jan 12, 2026, 3:03 AM
tobiu referenced in commit 6c8b81c - "feat: Implement recursive mergeFrom support & Refactor Portal Containers (#8571, #8572)" on Jan 12, 2026, 3:18 AM
tobiu
tobiu Jan 12, 2026, 3:18 AM

Input from Gemini 3 Pro:

✦ I have significantly enhanced the mergeFrom implementation to be recursive and robust.

Core Changes:

  1. Moved Logic to parseItemConfigs: Instead of handling mergeFrom shallowly in Container.createItem, I integrated it into Neo.core.Base.parseItemConfigs. This ensures it works recursively for nested item structures.
  2. Object Recursion: Enhanced parseItemConfigs to recurse into Object-based items definitions (maps), not just Arrays.
  3. Array Mutation Fix: Updated Container.onConstructed to pass me._items (the mutable backing array) to parseItemConfigs instead of me.items (which returns a shallow clone due to the default descriptor). This ensures that merges are persisted.

Refactoring Status:

  • Shared.Container: Uses items (standard) with mergeFrom.
  • PageContainer: Uses items with mergeFrom.
  • Subclasses: Purely declarative overrides of config objects.

This implementation is now verified with test/playwright/unit/core/ConfigMerging.spec.mjs.

Closing as completed.

tobiu closed this issue on Jan 12, 2026, 3:18 AM
tobiu assigned to @tobiu on Jan 12, 2026, 3:18 AM