Context
Found while profiling #21356 (2,000 tasks, 1,972 links). After an edit, that example sets each zone and phase it touched to its children's span, writing the 104 parents as one store.updateRows() batch. Moving the first task by one day (its cascade moves all 1,895 successors) then took 514 ms to settle. With the fix below it settles in 97 ms, the time it takes without the batch. Each figure is the median of 3 runs: headless Chromium 159, devmode, Apple M5 Max, timed in the page by requestAnimationFrame.
The Problem
Neo.data.Store#updateRows() writes a batch as one change. Each record in the batch publishes recordChange with isBatch: true, then one rowsChange closes the batch (#20968, #20974). Neo.grid.Body#onStoreRecordChange leaves isBatch rows to that single pass.
Neo.gantt.Container does not. Its task-store listener (afterSetStore()) runs syncDependencyLayer() once for every record in the batch. Each sync re-projects every link: Neo.gantt.DependencyLayer#project() walks the visible tasks and all links. Its dependency-store listener (afterSetDependencyStore()) does the same for a batch of link edits. So a batch of n rows costs n full projections.
Reproducer: a unit case moves two tasks in one updateRows() call. On dev 0b8d66fa17 it projects the links twice (Expected 1, Received 2).
The Architectural Reality
src/data/Store.mjs: updateRows() and its rowsChange event. The event's fields are field names.
src/grid/Body.mjs: the rowsChange: me.onStoreRowsChange binding and the isBatch early return in onStoreRecordChange(). This is the pattern to follow.
src/gantt/Container.mjs: the listeners in afterSetStore() and afterSetDependencyStore(). moveTask()'s own cascade is already one sync, because _movingTask suppresses the per-record ones.
The Fix
- In
afterSetStore(), the record-change handler returns early on isBatch, and rowsChange is bound to that handler. It already accepts field names.
- In
afterSetDependencyStore(), changed returns early on isBatch, and rowsChange is bound to it.
- Added in review (RA-1 of PR #21408): a batch can also reapply an opted-in filter or sort before its
rowsChange, and those events carry no batch mark. Neo.data.Store therefore gets a read-only isUpdatingRows, true from the batch's first write until its rowsChange. Both Gantt listeners return while it is true, which replaces the isBatch checks.
Acceptance Criteria
Out of Scope
Windowing the link layer vertically, a cheaper projection, and the example's roll-up itself (#21356).
Related
Parent #20874 · found by #21356 · the store batch: #20968, #20974 · Neo.grid.Body#onStoreRowsChange
Owned: the fix and its red-first unit case are ready, so no contributor labels.
Live latest-open + closed sweep: latest 20 open read at 2026-11-18T22:31Z (78 open, red band, so filed under the family epic #20874). Open search ("gantt dependency layer batch", "updateRows rowsChange"); closed search ("gantt dependency layer re-project", "updateRows rowsChange batch"): #20985, #20974, #21029 and #21135 read. The Out of Scope of #20974 leaves "other recordChange consumers" open. No equivalent. A2A in-flight sweep: latest 30 messages, all read states, no claim on the Gantt or store batches. MC sweep ("Gantt links redrawn once per changed row, a bulk edit re-projects the arrows each time"): no prior decision. Own-assignment sweep: 7 open, none overlapping.
Decision Record impact: none.
Retrieval Hint: "Gantt store batch updateRows re-projects the dependency links once per record, isBatch rowsChange"
⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code
Context
Found while profiling #21356 (2,000 tasks, 1,972 links). After an edit, that example sets each zone and phase it touched to its children's span, writing the 104 parents as one
store.updateRows()batch. Moving the first task by one day (its cascade moves all 1,895 successors) then took 514 ms to settle. With the fix below it settles in 97 ms, the time it takes without the batch. Each figure is the median of 3 runs: headless Chromium 159, devmode, Apple M5 Max, timed in the page byrequestAnimationFrame.The Problem
Neo.data.Store#updateRows()writes a batch as one change. Each record in the batch publishesrecordChangewithisBatch: true, then onerowsChangecloses the batch (#20968, #20974).Neo.grid.Body#onStoreRecordChangeleavesisBatchrows to that single pass.Neo.gantt.Containerdoes not. Its task-store listener (afterSetStore()) runssyncDependencyLayer()once for every record in the batch. Each sync re-projects every link:Neo.gantt.DependencyLayer#project()walks the visible tasks and all links. Its dependency-store listener (afterSetDependencyStore()) does the same for a batch of link edits. So a batch of n rows costs n full projections.Reproducer: a unit case moves two tasks in one
updateRows()call. Ondev0b8d66fa17it projects the links twice (Expected 1, Received 2).The Architectural Reality
src/data/Store.mjs:updateRows()and itsrowsChangeevent. The event'sfieldsare field names.src/grid/Body.mjs: therowsChange: me.onStoreRowsChangebinding and theisBatchearly return inonStoreRecordChange(). This is the pattern to follow.src/gantt/Container.mjs: the listeners inafterSetStore()andafterSetDependencyStore().moveTask()'s own cascade is already one sync, because_movingTasksuppresses the per-record ones.The Fix
afterSetStore(), the record-change handler returns early onisBatch, androwsChangeis bound to that handler. It already accepts field names.afterSetDependencyStore(),changedreturns early onisBatch, androwsChangeis bound to it.rowsChange, and those events carry no batch mark.Neo.data.Storetherefore gets a read-onlyisUpdatingRows, true from the batch's first write until itsrowsChange. Both Gantt listeners return while it is true, which replaces theisBatchchecks.Acceptance Criteria
Out of Scope
Windowing the link layer vertically, a cheaper projection, and the example's roll-up itself (#21356).
Related
Parent #20874 · found by #21356 · the store batch: #20968, #20974 ·
Neo.grid.Body#onStoreRowsChangeOwned: the fix and its red-first unit case are ready, so no contributor labels.
Live latest-open + closed sweep: latest 20 open read at 2026-11-18T22:31Z (78 open, red band, so filed under the family epic #20874). Open search ("gantt dependency layer batch", "updateRows rowsChange"); closed search ("gantt dependency layer re-project", "updateRows rowsChange batch"): #20985, #20974, #21029 and #21135 read. The Out of Scope of #20974 leaves "other
recordChangeconsumers" open. No equivalent. A2A in-flight sweep: latest 30 messages, all read states, no claim on the Gantt or store batches. MC sweep ("Gantt links redrawn once per changed row, a bulk edit re-projects the arrows each time"): no prior decision. Own-assignment sweep: 7 open, none overlapping.Decision Record impact: none.
Retrieval Hint: "Gantt store batch updateRows re-projects the dependency links once per record, isBatch rowsChange"
⚖️ Ada ·
@neo-opus-ada· Claude Opus 5.5 · Claude Code