Polish dashboard drag preview motion, elevation, and drop exit.#78348
Open
jameskoster wants to merge 2 commits into
Open
Polish dashboard drag preview motion, elevation, and drop exit.#78348jameskoster wants to merge 2 commits into
jameskoster wants to merge 2 commits into
Conversation
Animate drag-preview-frame scale and shadow with wpds motion tokens, use sm/md/lg elevation steps for widgets, and compose dnd-kit DragOverlay dropAnimation so scale and shadow ease out on release instead of snapping. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove default border-radius from the grid drag frame so generic surfaces stay square; apply radius to the overlay frame only in the widget route. Simplify the Customization story drag preview to match (lift and shadow remain on the grid frame). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Size Change: 0 B Total Size: 7.96 MB ℹ️ View Unchanged
|
|
Flaky tests detected in a7104d2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25920207535
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
@wordpress/grid(DashboardGrid/DashboardLanes): The drag-preview functional frame (.drag-preview-frame) uses wpds motion tokens for scale and box-shadow on pick-up (sm → lg),prefers-reduced-motionhandling (static lg shadow, no scale motion), and a drop exit path: a shared helper composesdefaultDropAnimationfrom@dnd-kit/corewithdefaultDropAnimationSideEffectsand toggles an exit class so scale and shadow ease back to resting instead of snapping when the overlay tears down. The frame exposesdata-wp-dashboard-drag-preview-framefor consumer styling and does not setborder-radius(package stays shape-agnostic)..grid :global([data-wp-dashboard-drag-preview-frame])and--wpds-border-radius-lg, aligned with.tile/ Card radius.Why
How
@starting-style+transitionontransformandbox-shadowfor enter;.dragPreviewFrameExitingusesmdduration + balanced easing for exit; reduced-motion rules disable motion where appropriate.packages/grid/src/shared/drag-overlay-drop-animation.ts— spreadsdefaultDropAnimation, aligns duration/easing withmd/ balanced, wrapsdefaultDropAnimationSideEffects(active opacity during drop), adds/removes the exit class on[data-wp-dashboard-drag-preview-frame].data-wp-dashboard-drag-preview-frame;DragOverlayreceivesdropAnimation={ dashboardDragDropAnimation }in both grid and lanes.widgets.module.csstargets[data-wp-dashboard-drag-preview-frame]under.gridso masonry and fixed grid both get the same rounded shadow when that wrapper is used.Screenshots
Before
Screen.Recording.2026-05-15.at.14.04.36.mov
After
Screen.Recording.2026-05-15.at.14.03.35.mov
Use of AI
Made with Cursor