Skip to content

Media Editor: Add aspect ratio control to mobile toolbar - #78929

Closed
ramonjd wants to merge 1 commit into
WordPress:update/apply-media-tab-designsfrom
ramonjd:update/media-editor-aspect-ratio-mobile-toolbar
Closed

ramonjd wants to merge 1 commit into
WordPress:update/apply-media-tab-designsfrom
ramonjd:update/media-editor-aspect-ratio-mobile-toolbar

Conversation

@ramonjd

@ramonjd ramonjd commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #78896

Adds the aspect ratio control to the media editor mobile toolbar as an icon dropdown.

Kapture.2026-06-04.at.14.21.28.mp4

Why?

The mobile media editor toolbar should expose aspect ratio changes alongside the existing rotate and flip controls.

How?

  • Extends the flat media editor transform toolbar with an optional aspect ratio dropdown.
  • Wires the narrow/mobile footer toolbar to the existing crop options state.
  • Keeps the labelled sidebar crop panel behavior unchanged for wider viewports.

Testing Instructions

  1. Open the post editor, add an Image block, and click Crop.
  2. Shrink the window below 782px - check that the aspect ratio icon appears in the bottom toolbar. Click on it and make sure it works the same way as the sidebar aspect ratio dropdown.

@ramonjd ramonjd self-assigned this Jun 4, 2026
@ramonjd
ramonjd requested a review from Copilot June 4, 2026 04:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the existing crop aspect-ratio selector to the mobile/narrow media editor footer toolbar by extending the flat transform controls to optionally render an aspect-ratio dropdown, while keeping the wide/sidebar “Crop” panel behavior unchanged.

Changes:

  • Passes crop aspect-ratio state/handlers into the footer MediaEditorTransformControls for narrow layouts.
  • Extends MediaEditorTransformControls to optionally render an aspect-ratio DropdownMenu (flat toolbar only; omitted when withLabels is used).
  • Adds unit tests covering presence/absence and selection behavior of the new dropdown.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/media-editor/src/components/media-editor/index.tsx Wires narrow/footer transform controls to existing aspect-ratio state from useCropOptions.
packages/media-editor/src/components/media-editor-transform-controls/index.tsx Adds optional aspect-ratio dropdown rendering in the flat toolbar (not in labelled/panel layout).
packages/media-editor/src/components/media-editor-transform-controls/test/index.tsx Adds tests for the dropdown rendering and change callback behavior.

@ramonjd ramonjd added [Type] Enhancement A suggestion for improvement. [Feature] Media Anything that impacts the experience of managing media labels Jun 4, 2026
@ramonjd
ramonjd force-pushed the update/apply-media-tab-designs branch 3 times, most recently from 3467aa2 to be335b4 Compare June 4, 2026 07:28
@ramonjd
ramonjd force-pushed the update/media-editor-aspect-ratio-mobile-toolbar branch from de270d5 to 2f882c2 Compare June 4, 2026 07:36
@ramonjd
ramonjd deleted the branch WordPress:update/apply-media-tab-designs June 4, 2026 08:15
@ramonjd ramonjd closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants