Conversation
Co-authored-by: bschlenk <1390303+bschlenk@users.noreply.github.com>
|
@copilot After dropping, would it be possible to animate the matrices into their places? Currently all the matrices look so similar (the only difference is their values) that it can be hard to tell what happened when you drop. If there was a quick animation of the other matrices moving out of the way, and the original one fading away, that would provide more visual info around what is happening. |
Co-authored-by: bschlenk <1390303+bschlenk@users.noreply.github.com>
Added smooth 300ms animations when matrices are reordered. Using the FLIP technique, matrices now smoothly slide into their new positions, making it clear which matrix was moved and where it went. The animation works for both drag-and-drop and arrow button reordering. Commit: 93a43ab After reordering (with animation): The third matrix (tx=200) smoothly animates from position 3 to position 2, while the second matrix (tx=0) slides to position 3. |
|
@copilot I like the animation! Now, instead of highlighting and growing the matrix that we are hovering while dragging, let's just draw a vertical line at the "insertion point" that we are dragging the matrix to. I think the growing and outlining makes it seem like something else is going to happen, like we're going to merge the two matrices or something. Drawing a vertical line will make it clear that we are just reordering them. Let's change the animation on drop to be spring based. You can use the same little spring library that the canvas uses for its animations. |
…based animations Co-authored-by: bschlenk <1390303+bschlenk@users.noreply.github.com>
Changed the drag indicator to a vertical blue line at the insertion point instead of scaling/highlighting the matrix. Also replaced CSS transitions with spring-based physics animations using the same spring library as the canvas (stiffness: 170, damping: 26). Commit: 027b26d After reordering with spring animation: |
|
@copilot it would be great if the animation was a bit faster. You can't drag again until the animation is complete so the slower it is the more sluggish the app feels. I think it's also important that we maintain the immediate updates that existed before your change. It used to be that as you dragged a matrix around, you'd instantly see what it would look like if the matrix was moved. That's lost now, which kills some of the playfullness I was going for. It would be great to see the canvas update immediately but still delay the swapping animation until after the drag. |
Co-authored-by: bschlenk <1390303+bschlenk@users.noreply.github.com>
Made the animation ~2x faster (increased spring stiffness from 170 to 300, damping from 26 to 30) and restored immediate canvas preview during drag. The canvas now updates instantly when hovering over a drop target, showing exactly what the result will be. The animation plays after drop without blocking further drags. Commit: 18b5d36 The canvas updates immediately during drag, restoring the playful exploration that existed before. You can drag again right away without waiting for the animation to finish. |




Native HTML5 drag-and-drop lacks real-time visual feedback and smooth interactions. This PR migrates matrix reordering to Atlassian's Pragmatic Drag and Drop library and adds spring-based physics animations to make reordering actions clear and visually intuitive.
Changes
Dependencies
@atlaskit/pragmatic-drag-and-drop@^1.7.7(~4.7kB)Matrix Component (
src/components/matrix.tsx)draggable/onDragStart/onDragEnterwithdraggable()anddropTargetForElements()adaptersisDragging) for visual feedback on the dragged elementindex,matrixId,isAnimating,onDragEnter,onDragLeave, andonReorder(from, to)data-matrix-idattribute for animation trackingonDragEnterto pass source index for immediate canvas previewApp Component (
src/app.tsx)childIndex) for determining drag source/target indicesrequestAnimationFramewith natural physicshandleDragEnterdispatches move immediately when hovering over a targetcontainerRefto track the parent containerisAnimatingstate (non-blocking - can drag during animation)insertionIndexstate to show vertical line indicator at drop positionStyles (
src/components/matrix.module.css).dragging: 50% opacity, grabbing cursor.animating:pointer-events: noneto prevent interaction during animation.draggedOverclass (no more scale/highlight effect)transformfrom transition property (now handled by springs)Styles (
src/app.module.css).insertionIndicator: Vertical blue line (3px wide, #3b82f6) showing insertion point during drag.sectionposition relative to contain the indicatorz-index: 10Animation Details
Fast Spring Physics:
createSpring()utility as the Canvas componentstiffness: 300, damping: 30(~2x faster than Canvas springs)Immediate Canvas Preview:
Insertion Indicator:
This provides clear visual feedback showing:
Example
Visual Feedback
Initial state:
During drag:
After drop:
Matrices smoothly animate to their new positions with fast spring physics (~2x faster than previous implementation). The animation completes quickly without blocking further interactions. Users can drag again immediately while the previous animation is still settling.
The natural bounce and overshoot from the spring physics makes the motion feel organic while being fast enough to not impede workflow. The animation makes it clear which matrix was moved and where it went, addressing the issue where similar-looking matrices made reordering hard to follow.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.