LearnNewsExamplesServices
Frontmatter
id8972
titlerefactor: Switch Grid Row to explicit updateContent pattern (#8964)
stateClosed
labels
airefactoring
assigneestobiu
createdAtFeb 3, 2026, 10:12 PM
updatedAtFeb 3, 2026, 10:14 PM
githubUrlhttps://github.com/neomjs/neo/issues/8972
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 3, 2026, 10:14 PM

refactor: Switch Grid Row to explicit updateContent pattern (#8964)

Closed v12.0.0 airefactoring
tobiu
tobiu commented on Feb 3, 2026, 10:12 PM

The current reactivity model for Neo.grid.Row using record_ and rowIndex_ reactive configs has proven brittle and prone to race conditions, update loops, and stale data (e.g., columns disappearing after scrolling).

Proposed Architecture:

  1. Remove Reactivity: Convert record_ and rowIndex_ to standard non-reactive configs in Neo.grid.Row.
  2. Explicit Update Method: Introduce updateContent({record, rowIndex}) in Neo.grid.Row.
    • This method will synchronously update the instance properties.
    • It will then explicitly trigger createVdom().
  3. Refactor GridBody:
    • Update createViewData to call row.updateContent() directly for every row in the view window.
    • Remove the force parameter logic as updateContent will always force a VDOM generation.
    • This simplifies the update logic and ensures determinism.

Tasks:

  1. Refactor src/grid/Row.mjs:
    • Change record_ to record.
    • Change rowIndex_ to rowIndex.
    • Remove afterSetRecord.
    • Implement updateContent(data).
  2. Refactor src/grid/Body.mjs:
    • Update createViewData to use item.updateContent({record, rowIndex}).
    • Remove force parameter usage.
tobiu added the ai label on Feb 3, 2026, 10:12 PM
tobiu added the refactoring label on Feb 3, 2026, 10:12 PM
tobiu assigned to @tobiu on Feb 3, 2026, 10:12 PM
tobiu referenced in commit f98df52 - "refactor: Switch Grid Row to explicit updateContent pattern (#8972)" on Feb 3, 2026, 10:14 PM
tobiu
tobiu Feb 3, 2026, 10:14 PM

Input from Gemini 3 Pro:

✦ I have successfully refactored the Grid Row architecture to use an explicit updateContent pattern.

  • Converted record and rowIndex to non-reactive configs.
  • Implemented Row.updateContent for synchronous state updates and VDOM generation.
  • Updated GridBody.createViewData to unconditionally update all visible rows using this new method.

This removes the brittleness of the reactive config system for this high-performance use case and ensures that rows always reflect the latest state, solving the issue with empty columns after scrolling.

tobiu closed this issue on Feb 3, 2026, 10:14 PM