Repository navigation
Image Editor: Remove the internal list of transform operations - #86707
Conversation
TransformOperation, the APPLY_OPERATION action and the pipeline helpers that replayed them were kept for applying edits from code. Nothing outside their own tests used them, and applyImageEdit now does that job against the same ImageEdit that getImageEdit returns. Their rotate and flip were relative, so replaying a list on an edited state applied it twice.
The Camera comment explained what a matrix is not. The internal state repeated each public field's comment in different words; it now points to ImageEditorState and keeps only the base pan, zoom and rotation, which are its own.
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -116 B (0%) Total Size: 8.64 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in
|
andrewserong
left a comment
There was a problem hiding this comment.
Looks like a clean removal to me, and we can follow-up on the shape of applyImageEdit separately in #86665 (generally looking good to me, just had a question about if we should allow containment by default to make it a little easier for consumers to work with).
What?
Part of:
Removes the image editor's internal list of transform operations:
TransformOperation, the reducer'sAPPLY_OPERATIONaction, andapplyOperationToStateandstateFromPipelineinsrc/core/transforms/pipeline.ts, with their tests. None of it was exported, and nothing outside its own tests used it.Also shortens two comments in
src/core/types.ts: theCameratype's, and the internal state's, which repeated each public field's comment in different words.Why?
The list was kept for applying edits from code. #86665 does that with
applyImageEdit, against the sameImageEditthatgetImageEditreturns. The list'srotateandflipwere relative, so replaying it on an already edited state applied them twice.Testing Instructions
No behaviour changes. Open the media editor, then rotate, flip, crop and save as usual.