LearnNewsExamplesServices
Frontmatter
id8628
title[Docs] Apply Knowledge Base Enhancement Strategy to Fragment Implementation
stateClosed
labels
documentationaicore
assigneestobiu
createdAtJan 14, 2026, 2:14 AM
updatedAtJan 14, 2026, 2:21 AM
githubUrlhttps://github.com/neomjs/neo/issues/8628
authortobiu
commentsCount1
parentIssue8601
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 14, 2026, 2:21 AM

[Docs] Apply Knowledge Base Enhancement Strategy to Fragment Implementation

Closed v11.21.0 documentationaicore
tobiu
tobiu commented on Jan 14, 2026, 2:14 AM

Apply the 3.2. Knowledge Base Enhancement Strategy (from AGENTS_STARTUP.md) to the artifacts produced by Epic #8601.

Goal: Ensure the new Fragment architecture is fully discoverable and semantically indexed by the AI Knowledge Base.

Scope: Review and enhance JSDoc comments for:

  1. src/container/Fragment.mjs
    • Add @summary and detailed architectural context.
    • Add "semantic signposts" (e.g., "wrapperless grouping", "phantom container").
  2. src/vdom/Helper.mjs
    • Document the indexing logic (1 logical = N physical).
  3. src/main/DeltaUpdates.mjs
    • Document the "Fragment Deltas" strategy in insertNode, moveNode, removeNode.
  4. src/container/Base.mjs
    • Document the atomic move logic in insert and remove.

Requirements:

  • Use intent-driven comments (WHY, not just WHAT).
  • Add @see links to relevant tests and the example app.
  • Ensure @summary tags are present on modified classes/methods.
tobiu added the documentation label on Jan 14, 2026, 2:14 AM
tobiu added the ai label on Jan 14, 2026, 2:14 AM
tobiu added the core label on Jan 14, 2026, 2:14 AM
tobiu added parent issue #8601 on Jan 14, 2026, 2:14 AM
tobiu assigned to @tobiu on Jan 14, 2026, 2:20 AM
tobiu
tobiu Jan 14, 2026, 2:21 AM

Input from Gemini 3 Pro:

✦ I have enhanced the JSDoc documentation for the Fragment implementation across the codebase, applying the Knowledge Base Enhancement Strategy.

Changes:

  1. src/container/Fragment.mjs:
    • Added a comprehensive @summary.
    • Explained "Wrapperless Rendering" and "Layout Participation".
    • Added semantic signposts: "Phantom Node", "Ghost Container", "Transparent Container".
    • Added @see links to Neo.vdom.Helper and the reference example Neo.examples.container.fragment.MainContainer.
  2. src/vdom/Helper.mjs:
    • compareAttributes: Explained the "transparency" optimization (ignoring attributes).
    • getFragmentPhysicalCount: Documented the 2 (anchors) + children formula.
    • getPhysicalIndex: Explained the mapping between logical (1 item) and physical (N nodes) indices.
  3. src/main/DeltaUpdates.mjs:
    • moveNode: Documented the "Atomic Move" logic (using moveBefore) and the Fragment fallback (range extraction via XPath).
    • Added context to helper methods getFragmentStart, getFragmentSibling, and getFragmentNodes.
  4. src/container/Base.mjs:
    • removeAt: Documented the critical keepMounted parameter for preserving component state during atomic moves.

These updates ensure that the AI Knowledge Base can now semantically understand and retrieve information about the Fragment architecture, including why it works the way it does.

tobiu closed this issue on Jan 14, 2026, 2:21 AM