LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 3, 2026, 1:21 PM
updatedAtSep 3, 2026, 3:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/18198
authorneo-opus-ada
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 3, 2026, 3:57 PM

grid.Body's row and column windows need clone descriptors, so two grids stop sharing one window

neo-opus-ada
neo-opus-ada commented on Sep 3, 2026, 1:21 PM

Context

The operator-reported symptom from #18186 is still live: on the Workstation's 100k Matrix, +1 pulse increments the record and never repaints the cell, for every row below the sixth.

#18186 was dropped as Drop+Supersede because it was scoped as a grid bug when the mechanism sits in the config system, and two fixes of mine were dropped with it — a construct() copy (#18190) and a move to instance fields (#18191). @tobiu's ruling on the shape: "if the [config system] does not honor NEO BEST PRACTISES, like core.Config and config descriptors ... it is a failure. using config descriptors e.g. inside grid body => that is fine."

So: the config-system gap is D#18195 / #18192. This ticket is the consumer fix, done the Neo-native way — with descriptors, not with a hand-rolled copy and not by leaving the config system.

The Problem

src/grid/Body.mjs declares mountedRows, visibleRows and visibleColumns in static config as non-reactive array literals, and both window calculators write through them by index (me.mountedRows[0] = mountedStart — the source says // update the array inline).

A non-reactive key has no clone path, so every grid body on a page holds the same array. The Workstation renders two grids: the feed grid (availableRows 1, bufferRowRange 2) writes a 5-row window into the array the scale grid (availableRows 7, bufferRowRange 10) is reading, so the scale grid believes 6 of its 27 painted rows are mounted.

Both repaint paths gate on that window and treat anything outside it as nothing to do — onStoreRecordChange() skips the row, getRow() returns null, and AnimatedChange no-ops under its if (row). Nothing warns. The store stays correct, so only the paint is missing.

Measured on the running app: calling updateMountedAndVisibleRows() on the scale body alone moved the feed body's window from [0,5] to [0,27] — a window its own geometry cannot produce.

The Fix

Declare the three as reactive configs carrying a descriptor:

mountedRows_: {
    [isDescriptor]: true,
    clone         : 'shallow',
    cloneOnGet    : 'none',
    value         : [0, 0]
},

Both keys of the descriptor are load-bearing, and the pairing was measured at core.Base before being applied here:

descriptor same-instance identity two instances after a[0] = 99
clone:'none', cloneOnGet:'none' stable shared sibling [99,0], class default [99,0]
clone:'deep', cloneOnGet:'none' stable isolated sibling [0,0]
clone:'shallow', cloneOnGet:'none' stable isolated a [99,0], sibling [0,0], default clean
  • clone: 'shallow' copies the declared default on set, so each body gets its own two-element array. 'deep' would work identically for an array of numbers and costs more; 'none' reproduces the defect exactly.
  • cloneOnGet: 'none' is what makes an index-write land. Without it the getter copies arrays on every read — the engine's default for reactive array configs — so me.mountedRows[0] = x would write into a discarded copy and the window would never move at all. This is a behaviour-critical pairing, not a performance tweak.

mountedColumns_ is already reactive in this class, so the shape has precedent three lines away.

Acceptance Criteria

  • AC-1 — every row rendered in the visible area increments its own Pulse cell, asserted by record id against the running app.
  • AC-2 — red-first at exact head: the e2e witness fails on records 7-27 before the change and passes after, and the unit isolation arms fail before and pass after. The absence of the fix is asserted (grep), not assumed from a git stash.
  • AC-3 — two grid bodies with unequal geometry hold different window arrays and neither can move the other's. Equal geometries produce equal windows and would pass while still sharing.
  • AC-4 — an index-write through me.mountedRows[0] is still observable on the instance after the change. This is what cloneOnGet: 'none' buys and it must have its own arm: a getter that copies silently reverts every window update.
  • AC-5 — a recycled row after scrolling acts on the record it currently displays.
  • AC-6 — no NEO_TEST_SKIP_CI guard on the new arms. The unit job sets it, so a guarded regression arm is green in CI by not running.
  • AC-7 — the full unit suite stays green at exact head.

Out of Scope

  • The config-system defect — that a clone descriptor is silently inert on a non-reactive key. That is #18192, diverging in D#18195, and this ticket must not be used to pressure that fork toward whichever option unblocks the grid. This fix works under every option on that matrix, because it moves the keys onto the reactive path where descriptors already work.
  • A sweep of the other in-place-mutated non-reactive configs. 38 candidates surfaced; each needs per-class confirmation that the key has no reactive ancestor and the class is genuinely multi-instance. Separate lane.

Avoided Traps

  • Reassigning instead of writing through. src/grid/Container.mjs destructures {mountedColumns, visibleColumns} off the body and mutates through the reference; switching to reassignment would strand that consumer on a stale array. Caught by @neo-opus-grace on #18190.
  • Omitting cloneOnGet: 'none'. The most likely way to get this wrong, and it fails silently in the same direction as the original bug.
  • Instance fields. They work, and @tobiu ruled the descriptor route is the one that honours the config system.

Related

  • #18192 / D#18195 — the config-system fork this deliberately does not depend on
  • #18186, #18190, #18191 — the dropped predecessors
  • src/grid/Body.mjs, src/grid/column/AnimatedChange.mjs, src/grid/Container.mjs

Origin Session ID: 7596538d-5324-419a-b043-95c585d833ea

Retrieval Hint: grid body mountedRows visibleRows visibleColumns clone shallow cloneOnGet none descriptor two grids share window repaint