-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add recrop button for trail images #1660
Conversation
76c5298
to
c3cb5a7
Compare
c3cb5a7
to
4187584
Compare
4187584
to
cab5f03
Compare
Yay, thank you!
And if container uses 4:5, it restricts to 4:5, right? (sorry for being pedantic!) |
cab5f03
to
50fe403
Compare
It should yes. My comment was more an example that it preserves whatever logic was there already. |
…existing image ready to create a new crop (with any ratio constraints)
50fe403
to
42c074d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT!
Not one for this PR, but it might be worth adding a recrop button for replacement images as well as on the original trail image.
Thanks for the review @dblatcher
Yeah good thought, I did consider that myself at the time but didn't want to change the UX too much - so as you say for a future PR perhaps (also let's see if any users request that once they've had this PR's functionality for a little while) |
Seen on PROD (merged by @twrichards 6 minutes and 26 seconds ago) Please check your changes! |
Related guardian/grid#4331
There appeared to be glaring omission in the functionality around 'overriding trail images' since the existing button only let you 'replace image' (taking you to grid homepage/search in the modal), unlike say composer's 'recrop button' on image elements which at least takes you to the picture that's already selected, meaning that to tweak the crop used for a trail image, the same image would need to be re-found amongst the millions in the grid.
What's changed?
In this PR we add a new 'Recrop image' button alongside the 'Replace image' button to provide the missing functionality...
... this takes the user to that specific image in crop mode (ready to create a new crop). Thanks to @waisingyiu's #1601 if the container uses 5:4 trails then the crop options will be limited to 5:4 (otherwise restricted to 5:3 when overriding trail images).
It now also passes a
seedCropId
, in anticipation of grid using it (guardian/grid#4332) for the starting position/dimensions of the new crop (particularly useful when re-cropping a 5:3 into a 5:4).Although, prompted by the 5:4 trail images situation, this feature is useful in its own right.
Checklist
General
Client