LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 15, 2026, 4:02 PM
updatedAtNov 15, 2026, 10:25 PM
githubUrlhttps://github.com/neomjs/neo/issues/21028
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 15, 2026, 10:25 PM

An animatedChange column follows its grid's store and animates when locked

neo-opus-grace
neo-opus-grace commented on Nov 15, 2026, 4:02 PM

Context

Neo.grid.column.AnimatedChange, and AnimatedCurrency through it, marks a cell when its record's value changes. It subscribes to its grid's store once, in construct(): me.parent.store.on({recordChange: me.onRecordChange, scope: me}) (src/grid/column/AnimatedChange.mjs:35). Nothing rebinds that listener. It is the only column type that listens to the store.

Design authority: "in case we dynamically change the store (incl. a state.Provider store binding resolving after construction), grid.Body + the scrollbar need to get the new reference" (Neo.grid.Container#afterSetStore). The container hands a new store to its bodies, scrollbar, view and toolbars, but not to its columns.

The problem

Measured at dev bf864c781f with a throwaway unit probe; each arm has a passing control.

  1. A grid created without a store throws. Neo.create(Neo.grid.Container, {columns: [{type: 'animatedChange', dataField: 'crew'}]}) throws TypeError: Cannot read properties of null (reading 'on'). store_ defaults to null (src/grid/Container.mjs:236), and Neo.gantt.Container#beforeSetStore returns null for a missing store. So a grid whose store arrives later cannot use this column: one bound through a state.Provider, or one a parent creates before its data exists.

  2. A store swap is not followed. Created with store: first, the column holds one recordChange listener on first (the control). After grid.store = second it still listens to first and not to second, so edits to the grid's current store never animate.

  3. A locked column never animates. (Added 2026-11-15 16:0xZ, found consuming this column in a locked task column.) onRecordChange() asks parent.body, the grid's center body, for the changed record's row. A locked column's cells live in the grid's bodyStart or bodyEnd, so VdomUtil.find finds no cell. With a recorder on each body, a locked: 'start' column asked the center body (center: [1], start: []).

Not a defect, checked: after grid.destroy() the store still holds the column's entry, but Observable#fire drops a listener whose scope is destroyed before calling it.

The architectural reality

  • Neo.grid.Container#createColumns creates each column with parent: me (Container.mjs, the Neo.create(columnClass, {parent: me, windowId, ...column}) call). AnimatedChange#construct reads parent.store at that moment.
  • Neo.grid.Container#afterSetStore re-points body.store, the vertical scrollbar, view.bindStore() and the toolbars. Columns are not on that list.
  • AnimatedChange#onRecordChange needs only the record and its changed fields; it finds the row through parent.body.getRow(record). The binding is the whole defect.
  • Ruling on the shape (#18198, Avoided Traps): the operator chose the config system over instance fields.

The fix

  1. AnimatedChange gets a reactive store_ config (src/grid/column/AnimatedChange.mjs): afterSetStore(value, oldValue) removes the recordChange listener from oldValue and adds it to value; both may be null. construct() takes the parent's store through that config instead of calling parent.store.on().
  2. The container hands its store to the columns that hold one (Neo.grid.Container#afterSetStore), beside the bodies, scrollbar, view and toolbars it already updates.
  3. onRecordChange() asks the body that renders the column: bodyStart for locked: 'start', bodyEnd for locked: 'end', else body.
  4. Specs (test/playwright/unit/grid/column/AnimatedChange.spec.mjs, new): a grid created without a store constructs, and its column hears the store set later; a store swap moves the listener to the new store, so an edit there reaches the column and an edit to the old store does not. NestedDataField.spec.mjs's stub parent keeps working unchanged.

Contract Ledger

Target surface Source of authority Proposed behaviour Fallback Docs Evidence
Neo.grid.column.AnimatedChange#store_ (new reactive config) Neo.grid.Container#afterSetStore's comment, quoted above Follows the grid's current store, null included No store: no listener, no error Class and config JSDoc Unit
Neo.grid.Container#afterSetStore Same Also hands the store to columns that hold one A column without a store config is untouched Method JSDoc Unit

Acceptance criteria

  • A grid created without a store, with an animatedChange column, constructs; once a store is set, an edit to it reaches the column, which looks up the edited row (unit).
  • After a store swap the column listens to the new store only: an edit there reaches it, and an edit to the old store does not (unit).
  • AnimatedCurrency inherits both, covered by one arm (unit).
  • A locked animatedChange column asks the body that renders it for the changed row (unit).
  • Each new arm is red on dev and green at the head; the full unit suite passes on both.

Out of scope

  • The default .neo-animated style, which runs a .4s ease-in-out literal outside _motion.scss's tokens. It is a separate defect-note.
  • Batch edits (Store#updateRows) and the Body's row repaint: #20968 and its PR settled those.
  • Other columns: none of them listens to the store.

Avoided traps

  • Rebinding inside onRecordChange, or reading parent.store on every event: either leaves the construct-time null crash in place.
  • An instance field for the bound store: #18198's ruling chose the config system over instance fields.
  • Recreating the columns on a store change, to re-run one construct() subscription.

Related

#18198 (the descriptor ruling; it names AnimatedChange.mjs) · #20968 (batch edits publish recordChange with isBatch, which this column hears).

Ownership: self-assigned (Grace). This blocks a delivery leaf of mine, so good first issue / help wanted do not apply.

Live latest-open + closed sweep: latest 20 open (53 open, red band; no owning epic for grid columns), open search (AnimatedChange, animatedChange, "animated change": none) and closed search (AnimatedChange store: #20968, #18198 read, #20799, #18186, #8985 unrelated) at 2026-11-15T15:01Z; A2A claims of the last hour checked, none on grid columns. MC sweep: "AnimatedChange grid column subscribes to the store at construction; null store throws; store swap not followed", 5 results, no prior decision found. Own-assignment sweep: 4 open (#20986, #20911, #20884, #20790), none overlapping.

Origin Session ID: 42a76101-e5aa-4c83-8513-8709e3a84ec4

Retrieval Hint: "AnimatedChange column store binding: null store at construct throws, store swap not followed"

tobiu referenced in commit fbeadae - "fix(grid): an animatedChange column follows its grid's store and animates when locked (#21028) (#21031) on Nov 15, 2026, 10:25 PM
tobiu closed this issue on Nov 15, 2026, 10:25 PM