LearnNewsExamplesServices
Frontmatter
id8605
titleFragment Range Operations in DeltaUpdates
stateClosed
labels
aicorefeature
assigneestobiu
createdAtJan 13, 2026, 4:09 PM
updatedAtJan 13, 2026, 5:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/8605
authortobiu
commentsCount1
parentIssue8601
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 13, 2026, 5:07 PM

Fragment Range Operations in DeltaUpdates

Closed v11.21.0 aicorefeature
tobiu
tobiu commented on Jan 13, 2026, 4:09 PM

Part of Epic #8601.

Goal: Update src/main/DeltaUpdates.mjs to handle lifecycle operations for Fragments by manipulating DOM ranges defined by comment anchors.

Tasks:

  1. Update insertNode:
    • Detect if the target is a Fragment.
    • If so, use the specific renderer logic to create the range (anchors + children) and insert it at the correct index.
  2. Update removeNode:
    • If the ID belongs to a Fragment, locate the <!-- fragment-id-start --> anchor.
    • Traverse siblings and remove them until <!-- fragment-id-end --> is found and removed.
  3. Update moveNode:
    • Locate the range (Start Anchor to End Anchor).
    • Extract the range (e.g., into a DocumentFragment or using replaceChild logic).
    • Insert it at the new location.
    • Note: This logic must be robust enough to handle moving a fragment into another fragment (nested ranges).
tobiu added the ai label on Jan 13, 2026, 4:09 PM
tobiu added the core label on Jan 13, 2026, 4:09 PM
tobiu added the feature label on Jan 13, 2026, 4:09 PM
tobiu added parent issue #8601 on Jan 13, 2026, 4:10 PM
tobiu cross-referenced by #8601 on Jan 13, 2026, 4:17 PM
tobiu assigned to @tobiu on Jan 13, 2026, 4:18 PM
tobiu referenced in commit a84053b - "feat: Fragment Range Operations in DeltaUpdates (#8605)" on Jan 13, 2026, 5:06 PM
tobiu
tobiu Jan 13, 2026, 5:07 PM

Input from Gemini 3 Pro:

✦ I have implemented Fragment range operations in DeltaUpdates.

  • removeNode: Now detects fragment start anchors (<!-- id-start -->) and removes the entire range (start + children + end).
  • moveNode: Uses XPath to find fragment anchors globally (handling the case where getElement(id) fails), extracts the range into a DocumentFragment, and inserts it at the new location.
  • getFragmentNodes: New helper for robust range detection.

Ready for testing.

tobiu closed this issue on Jan 13, 2026, 5:07 PM