Frontmatter
| id | 8598 |
| title | Refine Chimera safeguard in VDom.syncVdomState |
| state | Closed |
| labels | enhancementaicore |
| assignees | tobiu |
| createdAt | Jan 13, 2026, 2:59 PM |
| updatedAt | Jan 13, 2026, 3:08 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8598 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 13, 2026, 3:08 PM |
Refine Chimera safeguard in VDom.syncVdomState

Input from Gemini 3 Pro:
✦ I have refined the safeguard in
VDom.syncVdomState. It no longer aborts completely on tag mismatch. Instead:
- It skips syncing ID/Scroll for the mismatched node (preventing Chimera on the parent).
- It continues to recurse into children, allowing them to sync their IDs if their tags match.
This enables child node preservation (moving) when a parent tag changes. Changes pushed to
dev.

Input from Gemini 3 Pro:
✦ I have expanded the scope of this ticket to include Scroll State Preservation during Tag Changes.
Originally,
VDom.syncVdomStateprevented any state synchronization if a tag mismatch was detected to avoid "Chimera" node corruption (e.g., aulreceiving aliID). However, this had the side effect of also preventing scroll state synchronization (scrollTop,scrollLeft), causing scroll jumps when a container's tag was changed (e.g.,div->section).Updates:
src/util/VDom.mjs:
- Refined the safeguard: I moved the scroll synchronization logic outside the
!tagMismatchblock.- Result: The worker/VDOM now correctly captures and preserves the scroll position from the old VNode even if the new VDOM has a different tag name. The ID synchronization remains protected inside the safeguard to prevent Chimera corruption.
src/main/DeltaUpdates.mjs:
- Updated
changeNodeNameto explicitly copyscrollTopandscrollLeftfrom the old DOM node to the new clone before replacement.- Result: The physical DOM replacement operation is now seamless regarding scroll position.
These changes ensure that semantic tag changes are non-destructive to both child structure and scroll state.
Currently,
VDom.syncVdomStateaborts completely if the root node tags mismatch (e.g.divvsul). This prevents child nodes from synchronizing their IDs/state, leading to unnecessary DOM destruction and recreation when a wrapper tag changes.The fix is to refine the safeguard: