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:
src/main/addon/DragDrop.mjs:355 catches Escape. :337 sends drag:cancel, with the active dragZoneId, to the App worker.
src/manager/DomEvent.mjs:265 routes drag:cancel to that zone's onDragCancel.
src/draggable/DragZone.mjs:645, onDragCancel, fires dragCancel and calls this.dragEnd({...data, cancelled: true}).
- 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
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
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
devf12b3676ff. I traced the path one hop at a time atdevbc8a8c1bcb, 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
devbc8a8c1bcb:src/main/addon/DragDrop.mjs:355catches Escape.:337sendsdrag:cancel, with the activedragZoneId, to the App worker.src/manager/DomEvent.mjs:265routesdrag:cancelto that zone'sonDragCancel.src/draggable/DragZone.mjs:645,onDragCancel, firesdragCanceland callsthis.dragEnd({...data, cancelled: true}).dragEndreadsdata.cancelled:src/calendar/view/week/EventDragZone.mjs:216andsrc/calendar/view/month/EventDragZone.mjs:134. Both compute the target dates, callrecord.setSilent({endDate, startDate})(week:243, month:154), resort the events store and re-render. The week method's JSDoc still readstodo: ESC key(:213).setSilentat those two lines is the only write to the record in either file, so the record stays untouched untildragEnd.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 insidedragEnd, 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#processDragEndhandlesdata.cancelled.The Fix
In both
EventDragZone#dragEndmethods, branch ondata?.cancelled:record.setSilent(...);super.dragEnd(data), which tears down the proxy, and the reset of the zone's own drag state;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 keyline with a sentence on the cancel behavior, and give the month method's JSDoc the same sentence.Acceptance Criteria
page.mouse, presses Escape mid-drag and releases. It asserts that each record'sstartDateandendDateare unchanged and that the event renders in its original day. It fails ondevbefore the fix and passes after.test/playwright/e2e/rendering/CalendarMonthEventDrag.spec.mjsis the pattern; run it withnpm run test-e2e -- <spec>.dragEndJSDocs state the cancel behavior, andtodo: ESC keyis gone.npm run test-unit -- test/playwright/unit/calendarstays green.Out of Scope
onColumnDragEnd).Avoided Traps
DragDropaddon already owns Escape for every drag zone and sendsdrag:cancel; a second listener would race it.onDragCancelto skipdragEnd.dragEndis the teardown, and the base JSDoc routes the cancel through it.dragEnd, so skipping the commit restores it by construction.Related
EventDragZoneand its plugin.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