LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 21, 2026, 2:02 AM
updatedAtNov 21, 2026, 2:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/21690
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 21, 2026, 2:59 AM

A grid header toolbar measures items that are not built yet

neo-opus-ada
neo-opus-ada commented on Nov 21, 2026, 2:02 AM

Context

Two sightings, both on Gantt examples while their columns were changed at runtime: Maryam's defect-note 2ba8b461 and mine, 17178e75 (found building #21680, which kept its 220 px task column on phones because of it).

Repro on dev 4b444e4e7a: open examples/gantt/basic at 1440 × 900, then in the App Worker

gantt.taskColumns = [{type: 'tree', dataField: 'title', text: 'Task', width: 160, locked: 'start'}]

The page then reports:

pageerror: Cannot read properties of undefined (reading 'id')
    at src/grid/header/Toolbar.mjs:419:72
    at Array.map (<anonymous>)
    at Toolbar.passSizeToBody (src/grid/header/Toolbar.mjs:419:50)
    at Column.syncBodyGeometry (src/timeline/Column.mjs:1129:21)
    at Column.bindGridContext (src/timeline/Column.mjs:538:12)

The Problem

Neo.gantt.Container#afterSetTaskColumns rebuilds the columns, and the center header toolbar replaces its Neo.timeline.TimeAxisHeader. The new header binds its column while it is still being constructed (TimeAxisHeader#bindGridContext → Column#bindGridContext → Column#syncBodyGeometry), and syncBodyGeometry calls toolbar.passSizeToBody() because the toolbar is mounted. At that moment the toolbar's one item is still the header's config object. It has no vdom, so items.map(item => item.vdom.id) throws inside the async method, and the rejection is unhandled.

The measurement it was trying is not needed: the toolbar measures the constructed header right after. A probe wrapping passSizeToBody logged the center toolbar's items at each call of one reassignment:

Call From Items
1 Column#onConstructed the constructed TimeAxisHeader
2 TimeAxisHeader#bindGridContext a plain object, no vdom: throws
3 the toolbar's post-update pass (Toolbar.mjs:313) the constructed TimeAxisHeader

The Architectural Reality

  • Neo.grid.header.Toolbar#passSizeToBody (src/grid/header/Toolbar.mjs:395) measures every item; its dynamic-width branch reads item.vdom.id (:419).
  • The toolbar measures itself once its items have rendered: promiseUpdate().then(() => mounted && me.passSizeToBody()) (:313).
  • Neo.timeline.Column#syncBodyGeometry (src/timeline/Column.mjs:1118 on dev) calls it whenever the toolbar is mounted, which includes mid-construction.
  • Neo.typeOf(item) === 'NeoInstance' tells an item from its config (src/container/Base.mjs:694).
  • Design authority: n/a — an unhandled TypeError is not a behaviour anyone intends.

The Fix

Neo.grid.header.Toolbar#passSizeToBody returns without measuring while any item is not yet an instance: a toolbar between two sets of items has no geometry to report, and its post-update pass reports the new one.

Acceptance Criteria

  • Reassigning a Gantt's taskColumns at runtime reports no error.
  • Afterwards the task column's header and cells take the new width (the guard does not skip the toolbar's real measurement).
  • A Playwright e2e spec proves it: red on dev (the workerErrors fixture sees the TypeError), green at head.
  • The grid, gantt, scheduler and timeline specs stay green.

Out of Scope

  • Why the timeline column measures the toolbar while its header is still being constructed.

Related

Found beside #21680. Blocks nothing.

Live latest-open + closed sweep: latest 20 open read at 00:59Z and the newest 5 again at 01:06Z; open and closed search ("taskColumns runtime", "passSizeToBody", "header toolbar TypeError", "reassign columns grid throws") and open PRs ("passSizeToBody OR taskColumns") at 2026-11-21T01:03Z: no equivalent; the closed passSizeToBody hits (#21526, #20517, #20512, #19757) fix other paths. 78 open (red band); no owning ticket. A2A in-flight sweep: latest 25 messages, all read states, back to 23:59Z: the two defect-notes, no claim. MC sweep ("grid header toolbar throws reading id when a Gantt's task columns are reassigned at runtime"): 5 results, no prior decision. Own-assignment sweep: 6 open, none overlapping.

Decision Record impact: none.

Retrieval Hint: "header toolbar passSizeToBody item.vdom undefined, TimeAxisHeader bindGridContext during construction, taskColumns reassignment"

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

tobiu referenced in commit f6afbf6 - "fix(grid): a header toolbar measures only built items (#21690) (#21691) on Nov 21, 2026, 2:59 AM
tobiu closed this issue on Nov 21, 2026, 2:59 AM