LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 7, 2026, 2:13 AM
updatedAtNov 7, 2026, 7:02 PM
githubUrlhttps://github.com/neomjs/neo/issues/20517
authorneo-opus-grace
commentsCount0
parentIssue20379
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 7, 2026, 7:02 PM

A cancelled header drag leaves the body cells swapped and hidden

Closed v13.4.0/archive-v13-4-0-chunk-4 bugaigriddrag-and-drop
neo-opus-grace
neo-opus-grace commented on Nov 7, 2026, 2:13 AM

Context

Found while verifying #20510 on dev at a903ef6d8d (examples/grid/headerGroups, Chromium, 2600×800, real pointer): pressing Escape in the middle of a header drag restores the headers, but not the body. Captured first as a defect-note; promoted on peer triage as a 13.4 candidate under #20379. Not a 13.4 regression: the cancel branch has been there since #15182 (2026-07-14).

The Problem

Press Feb, drag it onto Jan (one in-group swap), press Escape, release. Measured 800ms after the release:

Jan Feb
header left (px) 181 331
first-row cell left (px) 331 181
cell visibility visible hidden

The headers are back in their order; the body still shows the swap, and the dragged column's cells stay invisible. Any grid with dragResortable headers is affected, grouped or not.

The Architectural Reality

  • Neo.draggable.grid.header.toolbar.SortZone#onDragStart hides the dragged column's cells (columnPosition.hidden = true, visibility: hidden), and every header switch moves the body's columnPositions and cell styles along with the headers.
  • A drop that commits nothing (startIndex === currentIndex) runs processDragEnd's no-commit branch: it re-indexes aria-colindex, then owner.passSizeToBody() rebuilds columnPositions from the headers, then gridBody.createViewData(false, true) re-renders the rows. That restores the body.
  • The cancel path (drag:cancel → container.SortZone#onDragCancel → processDragEnd({cancelled: true})) returns right after super.processDragEnd, before that branch: if (data.cancelled) {me.dragColumnField = null; return}. The base restores the headers, and nothing restores the body.

Design authority: Neo.draggable.container.SortZone#onDragCancel — a cancel applies no transient index, while "the normal end pipeline still owns placeholder/proxy/layout cleanup". The grid body is part of that layout.

The Fix

In src/draggable/grid/header/toolbar/SortZone.mjs#processDragEnd, a cancelled drag skips only the lock-region inference and still runs the no-commit re-sync: passSizeToBody() plus createViewData(false, true), and the scrolled-state toolbar re-sync after it.

Acceptance Criteria

  • AC-1: Escape mid header-drag on examples/grid/headerGroups, after at least one swap, leaves every centre header with a visible body cell of its column under it, and the header order unchanged (e2e).
  • AC-2: a cancelled drag still changes no column's locked (the existing unit test "a cancelled end skips grid lock-region inference after base cleanup" stays green).

Out of Scope

  • Escape over a locked region or during a cross-region drag beyond AC-1's in-centre swap; the restore path is the same.
  • The dock tab strip's cancel path (TabSortZone), which has no body to re-sync.

Avoided Traps

  • Walking the switches back on cancel: the no-commit re-sync already rebuilds the body from the headers; a second restore path would drift from it.

Related

Parent #20379 · Found during #20510 · Cancel introduced by #15182 (#14980).

Sweeps

  • Live latest-open + closed sweep: checked the latest 20 open issues (#20515 down to #19058) and a closed search (header drag cancel Escape body cells, Out of Scope / Avoided Traps read on same-surface hits) at 2026-11-07T01:12Z; no equivalent or prior exclusion found.
  • A2A in-flight claim sweep: latest 30 all-state messages at 01:13Z; no claim on this surface. Promoted from my defect-note (fingerprint c1ee88b774acb48c) on Clio's triage.
  • Memory Core + own-assignment sweep: query_raw_memories on the symptom found no prior capture. My open assignments are the three gate leaves under the same parent; #20510's PR touches processDragEnd but not its cancelled branch.
  • Structure-map gate: N/A (existing Engine file).

Origin Session ID: 285f22d4-aa67-4ae6-bf45-b0ec8e404875 Retrieval Hint: "grid header drag Escape cancel body cells swapped hidden processDragEnd cancelled passSizeToBody"

🖖 Grace (Claude Opus 5.5, Claude Code) · session 285f22d4-aa67-4ae6-bf45-b0ec8e404875

tobiu referenced in commit 36b78a8 - "fix(grid): a cancelled header drag puts the body cells back (#20517) (#20571) on Nov 7, 2026, 7:02 PM
tobiu closed this issue on Nov 7, 2026, 7:02 PM