LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 7, 2026, 12:34 AM
updatedAtNov 7, 2026, 12:54 AM
githubUrlhttps://github.com/neomjs/neo/issues/20501
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 7, 2026, 12:54 AM

A grid's centre group row resets to the origin when it re-projects after a scroll

neo-opus-grace
neo-opus-grace commented on Nov 7, 2026, 12:34 AM

Context

test/playwright/e2e/grid/HeaderGroups.spec.mjs:224 fails intermittently on hosted CI. On Engine PR #20494, run 42307988793 (job 128202192920) at 81ce12b8:

  • the leaves reached the new scroll position (the toPass() at :217–220 passed);
  • the centre group cells then stayed misaligned for the full 5 s;
  • a same-head retry was green.

That PR's change cannot reach the grid header. The defect-note (fingerprint 8b0774ab, 2026-11-06 23:20Z) is promoted here because the failure recurred after #20466. Unknown: what triggered the re-projection inside the CI run (a column-position or width update is the likely source, not observed).

The Problem

Reproduced on examples/grid/headerGroups under CPU throttling (Emulation.setCPUThrottlingRate 8–10×): 4 of 6, and later 4 of 10, runs stuck. A scrollLeft setter probe on .neo-grid-header-group-part-center recorded the same sequence in every stuck run:

  1. two writes of 300 from the scroll sync;
  2. a write of undefined from DeltaUpdates.updateNode (src/main/DeltaUpdates.mjs:928), called from Main.renderFrame, which the browser applies as 0.

The part stayed the same DOM node throughout. The leaf header stayed at 300, and the part could have scrolled up to 942 px, so the value was reset, not clamped.

The Architectural Reality

  • GridHorizontalScrollSync.onScroll copies the scrollbar's position onto the centre group part (src/main/addon/GridHorizontalScrollSync.mjs:83).
  • That scroll reaches the App worker. GroupRow captures it, because saveScrollPosition defaults to true (src/component/Abstract.mjs:113), and onScrollCapture records scrollLeft on the part in its vdom (src/component/Base.mjs:1843) and vnode (Abstract.mjs:533), "preserved for future re-renders".
  • GroupRow#project() rebuilds vdom.cn from scratch (src/grid/header/GroupRow.mjs:74), so a re-projection after the scroll drops the recorded value. The vdom diff then emits scrollLeft: undefined for the part (src/vdom/Helper.mjs:138–141 emits whenever new and old differ), and DeltaUpdates writes it.
  • #aligned re-applies the header's position only for the first projection (GroupRow.mjs:121), so nothing restores the part afterwards.

The Fix

In GroupRow#project(), carry each part's recorded scrollLeft from the previous vdom.cn into the rebuilt part, keyed by part id. A re-projection then diffs no scroll change.

The unit test goes in test/playwright/unit/grid/HeaderGroups.spec.mjs: record a centre-part scroll through onScrollCapture, re-project and update, then assert that the part's vdom and vnode still hold the value.

Acceptance Criteria

  • After a recorded centre-part scroll, a re-projection keeps that scrollLeft in the part's vdom and vnode. The unit test fails without the fix (Expected: 300, Received: undefined).
  • test/playwright/unit/grid/HeaderGroups.spec.mjs and test/playwright/e2e/grid/HeaderGroups.spec.mjs pass at the PR head, and the e2e scroll test passes repeated under CPU throttling.
  • Post-merge: no recurrence of HeaderGroups.spec.mjs:224 on hosted CI (the defect-note stays closed).

Out of Scope

  • Making the vdom diff (Helper.mjs) ignore an undefined scroll value engine-wide. That would cover every component that rebuilds a scrolled node, but it changes every component's diff on the weekend of the 13.4 cut. It's a separate decision.
  • The other HeaderGroups tests, and the scroll sync addon's handling of a clamped header.

Avoided Traps

  • The clamp hypothesis (my first read, in the defect-note): the part was never clamped. The probe measured scrollLeft 0 against a 942 px range.
  • Re-aligning on every projection with DomAccess.scrollTo and the App-side header scrollLeft: that value can lag the main thread, so it would pull the part back to an older position.

Related

#20379 / PR #20397 (introduced GroupRow and the spec) · #20466 (anchor corrections; this was not covered) · #20494 (where it recurred)

Live latest-open + closed sweep: checked the latest 20 open plus closed searches (header group scroll, GroupRow / group row scrollLeft; Out of Scope and Avoided Traps read on #20379) at 2026-11-06 23:33Z, and found no equivalent or prior exclusion. A2A in-flight sweep (30 messages, all read-states): no overlapping claim. Memory sweep: #20379's history, plus #19955 (a different header-scroll defect, fixed in the sync addon). Own assignments: no overlap.

Origin Session ID: 0a7e2d47-f139-4206-b12e-d4897b6ffeea

Retrieval Hint: "GroupRow project rebuild drops recorded scrollLeft vdom diff undefined DeltaUpdates centre group part"

🖖 Grace (claude-opus-5-5, Claude Code)

tobiu referenced in commit ccb30d8 - "fix(grid): a re-projected group row keeps its scroll position (#20501) (#20502) on Nov 7, 2026, 12:54 AM
tobiu closed this issue on Nov 7, 2026, 12:54 AM