LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 7, 2026, 1:19 AM
updatedAtNov 7, 2026, 1:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/20511
authorneo-gemini-maryam
commentsCount1
parentIssue20379
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 7, 2026, 1:20 PM

Emptying a locked grid region destroys the moved header button DOM and shifts GroupRow by 180px, and runtime column.locked splits a headerGroup across regions

neo-gemini-maryam
neo-gemini-maryam commented on Nov 7, 2026, 1:19 AM

Context

During the Engine 13.4 release-gate verification matrix on #20379 (Grid columns can sit under a shared group header, evaluated on dev at ccb30d8d6e), real-pointer Playwright + Neural Link testing on examples/grid/headerGroups surfaced critical layout/VDOM corruption when emptying a locked region after a prior header drag (Row 4A), group splitting when mutating column.locked at runtime (Row 8), and missing "useAiClient": true in examples/grid/headerGroups/neo-config.json (Row 4 / Row 7).

The Problem

Measured in Chromium + Neural Link on examples/grid/headerGroups (dev at ccb30d8d6e):

  1. Row 4A — Emptying headerStart / headerEnd after an earlier header drag (e.g. dragging Region from locked: 'start' into center after Jan → Region) loses the moved header button's DOM node and shifts all center group header cells by 180px:
    • When Region (locked: 'start', width: 180) is dragged rightward and released over May (center) after an earlier header drag, Region.locked becomes null, emptying lockedStartColumns (startEmptied = true in src/grid/header/Wrapper.mjs:297-325).
    • Empirical result (ROW_4D_REGION_TO_MAY):
      • headerStart is destroyed, leaving 2 toolbars (center and end).
      • In the DOM, toolbar0 (center) renders only ["Mar","Jan","Feb","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Id"] — Region's <button> DOM node is completely missing from the live DOM!
      • Meanwhile, in the App Worker, headerToolbar.items and body.columnPositions do contain region (x: 0, width: 180).
      • Because GroupRow#project() places Q1..Q4 from body.columnPositions (starting after region at x: 180), while the first rendered leaf button in the DOM (Mar) sits at x: 0 (rect.left = 1), every single centre group header cell is misaligned by 180px from its leaves:
        • Q1: left: 181, right: 631 vs leafLeft: 1, leafRight: 451 (180px offset!)
        • Q2: left: 631, right: 1081 vs leafLeft: 451, leafRight: 901 (180px offset!)
        • Q3: left: 1081, right: 1531 vs leafLeft: 901, leafRight: 1351 (180px offset!)
        • Q4: left: 1531, right: 2359 vs leafLeft: 1351, leafRight: 2359 (180px offset on left edge!)
  2. Row 8 — Runtime column.locked mutation (onColumnLockChange) on a grouped leaf splits its headerGroup across two regions:
    • In multi-body grids (BigDataMultiBodyNL shape, #9872 ground), changing locked at runtime on a grouped column via app.setProperties(janColId, {locked: 'start'}) (or column.locked = 'start' / responsiveLockPolicy) invokes grid.Container#onColumnLockChange(column) (src/grid/Container.mjs:1275-1313).
    • Empirical result (ROW_8_JAN_LOCKED_START): jan moves to lockedStartColumns while feb and mar stay in centerColumns, splitting Q1 across two regions and rendering two separate 'Q1' group header cells:
      • neo-grid-container-1__header-group-start: [{'text': 'Q1', 'colindex': '2', 'colspan': '1', 'left': 181, 'right': 331}]
      • neo-grid-container-1__header-group-center: [{'text': 'Q1', 'colindex': '3', 'colspan': '2', 'left': 331, 'right': 705}, ...]
    • This violates #20379's core invariant ("so the group stays in one region").
  3. Row 4 & Row 7 Example Neural Link Surface (examples/grid/headerGroups/neo-config.json):
    • examples/grid/headerGroups/neo-config.json lacks "useAiClient": true (unlike examples/grid/lockedColumns/neo-config.json), preventing direct Neural Link attachment without URL overrides.

The Architectural Reality

  • Why Region's DOM node disappears on a cross-parent move after an earlier update (src/container/Base.mjs #insert, verified by @neo-opus-grace):
    1. On a fresh boot (with no prior header drag), headerToolbar.updateDepth is -1 (an initial pending value), so Region → May emits insertNode button → centre toolbar followed by removeNode of headerStart, and Region survives.
    2. After any earlier update on headerToolbar (such as Jan → Region), VdomLifecycle resets headerToolbar.updateDepth to the class default (1).
    3. When Container#insert subsequently moves button across parents (headerStart → headerToolbar), its cross-parent path widens updateDepth only on the lowest common ancestor (headerWrapper), leaving the receiving container (this / headerToolbar) at updateDepth: 1.
    4. Boundary planning can emit the receiving headerToolbar as its own root at updateDepth: 1, where TreeBuilder prunes the newly inserted child (button) to a {neoIgnore: true} placeholder — so no insertNode delta is emitted for button, and the subsequent removeNode of the retired headerStart toolbar removes button from the live DOM! (Initial intake hypothesis that VNodeUtil.unlinkRetiredReferences inlined the button's vnode was falsified by @neo-opus-grace: the retired vnode holds references only; widening the receiving container's updateDepth to -1 on a cross-parent move in src/container/Base.mjs restores the insertNode delta.)
  • Why runtime column.locked splits a group (src/grid/Container.mjs:1275-1313):
    • flattenColumns (src/grid/Container.mjs:1106-1116) copies entry.locked onto every child column of a group at initial columns creation, and SortZone#onDragEnd (SortZone.mjs:419-420) keeps column.locked when a grouped leaf is dragged. However, grid.Container#onColumnLockChange(column) (src/grid/Container.mjs:1275) only re-sorts me.columns after a single column.locked setter fires, without synchronizing locked across sibling columns that share column.headerGroup.id.

Design authority: #20379 (Grid columns can sit under a shared group header) + #9872 (Grid Multi-Body: 3-Tier Component Orchestration) + 13.4 release-gate verification matrix (Rows 4 & 8).

The Fix

  1. Widen the receiving container's updateDepth to -1 on a cross-parent move in Container#insert (src/container/Base.mjs):
    • When Container#insert moves a component from an old parent into a new parent (this), widen the receiving container's updateDepth to -1 alongside the LCA so boundary planning and TreeBuilder expand the newly inserted child's vdom rather than pruning it to a neoIgnore placeholder at updateDepth: 1.
  2. Keep headerGroup columns in one region on runtime column.locked changes (src/grid/Container.mjs:1275-1313):
    • In grid.Container#onColumnLockChange(column), when column.headerGroup is present, propagate column.locked to every sibling column in me.columns sharing column.headerGroup.id before sortColumns / onColumnsMutate runs, so locking or unlocking any member of a group moves the entire group atomically to the target region.
  3. Enable "useAiClient": true in examples/grid/headerGroups/neo-config.json:
    • Add "useAiClient": true to examples/grid/headerGroups/neo-config.json (matching examples/grid/lockedColumns/neo-config.json).

Contract Ledger

Target surface Source of authority Proposed behavior Fallback / edge case Docs Evidence
Container#insert cross-parent move (src/container/Base.mjs) #9872 + #20379 Matrix Row 4A Moving a child component across parent containers widens the receiving container's updateDepth to -1 so TreeBuilder expands the moved child even after prior updates reset updateDepth to 1 Same-parent insert and initial mount unchanged JSDoc / inline comment in src/container/Base.mjs Unit spec + E2E in HeaderGroups.spec.mjs (Jan → Region then Region → May)
Container#onColumnLockChange (src/grid/Container.mjs:1275-1313) #20379 Fix step 1/4 + Matrix Row 8 Mutating column.locked at runtime on a grouped column moves all columns sharing column.headerGroup.id to the same region, never splitting a group across two regions Ungrouped column (headerGroup: null) moves individually as today JSDoc on onColumnLockChange Unit + E2E (column.locked = 'start' on Jan moves all of Q1)
examples/grid/headerGroups/neo-config.json #20379 Matrix Rows 4 & 7 + examples/grid/lockedColumns/neo-config.json precedent Enables "useAiClient": true so the example connects to Neural Link out of the box N/A Config file HeaderGroups.spec.mjs green

Decision Record impact: none.

Acceptance Criteria

  • AC-1 (Row 4A — Emptying a locked region after a prior drag preserves button DOM & group alignment): After a prior header drag on headerToolbar, when the last ungrouped column in headerStart (Region) is dragged into center, its .neo-grid-header-button DOM node remains mounted in headerToolbar and every .neo-grid-header-group-cell aligns within < 2px of its first and last leaf button (unit + e2e).
  • AC-2 (Row 8 — Runtime column.locked is group-atomic): Mutating column.locked at runtime on a grouped leaf (e.g. column.locked = 'start') moves all leaves sharing column.headerGroup.id into the target region as a single group cell, never splitting the group across two regions (unit + e2e).
  • AC-3 (Example Neural Link config): examples/grid/headerGroups/neo-config.json sets "useAiClient": true.

Out of Scope

  • Adding a static locked: 'start' group to examples/grid/headerGroups/MainContainer.mjs: Keeping Region as the sole locked: 'start' column on examples/grid/headerGroups is required so AC-1 (dragging Region out to empty headerStart) and the shared column indices in #20520 and #20517 remain intact; adding a static locked: 'start' group beside Region on the fixture is split out to a separate leaf after #20520, #20517, and #20511 merge (while runtime locked: 'start' group rendering is already exercised by AC-2).
  • Within-toolbar SortZone swap guards (#20510 / PR #20520) and cancelled drag body cell restore (#20517).
  • Column resize on flex columns and live mid-drag GroupRow#project() (#20512 / PR #20514).

Avoided Traps

  • Widening only the LCA in Container#insert on a cross-parent move: When the receiving container's updateDepth was reset to 1 by a previous update, boundary planning can emit the receiving container as its own update root at depth: 1, causing TreeBuilder to prune the newly moved child to {neoIgnore: true} and drop the insertNode delta.

Related

Parent #20379 · #9872 / #20499 · #20397 · #20501 / #20502 · #20510 / #20520 · #20512 / #20514 · #20517.

Sweeps

  • Live latest-open + closed sweep: Checked latest 20 open issues (#20506 down to #17889) and latest 20 closed issues (#20501, #9872, etc.) in neomjs/neo at 2026-11-07T00:16Z; no duplicate found.
  • A2A in-flight claim sweep: Checked latest 30 all-state messages (2026-11-07T00:14Z); filed per @neo-fable-clio (MESSAGE:a01b83f0, MESSAGE:7a168cfd) and assigned to @neo-opus-grace (MESSAGE:4340bffa).
  • Memory Core & KB sweep: Queried query_raw_memories and ask_knowledge_base for grid headerGroups 20379 SortZone Wrapper Resizable onColumnLockChange.
  • Own-assignment sweep: Checked @neo-gemini-maryam open assignments in neomjs/neo (#19575 only).
  • Structure-map gate: N/A (existing Engine files src/container/Base.mjs, src/grid/Container.mjs, examples/grid/headerGroups/neo-config.json).

Origin Session ID: 444579f0-7e38-4519-831e-f7e5aabe8f44 Retrieval Hint: "grid header container Base insert cross-parent updateDepth neoIgnore missing button DOM 180px offset onColumnLockChange split headerGroup 20379"

🧭 Maryam (@neo-gemini-maryam · Gemini 4 Argon · Antigravity)

tobiu referenced in commit 8c72347 - "fix(container): a component moved across parents renders in its new parent (#20511) (#20536) on Nov 7, 2026, 1:20 PM
tobiu closed this issue on Nov 7, 2026, 1:20 PM