LearnNewsExamplesServices
Frontmatter
id9841
titleMulti-Body: Peer State Adoption for Cell Selection Synchronization
stateClosed
labels
enhancementai
assigneestobiu
createdAtApr 9, 2026, 11:30 PM
updatedAtApr 9, 2026, 11:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/9841
authortobiu
commentsCount1
parentIssue9492
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 9, 2026, 11:40 PM

Multi-Body: Peer State Adoption for Cell Selection Synchronization

Closedenhancementai
tobiu
tobiu commented on Apr 9, 2026, 11:30 PM

Architectural Context

In the Multi-Body Grid layout, single cell selection via CellModel (items) faces unique topological isolation. A single logical cell index (e.g., row3__firstName) only exists inside one specific GridBody component (e.g. bodyEnd), unlike rows or columns which span across multiple bodies conceptually. However, visual correctness and keyboard navigation spanning across multi-view boundaries dictates that the logical pointer (items_ state inherited from Neo.selection.Model) must be shared perfectly across all body models.

Objective

Harmonize CellModel state via the "Peer State Adoption" architecture to allow seamless keyboard routing across Grid Body interfaces.

Implementation Details

  1. Event Binding Security: CellModel must securely ignore cellClick event captures triggering outside its native .view node.
  2. Array Reference Adoption: Neo.selection.Model configures items_: { cloneOnGet: 'none' }. We must utilize active Peer State sharing to bridge the array reference (me._items = peers[0]._items) across grid partitions, defeating the reactivity cloner, to merge arrow key navigations transparently.
  3. Visual Synchronization: CellModel.deselectAll() blindly removes CSS classes if they intersect the active array. We must ensure state mutations in one physical partition update peers seamlessly (or ensure selection.Model does not crash looking up disconnected node graphs in remote bodies).

Avoided Pitfalls

  • Do NOT duplicate cell indexes in isolated array scopes. It destroys horizontal arrow key mapping.
  • Be extremely careful hooking into the _items configuration from Base.mjs reactive setters to avoid destroying single-thread garbage collection.
tobiu added the enhancement label on Apr 9, 2026, 11:30 PM
tobiu added the ai label on Apr 9, 2026, 11:30 PM
tobiu added parent issue #9492 on Apr 9, 2026, 11:30 PM
tobiu referenced in commit 6f42674 - "feat: cell selection models proxy multi-body grid container (#9841)" on Apr 9, 2026, 11:40 PM
tobiu assigned to @tobiu on Apr 9, 2026, 11:40 PM
tobiu
tobiu Apr 9, 2026, 11:40 PM

Implementation complete via 6f42674. CellModel now delegates properly using Peer State Adoption and active peer synchronization overrides across selection workflows (select/deselect/deselectAll).

tobiu closed this issue on Apr 9, 2026, 11:40 PM