fix(crop): prevent isCircle from leaking onto custom shape crops#7931
Merged
steveruizok merged 1 commit intomainfrom Feb 14, 2026
Merged
fix(crop): prevent isCircle from leaking onto custom shape crops#7931steveruizok merged 1 commit intomainfrom
steveruizok merged 1 commit intomainfrom
Conversation
getCropBox was always setting `isCircle: crop.isCircle` on the result,
which added `isCircle: undefined` for shapes without that property.
This caused custom croppable shapes to crash with a validation error
("Unexpected property") when their crop validator didn't include isCircle.
Only copy isCircle onto the new crop when it was explicitly set.
Co-Authored-By: James Vaughan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
5 tasks
huppy-bot bot
pushed a commit
that referenced
this pull request
Feb 14, 2026
In order to fix custom croppable shapes crashing when cropped (#7927), this PR prevents `getCropBox` from adding `isCircle: undefined` to the result crop object. The `isCircle` property was introduced for circle crops on image shapes. However, `getCropBox` was unconditionally copying it onto every result crop via `isCircle: crop.isCircle`. When the input crop didn't have `isCircle` set, this produced `{ isCircle: undefined }` — and `Object.keys()` includes keys with `undefined` values. Custom shapes with their own crop validators (without an `isCircle` field) would then fail with `ValidationError: Unexpected property` at `isCircle`. The fix only copies `isCircle` when it was explicitly set on the input crop (`!= null`). Closes #7927 Based on the fix from #7926 by @jamesbvaughan. ### Change type - [x] `bugfix` ### Test plan 1. Create a custom croppable shape without `isCircle` in its crop validator 2. Crop the shape — should no longer crash - [x] Unit tests ### Release notes - Fixed a crash when cropping custom shapes that don't include `isCircle` in their crop schema <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, localized change to crop serialization plus added tests; main risk is minor behavior change for callers that implicitly relied on `isCircle` always being present. > > **Overview** > Fixes a cropping regression where `getCropBox` would always copy `crop.isCircle` into the returned crop object, causing `isCircle: undefined` to appear and break custom shape crop validators. > > `getCropBox` now only includes `isCircle` in the output when it’s explicitly set (non-null/undefined) on the input crop, and new unit tests cover absence/undefined cases plus validation against a custom crop schema without `isCircle`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b6c7164. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: James Vaughan <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
2 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 16, 2026
In order to keep release documentation current after the v4.3.2 patch release, this PR updates both the archived and next release notes. ### Changes **v4.3.0.mdx:** - Add GitHub release link for v4.3.0 - Add v4.3.1 patch section (draw shape delta encoding precision fix) - Add v4.3.2 patch section (custom shape crop fix) **next.mdx:** - Update `last_version` from v4.3.1 to v4.3.2 - Add bug fix entries for #7938 (paste-into-frame) and #7931 (crop isCircle) ### Change type - [x] `docs` ### Test plan - [ ] Verify release notes render correctly on the docs site ### Release notes - Update release notes with v4.3.1 and v4.3.2 patch entries <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Docs-only updates to markdown release notes; no runtime code changes, with minimal risk beyond potential formatting/rendering issues. > > **Overview** > Updates release documentation to reflect the `v4.3.2` patch. > > Bumps `apps/docs/content/releases/next.mdx` `last_version` to `v4.3.2` and adds two new bug-fix entries (paste-into-frame parenting and a custom-shape cropping crash). > > Extends `apps/docs/content/releases/v4.3.0.mdx` with GitHub release links and a new **Patch releases** section covering `v4.3.1` and `v4.3.2`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ee7dc07. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
huppy-bot bot
pushed a commit
that referenced
this pull request
Feb 16, 2026
In order to keep release documentation current after the v4.3.2 patch release, this PR updates both the archived and next release notes. ### Changes **v4.3.0.mdx:** - Add GitHub release link for v4.3.0 - Add v4.3.1 patch section (draw shape delta encoding precision fix) - Add v4.3.2 patch section (custom shape crop fix) **next.mdx:** - Update `last_version` from v4.3.1 to v4.3.2 - Add bug fix entries for #7938 (paste-into-frame) and #7931 (crop isCircle) ### Change type - [x] `docs` ### Test plan - [ ] Verify release notes render correctly on the docs site ### Release notes - Update release notes with v4.3.1 and v4.3.2 patch entries <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Docs-only updates to markdown release notes; no runtime code changes, with minimal risk beyond potential formatting/rendering issues. > > **Overview** > Updates release documentation to reflect the `v4.3.2` patch. > > Bumps `apps/docs/content/releases/next.mdx` `last_version` to `v4.3.2` and adds two new bug-fix entries (paste-into-frame parenting and a custom-shape cropping crash). > > Extends `apps/docs/content/releases/v4.3.0.mdx` with GitHub release links and a new **Patch releases** section covering `v4.3.1` and `v4.3.2`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ee7dc07. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
In order to fix custom croppable shapes crashing when cropped (#7927), this PR prevents
getCropBoxfrom addingisCircle: undefinedto the result crop object.The
isCircleproperty was introduced for circle crops on image shapes. However,getCropBoxwas unconditionally copying it onto every result crop viaisCircle: crop.isCircle. When the input crop didn't haveisCircleset, this produced{ isCircle: undefined }— andObject.keys()includes keys withundefinedvalues. Custom shapes with their own crop validators (without anisCirclefield) would then fail withValidationError: Unexpected propertyatisCircle.The fix only copies
isCirclewhen it was explicitly set on the input crop (!= null).Closes #7927
Based on the fix from #7926 by @jamesbvaughan.
Change type
bugfixTest plan
isCirclein its crop validatorRelease notes
isCirclein their crop schemaNote
Low Risk
Small, localized change to crop serialization plus added tests; main risk is minor behavior change for callers that implicitly relied on
isCirclealways being present.Overview
Fixes a cropping regression where
getCropBoxwould always copycrop.isCircleinto the returned crop object, causingisCircle: undefinedto appear and break custom shape crop validators.getCropBoxnow only includesisCirclein the output when it’s explicitly set (non-null/undefined) on the input crop, and new unit tests cover absence/undefined cases plus validation against a custom crop schema withoutisCircle.Written by Cursor Bugbot for commit b6c7164. This will update automatically on new commits. Configure here.