Skip to content

fix(plugin-page-builder): rank every canvas droppable on one scale - #831

Merged
mobeenabdullah merged 3 commits into
mainfrom
fix/canvas-one-priority-scale
Aug 15, 2026
Merged

mobeenabdullah merged 3 commits into
mainfrom
fix/canvas-one-priority-scale

Conversation

@mobeenabdullah

Copy link
Copy Markdown
Collaborator

collisionPriority overrides the detector's own value rather than filling a gap. @dnd-kit/abstract applies it after the detector has already decided:

// @dnd-kit/abstract/index.js:429
if (entry.collisionPriority != null) { collision.priority = entry.collisionPriority; }

and the detector assigns High (3) when the pointer is inside an element, Normal (2) otherwise. There is no default of zero.

So #813 giving gap zones a depth starting at 1, while leaving the grid's before: and append: droppables unset, did not leave those neutral — it left them on the detector's scale, sharing numbers with shallow depths. Which kind won then depended on how deeply the document nested: grid targets outranked gap zones near the root and lost to them further down. Nobody intended that.

What changes

Every canvas droppable takes its priority from canvasPriority(depth):

  • before: ranks at its node's own depth — it marks a position among siblings, so it competes with the gap zones beside it.
  • append: ranks one level in — it targets a position among the grid's own children.

The scale is based above the detector's range, so a droppable that ever misses its priority loses to every ranked one at any depth. That is a loud, constant failure instead of a plausible one that varies with nesting.

On the evidence

Nothing failed before this. Grids carry no interleaved gap zones, so the two kinds only meet where a grid sits beside ordinary block flow, and no fixture nests one deep enough for the scales to cross. That is a fixture gap rather than evidence of correctness, so it is stated rather than left to read as coverage.

The new test asserts the scale against CollisionPriority itself, read from @dnd-kit/abstract — now declared as a devDependency — rather than copied as the literals 2 and 3, which would keep passing after the library changed them.

Verification

  • 659 plugin unit tests, 68/68 canvas e2e specs, typecheck and lint clean.
  • Stub-verified: setting the base to 0 fails the floor assertion alone, then restored and proven identical by diff.

Found by lane 20468 reading @dnd-kit/abstract source, correcting a warning I had given them backwards. Filed at tasks/left-tasks/2026-08-15-0100-two-priority-scales-in-the-canvas.md.

Once this lands, the tie #829 documents as a stated limit stops being reachable at all.

collisionPriority OVERRIDES the detector's own value rather than filling a
gap: @dnd-kit/abstract applies it after the detector has decided, and the
detector assigns High when the pointer is inside an element and Normal
otherwise. There is no default of zero.

So giving gap zones a depth starting at 1 while leaving the grid's
before: and append: droppables unset did not leave those neutral - it
left them on the detector's scale, sharing numbers with shallow depths.
Which kind won then depended on how deeply the document nested: grid
targets outranked gap zones near the root and lost to them further down.

Every canvas droppable now takes its priority from canvasPriority(depth).
before: ranks at its node's own depth, since it marks a position among
siblings; append: one level in, since it targets the grid's own children.
The scale is based above the detector's range so a droppable that ever
misses its priority loses to every ranked one at any depth, which fails
loudly instead of plausibly.

Nothing failed before this: grids carry no interleaved gap zones, so the
two kinds only meet where a grid sits beside block flow, and no fixture
nests one deep enough to cross over. That was a fixture gap rather than
evidence, so the new test asserts the scale against CollisionPriority
itself - read from @dnd-kit/abstract, now declared, rather than copied as
literals that would keep passing after the library changed them.
@mobeenabdullah

Copy link
Copy Markdown
Collaborator Author

@codex please review this PR

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@mobeenabdullah, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e9ddbe6-54f3-4568-985a-243e4d8b5a55

📥 Commits

Reviewing files that changed from the base of the PR and between e5e4023 and a247e71.

⛔ Files ignored due to path filters (2)
  • .changeset/canvas-one-priority-scale.md is excluded by !.changeset/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/plugin-page-builder/package.json
  • packages/plugin-page-builder/src/admin/canvas/CanvasNode.tsx
  • packages/plugin-page-builder/src/admin/canvas/DropZone.tsx
  • packages/plugin-page-builder/src/admin/canvas/canvas-priority.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8682ae760

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .changeset/canvas-one-priority-scale.md
Comment thread packages/plugin-page-builder/src/admin/canvas/CanvasNode.tsx
@pkg-pr-new

pkg-pr-new Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@nextlyhq/adapter-drizzle

npm i https://pkg.pr.new/@nextlyhq/adapter-drizzle@a247e71

@nextlyhq/adapter-mysql

npm i https://pkg.pr.new/@nextlyhq/adapter-mysql@a247e71

@nextlyhq/adapter-postgres

npm i https://pkg.pr.new/@nextlyhq/adapter-postgres@a247e71

@nextlyhq/adapter-sqlite

npm i https://pkg.pr.new/@nextlyhq/adapter-sqlite@a247e71

@nextlyhq/admin

npm i https://pkg.pr.new/@nextlyhq/admin@a247e71

@nextlyhq/admin-css

npm i https://pkg.pr.new/@nextlyhq/admin-css@a247e71

@nextlyhq/blocks-engine

npm i https://pkg.pr.new/@nextlyhq/blocks-engine@a247e71

@nextlyhq/blocks-react

npm i https://pkg.pr.new/@nextlyhq/blocks-react@a247e71

@nextlyhq/builder

npm i https://pkg.pr.new/@nextlyhq/builder@a247e71

create-nextly-app

npm i https://pkg.pr.new/create-nextly-app@a247e71

nextly

npm i https://pkg.pr.new/nextly@a247e71

@nextlyhq/plugin-form-builder

npm i https://pkg.pr.new/@nextlyhq/plugin-form-builder@a247e71

@nextlyhq/plugin-page-builder

npm i https://pkg.pr.new/@nextlyhq/plugin-page-builder@a247e71

@nextlyhq/plugin-sdk

npm i https://pkg.pr.new/@nextlyhq/plugin-sdk@a247e71

@nextlyhq/plugin-seo

npm i https://pkg.pr.new/@nextlyhq/plugin-seo@a247e71

@nextlyhq/storage-s3

npm i https://pkg.pr.new/@nextlyhq/storage-s3@a247e71

@nextlyhq/storage-uploadthing

npm i https://pkg.pr.new/@nextlyhq/storage-uploadthing@a247e71

@nextlyhq/storage-vercel-blob

npm i https://pkg.pr.new/@nextlyhq/storage-vercel-blob@a247e71

@nextlyhq/ui

npm i https://pkg.pr.new/@nextlyhq/ui@a247e71

commit: a247e71

@github-actions github-actions Bot added type: docs Documentation only scope: plugin @nextlyhq/plugin-* packages dependencies Dependency updates (label applied by Dependabot) labels Aug 14, 2026
The 24 packages version together, so a hand-written list leaves the
omitted ones bumped with no changelog entry. Generated from the fixed
group in .changeset/config.json rather than typed, which is the only
form that cannot drift as that group changes.
…ty-scale

# Conflicts:
#	packages/plugin-page-builder/src/admin/canvas/CanvasNode.tsx
@mobeenabdullah

Copy link
Copy Markdown
Collaborator Author

@codex please review this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: a247e71405

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mobeenabdullah
mobeenabdullah merged commit 7a23525 into main Aug 15, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates (label applied by Dependabot) scope: plugin @nextlyhq/plugin-* packages type: docs Documentation only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant