You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ui): preview image edits before saving - #18622
Applying an image edit now updates the Admin preview immediately, before the document is saved.
When you select Apply Changes, the Admin sends the pending edits to a new preview endpoint that applies them to the original image using the transformation API. The endpoint returns temporary image previews without saving the document or storing transformed files in Payload. Selecting Save persists the edits as usual.
To achieve this, I added the following:
A new preview endpoint: Accepts unsaved edits or new file bytes, runs permission/content checks then returns an image without persisting the changes anywhere in payload.
Transformer mode preview: Runs the existing transformation pipeline against a temp state
Admin previous hook: Requests previews after "Apply Changes" is selected, then displays the temporary blob urls for the image and its sizes.
This is great - do you think the focus point should also change to keep it's same percentage. It threw me at first because it crops center but the focus point is on the right, should this keep to the center as you drag?
This is great - do you think the focus point should also change to keep it's same percentage. It threw me at first because it crops center but the focus point is on the right, should this keep to the center as you drag?
Do you mean the focal point should stay at the same relative position within the crop (so a centered point stays centered as you drag) or stay anchored to the same subject in the original image?
This is great - do you think the focus point should also change to keep it's same percentage. It threw me at first because it crops center but the focus point is on the right, should this keep to the center as you drag?
Do you mean the focal point should stay at the same relative position within the crop (so a centered point stays centered as you drag) or stay anchored to the same subject in the original image?
Staying anchored to the same subject sounds like a really good user exerpeince. Though I was just meaning keeping the same relative position, in the video I saw a disconnect where the focus point is and where the crop actually ends up.
This branch has not been deployed
No deployments
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
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.
Applying an image edit now updates the Admin preview immediately, before the document is saved.
When you select Apply Changes, the Admin sends the pending edits to a new preview endpoint that applies them to the original image using the transformation API. The endpoint returns temporary image previews without saving the document or storing transformed files in Payload. Selecting Save persists the edits as usual.
To achieve this, I added the following:
Preview
payload-pr-demo-upload-edit-preview-take-1.mp4
Drag crop
payload-pr-demo-drag-crop-take-2.mp4