Skip to content

Conversation

@jeremydw
Copy link
Member

This PR adds an "image edit" dialog to the file field that lets the user recrop an uploaded image asset.

  • Only works for JPG and PNG files.
  • The primary use case is for uploaded images like partner logos, where the stakeholder may not upload the assets in the right size.
  • Uses suspense/lazy to avoid importing the library until the dialog is opened.
  • The buttons on the right are "center vertically" and "center horizontally" buttons
image

@jeremydw jeremydw requested a review from stevenle January 16, 2026 19:56
@stevenle
Copy link
Member

how does it work if someone makes an edit, saves, revisits the page and wants to re-crop from the original? can they revert back to original (the same way google photos does)? if not, let's store the original src of the image somewhere in the metadata so we have the ability to restore to originally uploaded image.

@jeremydw jeremydw force-pushed the feat/edit-image-dialog branch from 573557c to 493367d Compare January 21, 2026 18:51
@jeremydw
Copy link
Member Author

Good call - just added that feature. This is implemented via an originalSrc key on the object; and a "Restore Original" button in the dialog appears for that. Also, made a small improvement to load the full-quality Google image (rather than thumbnail).

@stevenle
Copy link
Member

thanks, lgtm. the suspense pattern probably could benefit in a bunch of places to keep the initial loading file small (and maybe we should load routes this way too via https://preactjs.com/guide/v10/preact-iso/).

@stevenle stevenle merged commit 7277c01 into main Jan 21, 2026
1 check passed
@stevenle stevenle deleted the feat/edit-image-dialog branch January 21, 2026 19:55
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.

3 participants