LearnNewsExamplesServices
Frontmatter
id19446
titleUnder load, a column drag''s lift clamps the header strip''s scroll
stateClosed
labels
bugaigrid
assigneesneo-gpt-sophie
createdAtOct 7, 2026, 2:05 PM
updatedAtOct 8, 2026, 3:38 AM
githubUrlhttps://github.com/neomjs/neo/issues/19446
authorneo-opus-grace
commentsCount5
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 8, 2026, 3:38 AM

Under load, a column drag's lift clamps the header strip's scroll

neo-opus-grace
neo-opus-grace commented on Oct 7, 2026, 2:05 PM

Context

On 2026-10-07, shard 3 of e2e-engine failed on #19441, a cssnano bump that the development build serving the e2e suite never loads. The failing check was test/playwright/e2e/grid/HeaderCellRectSync.spec.mjs:99, "pass 1: mid-drag after sliding left" (run 37588060671, job 112682768320). The re-run passed and the PR merged. The red reproduces on dev without that PR (neomjs/neo@b2db92c5b7) when the CPU is throttled.

The Problem

Observed, in CI and locally:

  • Mid-drag, the centre header toolbar's native scrollLeft is 0 while the grid's --grid-scroll-left holds 412px. Every header covers the wrong cell: Total starts at x=371, over year-column cells that start at x=349.
  • Rates:
    • CI: 1 red in the last 60 e2e runs.
    • Local dev, unthrottled: 0 of 10.
    • CDP CPU throttling ×6: 7 of 92, all at "mid-drag after sliding left".
    • A drag started with no settle after the scroll, unthrottled: 0 of 6, sentinel present.
  • Product effect: dragging a column in a horizontally scrolled grid can make the headers jump to the start and sit over the wrong columns until the drop re-syncs them (#12938). It also turns unrelated PRs red.

The Architectural Reality

  • #12955 fixed a partial clamp: native 358 against 412, caused by absolutised items shrinking the toolbar's scroll extent. Its fix (PR #12961) is a 1px extent sentinel at the pre-drag content extent. SortZone.onDragStart injects it only when dragStartScrollLeft > 0 (src/draggable/grid/header/toolbar/SortZone.mjs, the neo-sortzone-extent-sentinel block), and processDragEnd removes it.
  • dragStartScrollLeft is the toolbar's worker-side scrollLeft config, which ScrollManager updates from scroll events. The drop re-sync also keys on owner.scrollLeft > 0.
  • The clamped value varies (0, 133, 192, 223), where #12955's was one column width: a second path into the same symptom.

What the instrument shows. A throttled copy of the spec (CDP CPU ×6) recorded each failure's toolbar state and every native scroll of the centre toolbar after the baseline:

Runs Failed Sentinel scrollWidth − clientWidth Native scrollLeft at the assert Toolbar scroll events, lift → assert
CPU ×6 7 of 92 present in every failure 412 in every failure 0, 133, 192, 223 exactly one, at the lift: 221–271 ms after arming in pass 1, or at pass 2's lift
unthrottled 0 of 16

When the assertion reads the toolbar, its extent is intact. Its element was scrolled once, at the lift, to a value below the grid's scroll truth. Nothing scrolls it back before the drop re-sync (#12938).

Mechanism. SortZone.onDragStart lifts the items in the base class's update (super.onDragStart), then pushes the sentinel in a second owner.update(). Under load the two can land in separate frames. A layout between them sees the lifted items without the sentinel, the extent shrinks, and the browser clamps the element's scrollLeft once. The sentinel then restores the extent, but not the clamped scrollLeft. #12961 closed the clamp for a lift whose two updates share a frame; one that straddles a frame still clamps.

The Fix

Either option keeps the element on the scroll truth for the whole drag:

  1. Re-apply once the sentinel has landed (smallest). After the sentinel update resolves, DomAccess.scrollTo the toolbar to dragStartScrollLeft: the lift-time twin of #12938's drop re-sync. #12961 rejected a lift-time re-apply because the extent kept shrinking. With the sentinel in place, it holds.
  2. No clamp window (cleaner). Land the sentinel in the same update as the lift, e.g. read the pre-drag extent before super.onDragStart and push the sentinel first.

The instrument (a CPU-throttled copy of HeaderCellRectSync.spec.mjs with the scroll trace) is the falsifier for either.

Acceptance Criteria

  • Under CPU ×6, the throttled HeaderCellRectSync variant passes 72 of 72 on the fix head. On the base it fails at least once in 72 (observed 7 of 92). The PR carries both receipts.
  • The scroll trace shows no native scroll of the centre toolbar between the lift and the drop that the grid's scroll truth does not share.
  • HeaderCellRectSync.spec.mjs, the grid drag-and-drop e2e specs and the unit suite pass.

Out of Scope

  • Other e2e flakes, e.g. GraphScene's lost-context test (#19444, fixed by #19445).
  • The sentinel's design against expandOwnerOnDrag (#12961's rationale stands).

Related

#12955 (the original symptom, closed) · #12961 (the extent sentinel) · #12938 (the drop re-sync) · #19441 (where CI caught it) · #18439 (an earlier intermittent grid e2e ticket).

Live latest-open sweep: latest 20 open issues at 2026-10-07T12:04Z; gh search issues for "HeaderCellRectSync", "extent sentinel" and "header toolbar scrollLeft drag": no equivalent open. A2A claim sweep: the latest 15 messages; no claim on the grid header drag. MC sweep: #12955's history (#12961's notes: a lift-time re-apply was rejected while the extent still shrank); no prior decision on a lift that straddles a frame. Own-assignment sweep (neo): #15000 and #14800, different surfaces.

Origin Session ID: 9aa8aa9b-2502-458b-976b-eec8a223218e

Retrieval Hint: "grid header toolbar scrollLeft 0 mid-drag CPU throttle HeaderCellRectSync extent sentinel"

tobiu referenced in commit 6e19f60 - "fix(grid): preserve scroll extent before header lift (#19446) (#19463)" on Oct 8, 2026, 3:38 AM
tobiu closed this issue on Oct 8, 2026, 3:38 AM