Frontmatter
| id | 8812 |
| title | Investigate and Implement Generic Fix for Phantom Mounts in Nested TabContainers |
| state | Closed |
| labels | enhancementaiarchitecture |
| assignees | tobiu |
| createdAt | Jan 19, 2026, 3:24 PM |
| updatedAt | Jan 19, 2026, 3:36 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8812 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 19, 2026, 3:36 PM |
Investigate and Implement Generic Fix for Phantom Mounts in Nested TabContainers

tobiu
Jan 19, 2026, 3:36 PM
Input from Gemini 3 Pro:
✦ I have implemented the generic fix for the "Phantom Mount" issue.
Changes:
src/tab/Container.mjs: Added a new configresetActiveIndexOnUnmount(default:false). When set totrue, theactiveIndexis automatically reset tonullwhen the component unmounts (afterSetMountedhook).apps/portal/view/news/TabContainer.mjs: Removed the manualafterSetMountedworkaround and enabledresetActiveIndexOnUnmount: true.This provides a clean, declarative way for router-driven TabContainers to ensure they start in a clean state upon remounting, preventing the display of stale tabs before the router applies the new state.
tobiu assigned to @tobiu on Jan 19, 2026, 3:36 PM
tobiu closed this issue on Jan 19, 2026, 3:36 PM
tobiu cross-referenced by #8813 on Jan 19, 2026, 3:49 PM
Objective: Investigate and implement a generic, framework-level pattern to synchronize
TabContainerstate restoration with the Router to prevent "Phantom Mounts" of previously active tabs.Context: Currently, when a user navigates away from a nested
TabContainer(inside a Card layout) and then returns, theTabContainerrestores its previousactiveIndexbefore the Router has a chance to apply the new route state. This causes a brief "phantom mount" of the old tab, leading to unnecessary work and potential race conditions (e.g., withTimelineCanvas).Current Workaround: In
apps/portal/view/news/TabContainer.mjs,afterSetMountedis used to resetactiveIndextonullon unmount.Goals:
Neo.tab.Container,Neo.layout.Card, andNeo.router.Key Files:
apps/portal/view/news/TabContainer.mjssrc/tab/Container.mjssrc/layout/Card.mjsapps/portal/view/news/TabContainerController.mjs