LearnNewsExamplesServices
Frontmatter
id9425
titleRefactor Tree cell component architecture for performance
stateClosed
labels
enhancementrefactoringperformancegrid
assigneestobiu
createdAtMar 9, 2026, 9:22 PM
updatedAtMar 9, 2026, 9:23 PM
githubUrlhttps://github.com/neomjs/neo/issues/9425
authortobiu
commentsCount1
parentIssue9404
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 9, 2026, 9:23 PM

Refactor Tree cell component architecture for performance

Closed v12.1.0 enhancementrefactoringperformancegrid
tobiu
tobiu commented on Mar 9, 2026, 9:22 PM

Goal

To optimize the Neo.grid.column.component.Tree cell component by eliminating redundant state configs and consolidating VDOM updates, improving rendering performance during fast scrolling.

Context

The initial implementation of the Tree cell component duplicated record data (depth, expanded, isLeaf) into separate reactive configs. This resulted in poor performance during row recycling, as updating a single record would trigger multiple consecutive afterSet hooks and redundant VDOM update() calls. It also created unnecessary overhead in the parent grid.column.Tree which had to manually unpack the record into these configs.

Requirements

  1. Remove Redundant State: Remove depth_, expanded_, and isLeaf_ from grid.column.component.Tree. The record_ is the single source of truth.
  2. Consolidate Updates: Move all structural styling logic (indentation depth, toggle icons) into a single afterSetRecord hook, ensuring only one me.update() is called per recycle.
  3. Simplify Column Feed: Update applyRecordConfigs in grid.column.Tree to only pass the extracted value, relying on the component to read its own bound record.
  4. Fix Event Target: Update onToggleClick to cleanly access the store via me.parent.gridContainer.
tobiu assigned to @tobiu on Mar 9, 2026, 9:22 PM
tobiu added the enhancement label on Mar 9, 2026, 9:22 PM
tobiu added the refactoring label on Mar 9, 2026, 9:22 PM
tobiu added the performance label on Mar 9, 2026, 9:22 PM
tobiu added the grid label on Mar 9, 2026, 9:22 PM
tobiu added parent issue #9404 on Mar 9, 2026, 9:22 PM
tobiu referenced in commit 1ab27f9 - "refactor(grid): Clean up Tree cell component architecture (#9425)" on Mar 9, 2026, 9:23 PM
tobiu
tobiu Mar 9, 2026, 9:23 PM

Input from Gemini 3.1 Pro:

✦ I have rewritten the Tree cell component to rely purely on the afterSetRecord hook.

  • All redundant state configs (depth_, expanded_, isLeaf_) have been removed.
  • VDOM updates (indent style, toggle classes) are now batched into a single method during row recycling.
  • applyRecordConfigs was simplified to only pass down value.

Committed and pushed. Closing ticket.

tobiu closed this issue on Mar 9, 2026, 9:23 PM