Draft
Conversation
|
Size Change: +125 B (0%) Total Size: 7.91 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in f32e18d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25359022643
|
a64da94 to
f32e18d
Compare
42 tasks
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.
What changed
Adds an internal image editing session boundary for the media editor modal.
The new
ImageEditingSessionProviderowns the cropper controller, exposes modal-level image editing state through a session facade, and passes that controller intoCropperProviderfor cropper-specific UI consumers. The modal now reads image dirty state, undo/redo, and save modifier generation through the session instead of directly from the cropper context.This keeps current crop UI behavior unchanged while creating a clear ownership boundary for future image editing state such as native adjustments, filters, and image-surface extensions.
Why
The cropper should remain the low-level geometry controller, but the media editor needs a session-level owner before adding adjustments or extension-owned image edits. This avoids a temporary bridge API and makes the internal ownership model explicit from the first step.
Validation
npm run test:unit packages/media-editor/src/components/image-editing-session/test/index.tsx -- --runInBandnpm run test:unit packages/media-editor/src/image-editor/react/hooks/test/use-cropper-state.ts -- --runInBandnpm exec -- prettier --check packages/media-editor/src/components/image-editing-session/index.tsx packages/media-editor/src/components/image-editing-session/test/index.tsx packages/media-editor/src/image-editor/react/components/cropper-provider.tsxnpm run lint:js packages/media-editor/src/components/image-editing-session/index.tsx packages/media-editor/src/components/image-editing-session/test/index.tsx packages/media-editor/src/image-editor/react/components/cropper-provider.tsxgit diff --check