Frontmatter
| number | 9871 |
| title | Architectural Ideation: Elevate Grid Selection Model to GridContainer |
| author | tobiu |
| category | Ideas |
| createdAt | Apr 10, 2026, 8:01 PM |
| updatedAt | Apr 10, 2026, 8:18 PM |
| closed | Open |
| closedAt | |
| routingDispositionSchemaVersion | discussion-routing-disposition.v1 |
| routingDisposition | undetermined |
| routingDispositionReason | no-authoritative-lifecycle-marker |
| routingDispositionEvidence | [] |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |
Architectural Ideation: Elevate Grid Selection Model to GridContainer
IdeasOpen

tobiucommented on Apr 10, 2026, 8:18 PM
Input from Antigravity (Gemini 3.1 Pro):
✦ ### Architectural Conclusion: The "3-Tier Orchestration"
After evaluating this proposal, we determined that elevating the
selectionModeltoGridContainerintroduces an unacceptable VDOM diff penalty, as it would unnecessarily trigger re-renders on theheaderToolbar.Instead, the orchestration responsibility will be moved downwards to
Neo.grid.View(body wrapper) and a newNeo.grid.header.Wrapper.The New Architecture:
Neo.grid.Container(Macro Layout): Acts purely as layout coordinator. It passescolumnsand configs but stops manually instantiating sub-bodies into other containers.Neo.grid.header.Wrapper(New Class): Dedicated container that orchestrates theheaderStart,headerToolbar, andheaderEnd.Neo.grid.View(Body Orchestrator & State Master):
- Owns the physical
bodyStart,body, andbodyEndcomponents.- Owns the
selectionModel.- Owns
syncBodies()(moved fromGridContainer).- Implements a Facade for
getRow(record)to proxy down to the specific bodies, thereby preserving O(1) mathematical isolation for the Selection Model.By making
grid.Viewthe orchestrator, we solve the Peer State Adoption fragility, eliminate the VDOM header penalty, and restore the ability to use lists without headers (standaloneView).
The Concept
Migrate the
selectionModelupwards from theNeo.grid.Bodycomponents to theNeo.grid.Container. Instead of maintaining 3 Peer Selection Models (forbodyStart,body, andbodyEnd) that synchronize state, a single centralSelectionModelinstance at the container level will manage the state and issue updates to up to 3 bodies.The Rationale
selectedRowsarrays across 3 distinct class instances).rowClickdelegate up toGridContainer. Having the SM on the Container naturally matches the event delegation phase, avoiding the currentif (event.body && event.body !== view) returncheck inRowModel.onRowClick.Challenges & Open Questions (The Counter-Argument)
While moving the SM to the container solves state propagation, it creates a severe violation of component abstraction regarding VDOM mutation.
The O(1) VDOM Mutation Problem (
updateRows()): Currently,Neo.selection.grid.BaseModel.updateRows()achieves O(1) performance by directly asking itsview(theGridBody) for the specific row component:row = view.getRow(record);. It then mutates the VDOM class directly. If theviewbecomes theGridContainer, the container does not hold row instances. The SM would be forced to hardcode multi-body layout awareness:[view.bodyStart, view.body, view.bodyEnd].filter(Boolean).forEach(body => { let row = body.getRow(record); if (row) { /* mutate VDOM */ } });This tightly couples the abstract Selection Model to the physical layout of a Multi-Body Grid implementation.
Standalone Grid Bodies: If
Neo.grid.Bodyis intended to be used autonomously without aGridContainer, moving the SM config to the container completely disables selection capabilities for lightweight, standalone lists.CellModel Logical IDs: The
CellModeluses logical IDs. If theviewis theGridContainer, resolving a cell's coordinates requires querying downwards through all distinct bodies to find which actual DOM node matches thedataField, introducing runtime overhead during high-frequency cell mutations.