Skip to content

MediaEdit: Keep the compact control height after selecting media - #87542

Merged
ntsekouras merged 2 commits into
trunkfrom
fix/media-edit-compact-height
Nov 27, 2026
Merged

ntsekouras merged 2 commits into
trunkfrom
fix/media-edit-compact-height

Conversation

@ntsekouras

Copy link
Copy Markdown
Contributor

What?

Resolves: #75436

The compact MediaEdit control gets 2px taller after selecting media, because the selected item is wrapped in a group with its own border. This PR fixes that in the media-utils copy and updates the Identity screens to use that copy instead of the one in @wordpress/fields.

It also sets box-sizing: border-box to the picker button, because the extensible site editor page doesn't reset it and the control was 50px there.

Testing Instructions

  1. Go to Site Editor > Design > Identity
  2. Choose a site logo and observe that it has the same height as the empty Site Icon control
  3. Enable the extensible site editor experiment and check the same in its Identity screen
  4. Everything else should work as before

Use of AI Tools

Generated with Opus 5.5 and adjusted/reviewed manually.

Switch the Identity screens to the media-utils MediaEdit and fix the compact control growing by 2px once media is selected.
@ntsekouras ntsekouras added the [Type] Bug An existing feature does not function as intended label Nov 27, 2026
@ntsekouras ntsekouras self-assigned this Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: -3.72 kB (-0.04%)

Total Size: 8.72 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 380 kB -3.76 kB (-0.98%)
build/styles/media-utils/style-rtl.css 3.52 kB +12 B (+0.34%)
build/styles/media-utils/style-rtl.min.css 2.48 kB +12 B (+0.49%)
build/styles/media-utils/style.css 3.54 kB +12 B (+0.34%)
build/styles/media-utils/style.min.css 2.48 kB +11 B (+0.45%)

320a5af Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 78201a1 trunk % Change
timeToFirstByte 57.6 ms +4.95% -4.95% 57.1 ms +6.3% -4.47% 0.88%
largestContentfulPaint 88 ms +4.55% -2.27% 84 ms +16.67% -0% 4.76%
lcpMinusTtfb 29.35 ms +22.66% -5.28% 28.7 ms +22.82% -6.27% 2.26%
wpBeforeTemplate 29.06 ms +7.6% -1.69% 29.41 ms +15.13% -3.4% -1.19%
wpTemplate 23.01 ms +4.74% -6.13% 22.91 ms +2.88% -7.07% 0.44%
wpTotal 53.41 ms +5.13% -5.09% 53.27 ms +5.8% -5.46% 0.26%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 78201a1 trunk % Change
timeToFirstByte 45.1 ms +12.31% -1.55% 45.85 ms +7.31% -4.47% -1.64%
largestContentfulPaint 80 ms +10% -0% 80 ms +5% -0% 0%
lcpMinusTtfb 35.9 ms +5.01% -1.95% 35.15 ms +3.98% -3.41% 2.13%
wpBeforeTemplate 24.91 ms +8.87% -1.08% 25.04 ms +10.3% -1.2% -0.52%
wpTemplate 17.04 ms +7.39% -4.46% 16.21 ms +8.76% -2.34% 5.12%
wpTotal 41.94 ms +12.14% -1.79% 42.46 ms +6.76% -4% -1.22%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 78201a1 trunk % Change
mediaProcessingJpeg 416.63 ms +5.13% -0.19% 418.9 ms +1.7% -0.53% -0.54%
mediaProcessingAvif 6289.96 ms +0.76% -0.06% 6259.63 ms +0.14% -0.32% 0.48%
mediaProcessingJpegToAvif 4387.92 ms +0.31% -0.57% 4370.64 ms +0.26% -0.16% 0.4%

media-upload

Metric 78201a1 trunk % Change
jpegUploadProcessing 1999.43 ms +1.81% -23.39% 1967.36 ms +1.01% -20.93% 1.63%
pngUploadProcessing 282.39 ms +2.09% -2.7% 280.42 ms +1.9% -1.93% 0.7%
largeJpegUploadProcessing 1988.28 ms +0.5% -2% 2016.76 ms +0.94% -1.51% -1.41%
multipleImageUploadProcessing 2100.37 ms +0.49% -0.34% 2120.93 ms +0.93% -0.14% -0.97%

post-editor

Metric 78201a1 trunk % Change
serverResponse 453.26 ms +5.98% -5.32% 479.43 ms +1.3% -0.75% -5.46%
firstPaint 448.07 ms +5.36% -10.09% 394.45 ms +14.94% -4.21% 13.59%
domContentLoaded 810.87 ms +3.62% -3.13% 799.13 ms +4.26% -1% 1.47%
loaded 811.82 ms +3.64% -3.12% 800.2 ms +4.25% -1% 1.45%
firstContentfulPaint 460.49 ms +4.4% -3.21% 449.91 ms +5.23% -0.55% 2.35%
firstBlock 2159.75 ms +4.15% -1.55% 2193.57 ms +0.55% -0.91% -1.54%
type 16.74 ms +8.06% -6.81% 16.37 ms +9.71% -6.54% 2.26%
typeWithoutInspector 15.93 ms +9.79% -8.29% 16.33 ms +5.94% -11.64% -2.45%
typeWithTopToolbar 20.64 ms +5.96% -2.03% 22.11 ms +2.49% -8.73% -6.65%
typeContainer 7.9 ms +14.94% -9.87% 7.49 ms +12.15% -12.28% 5.47%
focus 109.35 ms +11.49% -9.08% 103.15 ms +12.34% -3.6% 6.01%
firstFocus 251.06 ms +0% -0% 266.09 ms +0% -0% -5.65%
selectAll 377.63 ms +4.99% -0.12% 370.73 ms +1.22% -0.88% 1.86%
undo 26.88 ms +3.53% -4.39% 26.59 ms +8.99% -2.26% 1.09%
listViewOpen 38.19 ms +5.66% -1.81% 35.77 ms +5.09% -1.51% 6.77%
inserterOpen 38.93 ms +5.55% -5.27% 38.43 ms +12.96% -6.82% 1.3%
inserterHover 11.08 ms +7.31% -7.04% 10.84 ms +12.36% -7.38% 2.21%
inserterSearch 8.29 ms +5.91% -9.89% 7.76 ms +6.19% -5.15% 6.83%
loadPatterns 615.07 ms +9.75% -5.39% 646.28 ms +0.86% -1.43% -4.83%
wpTotal 443.74 ms +6.14% -5.41% 469.88 ms +1.33% -0.77% -5.56%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 78201a1 trunk % Change
serverResponse 478.89 ms +1.66% -6.35% 486.59 ms +2.54% -6.95% -1.58%
firstPaint 485.42 ms +4.45% -12.57% 487.18 ms +4.12% -3.51% -0.36%
domContentLoaded 873.59 ms +10.03% -2.68% 885.78 ms +0.92% -0.42% -1.38%
loaded 874.66 ms +10.01% -2.67% 887.1 ms +0.92% -0.45% -1.4%
firstContentfulPaint 495.54 ms +12.94% -3.03% 497.55 ms +1.95% -1.89% -0.4%
firstBlock 2712.89 ms +6.48% -0.75% 2780.24 ms +0.84% -0.65% -2.42%
type 20.02 ms +16.93% -5.69% 21.5 ms +2.6% -3.07% -6.88%
navigate 124.3 ms +1.14% -3.85% 126.17 ms +3.23% -0.52% -1.48%
loadPatterns 1484.89 ms +6.21% -18.91% 1325.42 ms +14.35% -10.71% 12.03%
loadPages 1023.25 ms +0.98% -1.57% 981.01 ms +1.57% -1.35% 4.31%
wpTotal 469.38 ms +1.67% -6.51% 476.94 ms +2.56% -7.12% -1.59%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

320a5af Run

🏁 Flaky tests

Some 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.

keeps the default tab on the moved tab in /test/e2e/specs/editor/blocks/tabs.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/tabs.spec.js:736:60

320a5af Run

@github-actions github-actions Bot added [Package] Edit Site /packages/edit-site [Package] Media Utils /packages/media-utils labels Nov 27, 2026
@Mamaduka

Copy link
Copy Markdown
Member

Does this also need to be fixed in @wordpress/fields? Or is it just an issue for this particular screen?

@ntsekouras

Copy link
Copy Markdown
Contributor Author

Does this also need to be fixed in @wordpress/fields? Or is it just an issue for this particular screen?

@wordpress/fields is going to be deprecated since we use core-fields now (see here).

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wordpress/fields is going to be deprecated since we use core-fields now (see here).

Didn't know that. Thanks for the info. Change here looks good ✅

@ntsekouras
ntsekouras merged commit 923be8c into trunk Nov 27, 2026
98 checks passed
@ntsekouras
ntsekouras deleted the fix/media-edit-compact-height branch November 27, 2026 12:27
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Nov 27, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
…dPress#87542)

Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Package] Media Utils /packages/media-utils [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MediaEdit: Polish design follow ups

2 participants