Add failing test: gestures broken after dragging duplicate thought to Home#4045
Add failing test: gestures broken after dragging duplicate thought to Home#4045Copilot wants to merge 3 commits into
Conversation
… thought to Home Agent-Logs-Url: https://github.com/cybersemics/em/sessions/fe095b01-c301-4bf1-bd0b-8d1d14ff328c Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
raineorshine
left a comment
There was a problem hiding this comment.
The CI passes, so clearly you didn't create a failing test.
… via alert Agent-Logs-Url: https://github.com/cybersemics/em/sessions/7ea99d1c-d37b-49bf-a0d2-7a79d56da833 Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Fixed in cd959e1. The previous test wasn't actually triggering the bug — the drag moved to a point near thought A but not on any registered React DnD drop target, so it was treated as a drag cancel: The updated test now correctly targets the center of thought B's editable, which lies inside its
|
|
@fbmcipher Here is another PR where Copilot is failing in an unusual way. It seems to have trouble writing a failing puppeteer test. Perhaps adding the puppeteer test skill will fix this though. |
After drag-and-dropping a duplicate thought (e.g.
CunderB, whereCalready exists at root) to the root level, thelongPressstate gets stuck asDragInProgressand gesture tracing stops working until the cursor is moved manually.Root cause: When a successful touch-based DnD drop lands on a root-level thought, React DnD prevents
onTouchEndfrom reaching React's event handlers, soonLongPressEndis never called andlongPressis never reset toInactive. Additionally,useDragAndDropThought.tsxearly-returns whenparentThoughtis null (becauseparentOf(rootThought.simplePath)is[]andhead([])isundefined), so the "moved to home" alert is never dispatched. WithlongPress !== Inactive,shouldCancelGesture()returnstrueandMultiGestureabandons every subsequent swipe.Changes
src/e2e/puppeteer/__tests__/gestures.ts)describe('drag to Home with duplicate thought')— iPhone 15 Pro emulationA,B(with subthoughtC), and rootCaria-label="child"React DnD drop zone, ensuring the drag lands on a valid registered drop target"Drag and drop"alert viawaitForAlertContent()to confirm React DnDDragInProgressis actually active before releasingnewThoughtCommandgesture after the drop and pollswindow.em.exportContextin browser context to assert a new thought was createdlongPressstays asDragInProgress,shouldCancelGesture()returnstrue,MultiGestureabandons the gesture, and thewaitForFunctiontimes out