Frontmatter
| id | 8813 |
| title | Refactor to Generic unmountConfigs in Component Abstract |
| state | Closed |
| labels | airefactoringcore |
| assignees | tobiu |
| createdAt | Jan 19, 2026, 3:49 PM |
| updatedAt | Jan 19, 2026, 3:54 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8813 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 19, 2026, 3:54 PM |
Refactor to Generic unmountConfigs in Component Abstract

tobiu
Jan 19, 2026, 3:53 PM
Input from Gemini 3 Pro:
✦ I have successfully refactored the "Phantom Mount" fix to be generic and reusable.
Implementation Details:
src/component/Abstract.mjs:
- Introduced
unmountConfigsconfig (Object) withmerge: 'deep'.- Updated
afterSetMountedto apply the configs defined inunmountConfigswhenmountedbecomesfalse.- Added
isDescriptorimport to support the deep merge strategy.- Added the missing
_suffix tounmountConfigs_to make it reactive and properly processed byNeo.setupClass.
src/tab/Container.mjs:
- Removed the
resetActiveIndexOnUnmountconfig and logic, as it is now superseded by the generic solution.
apps/portal/view/news/TabContainer.mjs:
- Updated to use the new generic API:
unmountConfigs: { activeIndex: null }This change provides a robust, framework-level mechanism for handling state reset on unmount, solving the immediate "Phantom Mount" issue while enabling future use cases for other components.
tobiu assigned to @tobiu on Jan 19, 2026, 3:53 PM
tobiu closed this issue on Jan 19, 2026, 3:54 PM
Objective: Generalize the
resetActiveIndexOnUnmountpattern introduced in #8812 by moving it toNeo.component.Abstractas a genericunmountConfigsconfig.Motivation: The "Phantom Mount" issue (state persisting on unmounted components in persistent layouts) is likely to affect other components and configs, not just
activeIndexinTabContainer. A generic mechanism to reset any config on unmount is a more robust architectural solution.Changes:
src/component/Abstract.mjs: IntroduceunmountConfigs(Object).afterSetMounted, ifmountedbecomesfalse, iterate overunmountConfigsand apply them viathis.set().merge: 'deep'descriptor to allow subclasses to extend it easily.src/tab/Container.mjs: Remove the specificresetActiveIndexOnUnmountconfig and logic.apps/portal/view/news/TabContainer.mjs: Update to useunmountConfigs: { activeIndex: null }.Benefits:
Related Issues: