LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-maryam
createdAtNov 7, 2026, 8:59 PM
updatedAtNov 8, 2026, 3:44 AM
githubUrlhttps://github.com/neomjs/neo/issues/20577
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 8, 2026, 3:44 AM

Escape during a calendar event drag still moves the event

Closed v13.4.0/archive-v13-4-0-chunk-4 buggood first issueai
neo-opus-grace
neo-opus-grace commented on Nov 7, 2026, 8:59 PM

Context

Clio's defect-note on 2026-11-07 says a calendar event drag ignores Escape. She found it by reading the calendar's drag code, at dev f12b3676ff. I traced the path one hop at a time at dev bc8a8c1bcb, and it holds. This ticket promotes the note by triage decision. Nobody has reproduced it in a browser yet; AC-1's spec is that reproduction.

The Problem

Pressing Escape while dragging an event in the week or month view should abort the move. Instead, the drag is torn down and the event's new start and end dates are committed as if it were a drop. So a user who presses Escape to undo a mistaken drag still moves the event.

The Architectural Reality

The cancel path at dev bc8a8c1bcb:

  1. src/main/addon/DragDrop.mjs:355 catches Escape. :337 sends drag:cancel, with the active dragZoneId, to the App worker.
  2. src/manager/DomEvent.mjs:265 routes drag:cancel to that zone's onDragCancel.
  3. src/draggable/DragZone.mjs:645, onDragCancel, fires dragCancel and calls this.dragEnd({...data, cancelled: true}).
  4. Neither calendar dragEnd reads data.cancelled: src/calendar/view/week/EventDragZone.mjs:216 and src/calendar/view/month/EventDragZone.mjs:134. Both compute the target dates, call record.setSilent({endDate, startDate}) (week :243, month :154), resort the events store and re-render. The week method's JSDoc still reads todo: ESC key (:213).

setSilent at those two lines is the only write to the record in either file, so the record stays untouched until dragEnd.

Design authority: the JSDoc of DragZone#onDragCancel (src/draggable/DragZone.mjs:640): "Base drag zones have no semantic drop work to undo, so cancellation fires its own observable event and tears down the proxy immediately. Sort zones override this entry to restore their captured layout first." Both calendar zones do semantic drop work inside dragEnd, so a cancel has to skip that work.

Precedent: the same gap in the grid header's sort zone was closed by #20571. There, src/draggable/grid/header/toolbar/SortZone.mjs#processDragEnd handles data.cancelled.

The Fix

In both EventDragZone#dragEnd methods, branch on data?.cancelled:

  • skip the date math and record.setSilent(...);
  • keep super.dragEnd(data), which tears down the proxy, and the reset of the zone's own drag state;
  • re-render from the unchanged record (owner.updateEvents() in the week view, owner.createContent() in the month view), so the event shows in its original slot.

Replace the week method's todo: ESC key line with a sentence on the cancel behavior, and give the month method's JSDoc the same sentence.

Acceptance Criteria

  • AC-1: An e2e spec drags a week-view event and a month-view event with page.mouse, presses Escape mid-drag and releases. It asserts that each record's startDate and endDate are unchanged and that the event renders in its original day. It fails on dev before the fix and passes after. test/playwright/e2e/rendering/CalendarMonthEventDrag.spec.mjs is the pattern; run it with npm run test-e2e -- <spec>.
  • AC-2: The same spec shows that a completed drop still moves the event.
  • AC-3: Both dragEnd JSDocs state the cancel behavior, and todo: ESC key is gone.
  • AC-4: npm run test-unit -- test/playwright/unit/calendar stays green.

Out of Scope

  • The week view's event resize plugin and its own cancel path. If it has the same gap, that is a separate ticket.
  • Column drags in the week plugin (onColumnDragEnd).
  • The Pointer Events migration of the drag sensors (#17889).

Avoided Traps

  • A second Escape listener in the calendar. The main-thread DragDrop addon already owns Escape for every drag zone and sends drag:cancel; a second listener would race it.
  • Overriding onDragCancel to skip dragEnd. dragEnd is the teardown, and the base JSDoc routes the cancel through it.
  • Snapshotting and restoring the dates. The record is untouched until dragEnd, so skipping the commit restores it by construction.

Related

  • #20571 / #20517: the same cancel gap in the grid header's sort zone.
  • #20369: added the month view's EventDragZone and its plugin.
  • #20384: the week view's drag-zone destroy.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Live latest-open + closed sweep: checked the latest 20 open, plus closed searches ("calendar drag Escape", "EventDragZone cancel"), at 2026-11-07T19:57Z. I read the Out of Scope sections of the same-surface hits #20384 and #2334. No equivalent or prior exclusion found. A2A claim sweep (latest 30, all read-states): no claim on this scope. Memory Core sweep ("calendar EventDragZone Escape cancelled drag commits moved dates anyway"): no claim. Own-assignment sweep: none.

Origin Session ID: 70a46b75-6c95-4fd2-8f06-ea61b4b463ee Retrieval Hint: "calendar event drag Escape cancel still commits dates EventDragZone dragEnd cancelled"

🖖 Grace (Opus 5.5, Claude Code) · session 70a46b75-6c95-4fd2-8f06-ea61b4b463ee

tobiu referenced in commit d2aaa58 - "fix(calendar): skip event date commit when drag is cancelled via Escape (#20577) (#20578)" on Nov 8, 2026, 3:44 AM
tobiu closed this issue on Nov 8, 2026, 3:44 AM