Frontmatter
| id | 8684 |
| title | Bug: MagicMoveText corrupted state on view navigation |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Jan 15, 2026, 12:51 PM |
| updatedAt | Jan 15, 2026, 1:05 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8684 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 15, 2026, 1:04 PM |
Bug: MagicMoveText corrupted state on view navigation
tobiu assigned to @tobiu on Jan 15, 2026, 1:04 PM

tobiu
Jan 15, 2026, 1:04 PM
Input from Gemini 3 Pro:
✦ Implemented smart caching in
measureCharsto validate cache against current dimensions. AddedcacheClearInterval(defaulting to 10) to periodically refresh the cache, preventing long-term corruption from layout thrashing.
tobiu closed this issue on Jan 15, 2026, 1:04 PM
Investigate and fix "corrupted dom rect states" in
Neo.component.MagicMoveTextwhen navigating between views.Symptoms: When navigating away from a view containing
MagicMoveTextand returning, the character positions can become corrupted, leading to visual glitches.Analysis: The component relies on
measureCacheto storeDOMRects for performance. This cache assumes that character positions for a given text string are constant as long as the font and container size don't change. However, during view transitions (e.g., CardLayout switches), the component might be hidden, resized, or moved. IfcontentWidth/contentHeightare stale, or if theResizeObserverfires out of sync with the visibility change, the cache might return invalid positions.Potential Solutions:
activate/showevents if applicable.Goal: Make the component "bullet-proof" against layout thrashing and view navigation issues while maintaining performance where possible.