Skip to content

fix(Board): make cross-board swaps source-aware - #1343

Merged
tenphi merged 2 commits into
mainfrom
codex/board-source-aware-swap
Aug 21, 2026
Merged

fix(Board): make cross-board swaps source-aware#1343
tenphi merged 2 commits into
mainfrom
codex/board-source-aware-swap

Conversation

@tenphi

@tenphi tenphi commented Aug 21, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Changes Board drag-and-drop commit semantics for cross-board transfers, including when layouts and onWidgetTransfer fire. In-board swap behavior is unchanged.

Overview
Makes collisionMode="swap" source-aware. In-board drops still exchange with one widget. Across boards (including nested → parent), swap is now strict insertion: the requested anchor must be empty, the incoming widget may downscale into room to the right/below, and destination widgets are never swapped or compacted.

An occupied anchor, a fit below minW/minH, or releasing after a valid preview onto an invalid cell cancels the transfer. Both boards restore their start snapshots; the last valid preview is not committed and no layout/transfer callbacks fire.

Preview and commit now track whether the pointer actually landed at the requested cell (targetLandingRef), so a declined collision resolution cannot be treated as a drop. Docs, stories, and tests cover the new cross-board path.

Reviewed by Cursor Bugbot for commit c46b21c. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview Aug 21, 2026 1:29pm

Request Review

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c46b21c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-32885ef.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 497.61 KB (+0.04% 🔺) Yes 🎉
Tree shaking (just a Button) 120.73 KB (0% 🟰) Yes 🎉

Compared against main at 4594454run 32485258255, 2026-08-21T13:07:50Z.

To see which modules changed, download the size-limit-statoscope-report artifact from this run and open report.html.

@tenphi
tenphi merged commit 947bd47 into main Aug 21, 2026
16 checks passed
@tenphi
tenphi deleted the codex/board-source-aware-swap branch August 21, 2026 13:42
@tenphi tenphi mentioned this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant