Deduplicate client-side image sizes with matching dimensions#77036
Conversation
Group thumbnail size names by their effective dimensions (width, height, crop) before generating sideload items. When multiple registered sizes share the same dimensions, only one physical file is generated and the server registers it under all matching size names in attachment metadata. Extends the sideload endpoint's image_size parameter to accept an array of size names, so one upload can be registered for multiple sizes. Fixes #77035
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
|
Size Change: +72 B (0%) Total Size: 7.75 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in e1f2c01. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24695476831
|
swissspidy
left a comment
There was a problem hiding this comment.
Tests would be nice, but otherwise LGTM
|
Note: I will create a core backport for these changes once the client side media feature has been restored to core. |
Extend the sideload REST controller tests to cover the new behaviour of accepting an array of image_size names, including the happy path where one physical file is registered under multiple sizes in attachment metadata, and backwards compatibility when a single-element array is passed. On the JavaScript side, add regression tests ensuring that sizes with matching dimensions but different crop values are treated as distinct groups, and that three or more sizes sharing identical dimensions collapse into a single sideload request.
Resolve conflicts by adapting the image_size array support to the new finalize architecture: sideload_item now returns the array in sub_size_data verbatim, and finalize_item registers the file under each size name when image_size is an array. Update SubSizeData.image_size TypeScript type and the sub_sizes schema accordingly.
Added some additional test coverage in 850cf35 |
Restore the newline that was lost between the final else branch and the return statement during the merge conflict resolution, which caused PHPCS to flag tab alignment between the closing brace and the return.
…sertion" This reverts commit 6b47f61.
The oneOf schema with {type: string} and {type: array} sub-schemas caused
a "matches more than one of the expected formats" error on newer
WordPress core because rest_is_array() treats scalar strings as
single-element lists (via wp_parse_list). Both schemas matched a plain
string, and rest_find_one_matching_schema() requires exactly one match.
Replace the oneOf schemas with type: [string, array]. For the sideload
endpoint, move the enum validation into a validate_callback so that
sizes registered after route-registration (e.g. via add_image_size() in
tests) are still honored, and so the check applies correctly to both
string and array inputs.
* Deduplicate client-side image sizes with matching dimensions Group thumbnail size names by their effective dimensions (width, height, crop) before generating sideload items. When multiple registered sizes share the same dimensions, only one physical file is generated and the server registers it under all matching size names in attachment metadata. Extends the sideload endpoint's image_size parameter to accept an array of size names, so one upload can be registered for multiple sizes. Fixes #77035 * Add test coverage for image_size array deduplication Extend the sideload REST controller tests to cover the new behaviour of accepting an array of image_size names, including the happy path where one physical file is registered under multiple sizes in attachment metadata, and backwards compatibility when a single-element array is passed. On the JavaScript side, add regression tests ensuring that sizes with matching dimensions but different crop values are treated as distinct groups, and that three or more sizes sharing identical dimensions collapse into a single sideload request. * Fix PHPCS coding standards in sideload_item Restore the newline that was lost between the final else branch and the return statement during the merge conflict resolution, which caused PHPCS to flag tab alignment between the closing brace and the return. * TEMP: Add diagnostic message to regular_sub_sizes finalize assertion * Revert "TEMP: Add diagnostic message to regular_sub_sizes finalize assertion" This reverts commit 6b47f61. * Fix schema validation for string image_size against newer WordPress core The oneOf schema with {type: string} and {type: array} sub-schemas caused a "matches more than one of the expected formats" error on newer WordPress core because rest_is_array() treats scalar strings as single-element lists (via wp_parse_list). Both schemas matched a plain string, and rest_find_one_matching_schema() requires exactly one match. Replace the oneOf schemas with type: [string, array]. For the sideload endpoint, move the enum validation into a validate_callback so that sizes registered after route-registration (e.g. via add_image_size() in tests) are still honored, and so the check applies correctly to both string and array inputs.
The feature shipping target moved from 7.0 to 7.1 (per #76756). Bring the architecture explanation and how-to guide up to date with the post-7.0-cycle state of the code: - Reposition introductions around 7.1 with 7.0 as the groundwork cycle. - HEIC/HEIF: document the canvas-based fallback path (createImageBitmap, HTMLImageElement+OffscreenCanvas, HEIC container parsing + WebCodecs VideoDecoder), JPEG companion file, and isHeicCanvasSupported() gate. - AVIF: note the wp_prevent_unsupported_mime_type_uploads bypass when generate_sub_sizes=false (#76371). - Batch thumbnail generation via image.copyMemory() / thumbnailImage() (#76979). - Sub-size deduplication via image_size: string|string[] on the sideload route (#77036). - Single VIPS instance via promise caching (#76780). - Build-output trimming: remove vips-jxl.wasm (#76639), skip non-min worker (#76615), skip WASM-inlined sourcemaps (#75993). - COI: <img> excluded from cross-origin attribute injection (#76618). - Loosened feature-detection thresholds: 2 cores, 3g (#76616). - Post-saving lock fix: Save Draft now respects the lock (#76973). - convert_format declared as boolean on sideload route (#77565). - Fix incorrect REST index settings list (only image_sizes and image_size_threshold are exposed). - Remove references to client_side_supported_mime_types filter (PR #76549 was closed unmerged); state the supported MIME set is fixed at CLIENT_SIDE_SUPPORTED_MIME_TYPES. Refs #75111.
Backport ticket: https://core.trac.wordpress.org/ticket/65330 / PR: adamsilverstein/wordpress-develop#48 |
This updates the pinned commit hash of the Gutenberg repository from `7295bd91a3c2b64bb11dde0a12313210d9d16a12 ` (version `23.0.0`) to `585cf86bb6f408b1dc61175f75db016aa4760653` (version `23.1.0`). A full list of changes included in this commit can be found on GitHub: https://github.com/WordPress/gutenberg/compare/v23.0.0..v23.1.0. The following commits are included: - Edit Site: Move show-icon-labels handling to specific edit-site call sites (WordPress/gutenberg#77287) - Boot: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77357) - Image: Fix non-local image ID removal undo trap (WordPress/gutenberg#77367) - Block Editor: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77354) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Commands: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77358) - UI: use Text in Notice.ActionLink typography (WordPress/gutenberg#77332) - Jest setup: remove unneeded rAF polyfills (WordPress/gutenberg#77378) - Fields: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77373) - Widgets: Use --wpds-cursor-control design token (WordPress/gutenberg#77368) - EditPost: Use `--wpds-cursor-control` design token for interactive controls (WordPress/gutenberg#77360) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - UI: Use shared style-imports types (WordPress/gutenberg#77388) - Stop adding “noreferrer” to external links except File block. (WordPress/gutenberg#26968) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Externalize react-dom/client (WordPress/gutenberg#77326) - Data: Export and consolidate 'onSubKey' helper (WordPress/gutenberg#77364) - Paragraph: Refactor replacement logic in 'useOnEnter' hook (WordPress/gutenberg#77383) - Fix pseudo selector block style rendering in the editor (WordPress/gutenberg#76879) - Tabs: Lock top-level structure and disable visibility controls (WordPress/gutenberg#77370) - Share React CSS custom properties typing (WordPress/gutenberg#77394) - Notes: Refactor and extract offset calculation logic (WordPress/gutenberg#77414) - Tabs: Remove redundant version field from block.json (WordPress/gutenberg#77417) - Latest Comments: Fix uneven padding issue causing mis-alignment (WordPress/gutenberg#77379) - Workflow: Use --wpds-cursor-control design token (WordPress/gutenberg#77369) - blocks: Port over some of the type information for @wordpress/blocks from DefinitelyTyped (WordPress/gutenberg#77393) - Notes: Extract floating notes state into a dedicated store (WordPress/gutenberg#77424) - Tabs: Handle duplicating tabs (WordPress/gutenberg#76449) - Components: Refactor NavigableContainer from class to function component (WordPress/gutenberg#77171) - UI: Fix focus-trap broken by ThemeProvider's display:contents (WordPress/gutenberg#77381) - viewport visibility: use 'key' instead of 'value' for device type (WordPress/gutenberg#77410) - Update changelog for blocks package (WordPress/gutenberg#77437) - Tabs: Clean up Edit components (WordPress/gutenberg#77426) - Media editor: remove unused dependency (WordPress/gutenberg#77438) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Ensure Post Template fallback styles don't apply when minimumColumnWidth is defined (WordPress/gutenberg#77411) - UI: Upgrade title validation to cleanup-based re-validation (WordPress/gutenberg#77165) - ui/Tabs: Fix `act()` warnings in tests (WordPress/gutenberg#77319) - docs: Clarify UI package setup for different contexts (WordPress/gutenberg#77338) - Fix: Preserve aspectRatio and scale when switching to wide/full align… (WordPress/gutenberg#76914) - Link: Honor `openInNewTab` consistently (WordPress/gutenberg#77422) - Block Supports: Add min width support to dimensions (WordPress/gutenberg#76949) - Link: Remove underline from unstyled icon links (WordPress/gutenberg#77420) - Theme: Update Terrazzo packages to 2.0 (WordPress/gutenberg#77432) - Editor: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77376) - GlobalStylesUI: Use `--wpds-cursor-control` design token for interact… (WordPress/gutenberg#77335) - Typescript: Migrate keyboard-shortcuts to TS (WordPress/gutenberg#76287) - GlobalStylesUI: Remove unused CSS rule (WordPress/gutenberg#77456) - Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77474) - Ensure layout classnames are applied to the inner blocks wrapper and not to its siblings (WordPress/gutenberg#77408) - Fix: Change Featured Image toggle label to 'Make image a link' (WordPress/gutenberg#71931) - Autocomplete: Skip stale triggers from completed mentions (WordPress/gutenberg#77185) - Fix: Add cursor pointer to the ariakit menu item component - Issue - WordPress/gutenberg#70411 (WordPress/gutenberg#70412) - Guidelines CPT: Skip registration when post type already exists (WordPress/gutenberg#77486) - ESLint: Introduce bulk suppressions workflow (WordPress/gutenberg#77392) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - CollapsibleCard: Fix missing keyboard focus ring on the header chevron icon when rendered inside wp-admin (WordPress/gutenberg#77468) - Docs: Add ESLint v10 migration guide and polish docs (WordPress/gutenberg#77217) - Tabs: Fix missing keyboard focus ring on the panel in Windows High Contrast mode when rendered inside wp-admin (WordPress/gutenberg#77469) - EditSite: Remove unused CSS rule (WordPress/gutenberg#77494) - Card: Remove unused CardContext (WordPress/gutenberg#77463) - design-system-mcp: Add new package for design system MCP tooling (WordPress/gutenberg#77159) - Storybook: Fix component descriptions in manifest files (WordPress/gutenberg#77112) - Notes: Reduce passes in useBlockComments memo and rename outputs (WordPress/gutenberg#77440) - Upload Media: Enable concurrent sideload uploads (WordPress/gutenberg#75888) - Deduplicate client-side image sizes with matching dimensions (WordPress/gutenberg#77036) - Convert tests/unit to npm workspace (WordPress/gutenberg#77063) - UI: Portal prop and Portal subcomponents for overlay Popups (WordPress/gutenberg#77452) - Storybook: add global preview styles for @wordpress/ui overlays (WordPress/gutenberg#77451) - Experiment: Add custom taxonomies (WordPress/gutenberg#77497) - Storybook: Fix 'Open source file' links for storybook-local stories (WordPress/gutenberg#76758) - UI Dialog: Add Description, modal context, and misc improvements (WordPress/gutenberg#77194) - Docs: Update parameter type from `number` to `int` in CSS declaration methods (WordPress/gutenberg#77519) - Fix: use node_modules/.bin/stylelint to avoid npm warnings on Node 24 (WordPress/gutenberg#77512) - Text: Apply both heading and paragraph CSS defenses unconditionally (WordPress/gutenberg#77461) - Notes: Compute note positions centrally in useFloatingBoard (WordPress/gutenberg#77433) - Stylelint: Add cursor pointer rule and block-library override (WordPress/gutenberg#77501) - Admin UI: Add visual prop to Page header component (WordPress/gutenberg#76469) - Fix: post saving should be locked during media uploads (WordPress/gutenberg#76973) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Media Editor experiment: add experimental image editor and cropper (WordPress/gutenberg#77479) - UI: Start recommending new Card components (WordPress/gutenberg#77423) - Media Editor Modal: Add a media editor modal experiment (WordPress/gutenberg#77480) - Expand support for `isElementVisible` (`VisuallyHidden`) (WordPress/gutenberg#77191) - Experiments Page: Update labels for the media-related experiments to group them together and better clarify what the experiments do (WordPress/gutenberg#77536) - Media Editor: render cropper in media editor modal for images (WordPress/gutenberg#77537) - Tabs: Rename tabs blocks to follow WCAG Tabs pattern (WordPress/gutenberg#77418) - [Video Block]: Update z-index for tracks popover to ensure proper stacking context (WordPress/gutenberg#77517) - Guidelines: Make the CPT type-aware (WordPress/gutenberg#77491) - Taxonomies: add spacing above Add Taxonomy modal actions (WordPress/gutenberg#77523) - Taxonomies Route: Declare @wordpress/base-styles dependency (WordPress/gutenberg#77543) - Taxonomies: warn when editing an existing taxonomy's slug (WordPress/gutenberg#77527) - Site Logo Block: Enable the media editor modal experiment for the crop button (WordPress/gutenberg#77548) - Menu: Fix flaky submenu focus test (WordPress/gutenberg#77430) - Add no-unsafe-render-order ESLint rule (WordPress/gutenberg#77428) - UI: Update `@base-ui/react` from `1.4.0` to `1.4.1` (WordPress/gutenberg#77520) - components: Menu popover render + surface/motion split (WordPress/gutenberg#77460) - Upload Media: Use .jpg extension for HEIC-to-JPEG client conversion (WordPress/gutenberg#77506) - Consolidate ESLint config into tools/eslint/ workspace package (WordPress/gutenberg#77215) - UI: Add Drawer primitive (WordPress/gutenberg#76690) - Fix import order in block-editor `custom-css.js` (WordPress/gutenberg#77566) - Experiment: Follow up improvements on taxonomies(77497) (WordPress/gutenberg#77567) - Client-side media: declare convert_format as boolean arg on sideload route (WordPress/gutenberg#77565) - Media Upload Modal: Enhance filtering logic to support "text/vtt" and "video/*" (WordPress/gutenberg#77550) - Media Editor: add cropper controls to the media editor modal (WordPress/gutenberg#77540) - Media Editor: add zoom control and hide fine rotation on narrow viewports (WordPress/gutenberg#77585) - Remove ZebulanStanphill from CODEOWNERS (WordPress/gutenberg#77586) - Image editor: reserve inner gutter so crop handles stay accessible (WordPress/gutenberg#77547) - Docs: Auto-generate per-block API reference pages from block.json (WordPress/gutenberg#77350) - Embed: Fix variation upgrade undo trap (WordPress/gutenberg#77546) - fix: block-mover up/down button tooltip positions (WordPress/gutenberg#77588) - fix: edit-post back button tooltip position (WordPress/gutenberg#77587) - Revert "Docs: Auto-generate per-block API reference pages from block.json (https://github.com/WordPress/gutenberg/pull/7…" (WordPress/gutenberg#77590) - Experiment: Add delete action to taxonomy management (WordPress/gutenberg#77524) - Tests: Remove duplicate mentions spec (WordPress/gutenberg#77593) - Notes: Refactor to use new '@wordpress/ui' components (WordPress/gutenberg#77589) - wp-build: Widen optional peer dependency ranges (WordPress/gutenberg#77568) - Eslint: Improve design token linting for CSS declaration strings (WordPress/gutenberg#77384) - ESLint: Add `use-import-as` rule (WordPress/gutenberg#77389) - Experiments: register `gutenberg-dashboard-widgets` flag (WordPress/gutenberg#77569) - Media: Move image output format filtering to upload response (WordPress/gutenberg#75793) - Dashboard: register admin page route + sidebar menu (shell) (WordPress/gutenberg#77573) - Experiment: Fix console errors/warnings for taxonomies (WordPress/gutenberg#77601) - Experiment: Improve `taxonomies` DataViews height (WordPress/gutenberg#77603) - Experimental Image Cropper: Ensure focus is on canvas when dragging (WordPress/gutenberg#77591) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Experimental Image Cropper: Tweak the keyboard interactions with drag handles and canvas (WordPress/gutenberg#77639) - Fix: block-mover horizontal tooltip position (WordPress/gutenberg#77597) - Experiment: Render taxonomy status as a Badge (WordPress/gutenberg#77635) - Guidelines: Drop default_term from wp_guideline_type taxonomy (WordPress/gutenberg#77592) - Form blocks: Update block categories for form, form-input, form-submission-notification, and form-submit-button (WordPress/gutenberg#61916) - Experiment: Split status action to two actions, make them bulk-capable (WordPress/gutenberg#77637) - ButtonGroup: Inline z-index (WordPress/gutenberg#77621) - VisuallyHidden: Recommend @wordpress/ui and migrate usages (WordPress/gutenberg#77575) - Experiment: Improve taxonomy `edit` action (WordPress/gutenberg#77605) - FormToggle: Inline z-index (WordPress/gutenberg#77619) - ResizableBox: Inline handle z-index (WordPress/gutenberg#77620) - Build: Skip sourcemaps for WASM-inlined script module workers (WordPress/gutenberg#75993) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - Experiments: Rebuild the wp-admin Experiments screen on the wp-build routes pattern (WordPress/gutenberg#77443) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - Update TypeScript to tsgo (7.0) (WordPress/gutenberg#77177) - Revert tsgo update as it breaks trunk (WordPress/gutenberg#77680) - Image editor: fix locked-ratio resize driver-axis on non-square images (WordPress/gutenberg#77664) - Image editor: hold Shift while resizing to lock current aspect ratio (WordPress/gutenberg#77663) - [Admin UI]: Move to CSS modules and implement logical properties (WordPress/gutenberg#77088) - ui: Forward style and className on *.Popup to inner Base UI Popup (WordPress/gutenberg#77693) - ui: Align WithCustomZIndex Storybook examples across overlays (WordPress/gutenberg#77648) - ui: Uniform title and description styles across overlays (WordPress/gutenberg#77692) - UI: Add `Autocomplete` primitive (WordPress/gutenberg#77642) - Admin UI: change default heading level from h2 to h1 (WordPress/gutenberg#77617) - ui/Dialog, ui/AlertDialog, ui/Drawer: support sticky header and footer (WordPress/gutenberg#77559) - e2e: shorten visit-site-editor canvas-loader visible wait (WordPress/gutenberg#77725) - Gutenberg Experiments: Ensure the experiment is active before outputting flags (WordPress/gutenberg#77728) - Image editor: formalize cropper contract (WordPress/gutenberg#77668) - Image Editor experiment: Pass theme aspect ratios to media editor (WordPress/gutenberg#77665) - Media Editor Modal: save via Core's /edit modifiers (WordPress/gutenberg#77641) - Experiment: Taxonomies new package and `add/edit` screens (WordPress/gutenberg#77657) - Media editor: confirm before discarding unsaved changes (WordPress/gutenberg#77730) - `FormTokenField`: Add `help` prop to render additional help text below the field (WordPress/gutenberg#77552) - Migrate `test/integration` into `@wordpress/integration-tests` workspace (WordPress/gutenberg#77556) - Tabs: Add classic theme styles to reset button defaults (WordPress/gutenberg#77607) - Media Editor Modal: surface save failures as scoped snackbar notices (WordPress/gutenberg#77733) - DataForm: Render field `description` as help text in the `array` control (WordPress/gutenberg#77554) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - fix: disable custom css command for non block themes (WordPress/gutenberg#77685) - Experiments: Declare `@wordpress/base-styles` dependency (WordPress/gutenberg#77684) - Notes: Refactor internals into smaller components (WordPress/gutenberg#77614) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Admin UI: use UI Text component in header (WordPress/gutenberg#77372) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Refactor Admin UI / Breadcrumbs to use DS components and design tokens (WordPress/gutenberg#77012) - ui: Unify hairline border across overlay popups (WordPress/gutenberg#77691) - Base Styles: Remove stale z-index entries (WordPress/gutenberg#77714) - CircularOptionPicker: Inline z-index values (WordPress/gutenberg#77715) - ComplementaryArea: Inline z-index values (WordPress/gutenberg#77717) - Disable TinyMCE: Warning instead of direct redirect (WordPress/gutenberg#77747) - Tooltip: Fix flaky unit test (WordPress/gutenberg#77751) - Admin UI: ensure consistent header spacing with and without actions (WordPress/gutenberg#76683) - RTC: fix connection lost error on large update cause by mismatch between update size bounds check and expanded base64 update size (WordPress/gutenberg#77669) - Add `@wordpress/grid` package (WordPress/gutenberg#77562) - Base styles: update changelog to be clearer (WordPress/gutenberg#77767) - Media editor modal: add interactive grid (WordPress/gutenberg#77771) - Media editor: avoid double-mount flicker on open (WordPress/gutenberg#77732) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - Accordion: Remove invalid `isBlock` prop from `ToggleControl` (WordPress/gutenberg#77776) - Guidelines: Extract initial public API methods (WordPress/gutenberg#77643) - Embed: Restore paragraph with URL when undoing paste-to-embed transform (WordPress/gutenberg#77551) - Guidelines: Split singleton REST API into dedicated /content-guidelines route (WordPress/gutenberg#77734) - Allow EmptyState from @wordpress/ui in recommended components (WordPress/gutenberg#77765) - Block Editor: Fix blockGap fallback parsing for nested var() values (WordPress/gutenberg#77750) - Core Data: Remove redundant memoization wrapper from 'getQueriedItems' (WordPress/gutenberg#77483) - Enhancement: Add descriptive name for docker container images (WordPress/gutenberg#67827) - Fix: Add Missing Dimension Controls & Limited Customization in Accordion Block (WordPress/gutenberg#77780) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Widgets: add widget-types data layer (WordPress/gutenberg#77752) - Grid: fix `width: 'fill'` when tiles span multiple rows (WordPress/gutenberg#77769) - CollapsibleCard: Prevent focus ring clipping by content overflow (WordPress/gutenberg#77667) - Block editor: Remove stale reusable block z-index styles (WordPress/gutenberg#77774) - Grid: add @types/jest devDependency (WordPress/gutenberg#77801) - Env: Minor refactoring of cacheDirectoryPath evaluation (WordPress/gutenberg#77799) - User Taxonomies: show Public field in create/edit form (WordPress/gutenberg#77802) - Experiment: Taxonomies REST controller (WordPress/gutenberg#77697) - Experiment: Taxonomies implement `auto-fill labels` (WordPress/gutenberg#77786) - UI: Recommend Link component for use (WordPress/gutenberg#77505) - ExternalLink: Align appearance with Link from @wordpress/ui (WordPress/gutenberg#77790) - Disable TinyMCE: Repurpose experiment as Classic block removal (WordPress/gutenberg#77838) - Media Upload Modal: Fix pagination and search (WordPress/gutenberg#77872) - Disable Classic block: Always register, hide from inserter conditionally (WordPress/gutenberg#77840) - Disable Classic block: Control inserter support via filter (WordPress/gutenberg#77845) - Classic Block: Unwrap experiment to hide it from inserter (WordPress/gutenberg#77911) - RTC: Attach sync observers after hydrating persisted CRDT doc (WordPress/gutenberg#77966) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - Fix PHP multisite tests (WordPress/gutenberg#77825) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) Props adamsilverstein, jorbin, westonruter, wildworks. Fixes #65558. git-svn-id: https://develop.svn.wordpress.org/trunk@62581 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `7295bd91a3c2b64bb11dde0a12313210d9d16a12 ` (version `23.0.0`) to `585cf86bb6f408b1dc61175f75db016aa4760653` (version `23.1.0`). A full list of changes included in this commit can be found on GitHub: https://github.com/WordPress/gutenberg/compare/v23.0.0..v23.1.0. The following commits are included: - Edit Site: Move show-icon-labels handling to specific edit-site call sites (WordPress/gutenberg#77287) - Boot: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77357) - Image: Fix non-local image ID removal undo trap (WordPress/gutenberg#77367) - Block Editor: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77354) - Test: Connectors Point to the righ page. (WordPress/gutenberg#77272) - Commands: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77358) - UI: use Text in Notice.ActionLink typography (WordPress/gutenberg#77332) - Jest setup: remove unneeded rAF polyfills (WordPress/gutenberg#77378) - Fields: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77373) - Widgets: Use --wpds-cursor-control design token (WordPress/gutenberg#77368) - EditPost: Use `--wpds-cursor-control` design token for interactive controls (WordPress/gutenberg#77360) - Post Editor: Store metaboxes RTC-compatible flag on location entries (WordPress/gutenberg#77361) - UI: Use shared style-imports types (WordPress/gutenberg#77388) - Stop adding “noreferrer” to external links except File block. (WordPress/gutenberg#26968) - Core Abilities: Export initialization promise as `ready` (WordPress/gutenberg#77254) - Externalize react-dom/client (WordPress/gutenberg#77326) - Data: Export and consolidate 'onSubKey' helper (WordPress/gutenberg#77364) - Paragraph: Refactor replacement logic in 'useOnEnter' hook (WordPress/gutenberg#77383) - Fix pseudo selector block style rendering in the editor (WordPress/gutenberg#76879) - Tabs: Lock top-level structure and disable visibility controls (WordPress/gutenberg#77370) - Share React CSS custom properties typing (WordPress/gutenberg#77394) - Notes: Refactor and extract offset calculation logic (WordPress/gutenberg#77414) - Tabs: Remove redundant version field from block.json (WordPress/gutenberg#77417) - Latest Comments: Fix uneven padding issue causing mis-alignment (WordPress/gutenberg#77379) - Workflow: Use --wpds-cursor-control design token (WordPress/gutenberg#77369) - blocks: Port over some of the type information for @wordpress/blocks from DefinitelyTyped (WordPress/gutenberg#77393) - Notes: Extract floating notes state into a dedicated store (WordPress/gutenberg#77424) - Tabs: Handle duplicating tabs (WordPress/gutenberg#76449) - Components: Refactor NavigableContainer from class to function component (WordPress/gutenberg#77171) - UI: Fix focus-trap broken by ThemeProvider's display:contents (WordPress/gutenberg#77381) - viewport visibility: use 'key' instead of 'value' for device type (WordPress/gutenberg#77410) - Update changelog for blocks package (WordPress/gutenberg#77437) - Tabs: Clean up Edit components (WordPress/gutenberg#77426) - Media editor: remove unused dependency (WordPress/gutenberg#77438) - Block Editor: Strip per-block custom CSS on save for users without edit_css (WordPress/gutenberg#76650) - Ensure Post Template fallback styles don't apply when minimumColumnWidth is defined (WordPress/gutenberg#77411) - UI: Upgrade title validation to cleanup-based re-validation (WordPress/gutenberg#77165) - ui/Tabs: Fix `act()` warnings in tests (WordPress/gutenberg#77319) - docs: Clarify UI package setup for different contexts (WordPress/gutenberg#77338) - Fix: Preserve aspectRatio and scale when switching to wide/full align… (WordPress/gutenberg#76914) - Link: Honor `openInNewTab` consistently (WordPress/gutenberg#77422) - Block Supports: Add min width support to dimensions (WordPress/gutenberg#76949) - Link: Remove underline from unstyled icon links (WordPress/gutenberg#77420) - Theme: Update Terrazzo packages to 2.0 (WordPress/gutenberg#77432) - Editor: Use `--wpds-cursor-control` design token (WordPress/gutenberg#77376) - GlobalStylesUI: Use `--wpds-cursor-control` design token for interact… (WordPress/gutenberg#77335) - Typescript: Migrate keyboard-shortcuts to TS (WordPress/gutenberg#76287) - GlobalStylesUI: Remove unused CSS rule (WordPress/gutenberg#77456) - Writing Flow: fix arrow keys skipping paragraph containing link (WordPress/gutenberg#77474) - Ensure layout classnames are applied to the inner blocks wrapper and not to its siblings (WordPress/gutenberg#77408) - Fix: Change Featured Image toggle label to 'Make image a link' (WordPress/gutenberg#71931) - Autocomplete: Skip stale triggers from completed mentions (WordPress/gutenberg#77185) - Fix: Add cursor pointer to the ariakit menu item component - Issue - WordPress/gutenberg#70411 (WordPress/gutenberg#70412) - Guidelines CPT: Skip registration when post type already exists (WordPress/gutenberg#77486) - ESLint: Introduce bulk suppressions workflow (WordPress/gutenberg#77392) - Add heading level 1 for the fonts page (WordPress/gutenberg#77482) - CollapsibleCard: Fix missing keyboard focus ring on the header chevron icon when rendered inside wp-admin (WordPress/gutenberg#77468) - Docs: Add ESLint v10 migration guide and polish docs (WordPress/gutenberg#77217) - Tabs: Fix missing keyboard focus ring on the panel in Windows High Contrast mode when rendered inside wp-admin (WordPress/gutenberg#77469) - EditSite: Remove unused CSS rule (WordPress/gutenberg#77494) - Card: Remove unused CardContext (WordPress/gutenberg#77463) - design-system-mcp: Add new package for design system MCP tooling (WordPress/gutenberg#77159) - Storybook: Fix component descriptions in manifest files (WordPress/gutenberg#77112) - Notes: Reduce passes in useBlockComments memo and rename outputs (WordPress/gutenberg#77440) - Upload Media: Enable concurrent sideload uploads (WordPress/gutenberg#75888) - Deduplicate client-side image sizes with matching dimensions (WordPress/gutenberg#77036) - Convert tests/unit to npm workspace (WordPress/gutenberg#77063) - UI: Portal prop and Portal subcomponents for overlay Popups (WordPress/gutenberg#77452) - Storybook: add global preview styles for @wordpress/ui overlays (WordPress/gutenberg#77451) - Experiment: Add custom taxonomies (WordPress/gutenberg#77497) - Storybook: Fix 'Open source file' links for storybook-local stories (WordPress/gutenberg#76758) - UI Dialog: Add Description, modal context, and misc improvements (WordPress/gutenberg#77194) - Docs: Update parameter type from `number` to `int` in CSS declaration methods (WordPress/gutenberg#77519) - Fix: use node_modules/.bin/stylelint to avoid npm warnings on Node 24 (WordPress/gutenberg#77512) - Text: Apply both heading and paragraph CSS defenses unconditionally (WordPress/gutenberg#77461) - Notes: Compute note positions centrally in useFloatingBoard (WordPress/gutenberg#77433) - Stylelint: Add cursor pointer rule and block-library override (WordPress/gutenberg#77501) - Admin UI: Add visual prop to Page header component (WordPress/gutenberg#76469) - Fix: post saving should be locked during media uploads (WordPress/gutenberg#76973) - RTC: Fixed orphaned meta causing dirty editor state (WordPress/gutenberg#77529) - Media Editor experiment: add experimental image editor and cropper (WordPress/gutenberg#77479) - UI: Start recommending new Card components (WordPress/gutenberg#77423) - Media Editor Modal: Add a media editor modal experiment (WordPress/gutenberg#77480) - Expand support for `isElementVisible` (`VisuallyHidden`) (WordPress/gutenberg#77191) - Experiments Page: Update labels for the media-related experiments to group them together and better clarify what the experiments do (WordPress/gutenberg#77536) - Media Editor: render cropper in media editor modal for images (WordPress/gutenberg#77537) - Tabs: Rename tabs blocks to follow WCAG Tabs pattern (WordPress/gutenberg#77418) - [Video Block]: Update z-index for tracks popover to ensure proper stacking context (WordPress/gutenberg#77517) - Guidelines: Make the CPT type-aware (WordPress/gutenberg#77491) - Taxonomies: add spacing above Add Taxonomy modal actions (WordPress/gutenberg#77523) - Taxonomies Route: Declare @wordpress/base-styles dependency (WordPress/gutenberg#77543) - Taxonomies: warn when editing an existing taxonomy's slug (WordPress/gutenberg#77527) - Site Logo Block: Enable the media editor modal experiment for the crop button (WordPress/gutenberg#77548) - Menu: Fix flaky submenu focus test (WordPress/gutenberg#77430) - Add no-unsafe-render-order ESLint rule (WordPress/gutenberg#77428) - UI: Update `@base-ui/react` from `1.4.0` to `1.4.1` (WordPress/gutenberg#77520) - components: Menu popover render + surface/motion split (WordPress/gutenberg#77460) - Upload Media: Use .jpg extension for HEIC-to-JPEG client conversion (WordPress/gutenberg#77506) - Consolidate ESLint config into tools/eslint/ workspace package (WordPress/gutenberg#77215) - UI: Add Drawer primitive (WordPress/gutenberg#76690) - Fix import order in block-editor `custom-css.js` (WordPress/gutenberg#77566) - Experiment: Follow up improvements on taxonomies(77497) (WordPress/gutenberg#77567) - Client-side media: declare convert_format as boolean arg on sideload route (WordPress/gutenberg#77565) - Media Upload Modal: Enhance filtering logic to support "text/vtt" and "video/*" (WordPress/gutenberg#77550) - Media Editor: add cropper controls to the media editor modal (WordPress/gutenberg#77540) - Media Editor: add zoom control and hide fine rotation on narrow viewports (WordPress/gutenberg#77585) - Remove ZebulanStanphill from CODEOWNERS (WordPress/gutenberg#77586) - Image editor: reserve inner gutter so crop handles stay accessible (WordPress/gutenberg#77547) - Docs: Auto-generate per-block API reference pages from block.json (WordPress/gutenberg#77350) - Embed: Fix variation upgrade undo trap (WordPress/gutenberg#77546) - fix: block-mover up/down button tooltip positions (WordPress/gutenberg#77588) - fix: edit-post back button tooltip position (WordPress/gutenberg#77587) - Revert "Docs: Auto-generate per-block API reference pages from block.json (https://github.com/WordPress/gutenberg/pull/7…" (WordPress/gutenberg#77590) - Experiment: Add delete action to taxonomy management (WordPress/gutenberg#77524) - Tests: Remove duplicate mentions spec (WordPress/gutenberg#77593) - Notes: Refactor to use new '@wordpress/ui' components (WordPress/gutenberg#77589) - wp-build: Widen optional peer dependency ranges (WordPress/gutenberg#77568) - Eslint: Improve design token linting for CSS declaration strings (WordPress/gutenberg#77384) - ESLint: Add `use-import-as` rule (WordPress/gutenberg#77389) - Experiments: register `gutenberg-dashboard-widgets` flag (WordPress/gutenberg#77569) - Media: Move image output format filtering to upload response (WordPress/gutenberg#75793) - Dashboard: register admin page route + sidebar menu (shell) (WordPress/gutenberg#77573) - Experiment: Fix console errors/warnings for taxonomies (WordPress/gutenberg#77601) - Experiment: Improve `taxonomies` DataViews height (WordPress/gutenberg#77603) - Experimental Image Cropper: Ensure focus is on canvas when dragging (WordPress/gutenberg#77591) - Template parts: make 'Detach' context menu item consistent across patterns and template parts (WordPress/gutenberg#77581) - Experimental Image Cropper: Tweak the keyboard interactions with drag handles and canvas (WordPress/gutenberg#77639) - Fix: block-mover horizontal tooltip position (WordPress/gutenberg#77597) - Experiment: Render taxonomy status as a Badge (WordPress/gutenberg#77635) - Guidelines: Drop default_term from wp_guideline_type taxonomy (WordPress/gutenberg#77592) - Form blocks: Update block categories for form, form-input, form-submission-notification, and form-submit-button (WordPress/gutenberg#61916) - Experiment: Split status action to two actions, make them bulk-capable (WordPress/gutenberg#77637) - ButtonGroup: Inline z-index (WordPress/gutenberg#77621) - VisuallyHidden: Recommend @wordpress/ui and migrate usages (WordPress/gutenberg#77575) - Experiment: Improve taxonomy `edit` action (WordPress/gutenberg#77605) - FormToggle: Inline z-index (WordPress/gutenberg#77619) - ResizableBox: Inline handle z-index (WordPress/gutenberg#77620) - Build: Skip sourcemaps for WASM-inlined script module workers (WordPress/gutenberg#75993) - RTC: Fix "Connection Lost" dialog when too many entities are loaded (WordPress/gutenberg#77631) - Experiments: Rebuild the wp-admin Experiments screen on the wp-build routes pattern (WordPress/gutenberg#77443) - Connectors: Treat network-active plugins as active in plugin status check (WordPress/gutenberg#77661) - Update TypeScript to tsgo (7.0) (WordPress/gutenberg#77177) - Revert tsgo update as it breaks trunk (WordPress/gutenberg#77680) - Image editor: fix locked-ratio resize driver-axis on non-square images (WordPress/gutenberg#77664) - Image editor: hold Shift while resizing to lock current aspect ratio (WordPress/gutenberg#77663) - [Admin UI]: Move to CSS modules and implement logical properties (WordPress/gutenberg#77088) - ui: Forward style and className on *.Popup to inner Base UI Popup (WordPress/gutenberg#77693) - ui: Align WithCustomZIndex Storybook examples across overlays (WordPress/gutenberg#77648) - ui: Uniform title and description styles across overlays (WordPress/gutenberg#77692) - UI: Add `Autocomplete` primitive (WordPress/gutenberg#77642) - Admin UI: change default heading level from h2 to h1 (WordPress/gutenberg#77617) - ui/Dialog, ui/AlertDialog, ui/Drawer: support sticky header and footer (WordPress/gutenberg#77559) - e2e: shorten visit-site-editor canvas-loader visible wait (WordPress/gutenberg#77725) - Gutenberg Experiments: Ensure the experiment is active before outputting flags (WordPress/gutenberg#77728) - Image editor: formalize cropper contract (WordPress/gutenberg#77668) - Image Editor experiment: Pass theme aspect ratios to media editor (WordPress/gutenberg#77665) - Media Editor Modal: save via Core's /edit modifiers (WordPress/gutenberg#77641) - Experiment: Taxonomies new package and `add/edit` screens (WordPress/gutenberg#77657) - Media editor: confirm before discarding unsaved changes (WordPress/gutenberg#77730) - `FormTokenField`: Add `help` prop to render additional help text below the field (WordPress/gutenberg#77552) - Migrate `test/integration` into `@wordpress/integration-tests` workspace (WordPress/gutenberg#77556) - Tabs: Add classic theme styles to reset button defaults (WordPress/gutenberg#77607) - Media Editor Modal: surface save failures as scoped snackbar notices (WordPress/gutenberg#77733) - DataForm: Render field `description` as help text in the `array` control (WordPress/gutenberg#77554) - Revisions: Improve screen reader accessibility for diff markers region and slider (WordPress/gutenberg#77660) - fix: disable custom css command for non block themes (WordPress/gutenberg#77685) - Experiments: Declare `@wordpress/base-styles` dependency (WordPress/gutenberg#77684) - Notes: Refactor internals into smaller components (WordPress/gutenberg#77614) - Connectors: Add role="list" wrapper to connector cards for valid ARIA structure (WordPress/gutenberg#77689) - Admin UI: use UI Text component in header (WordPress/gutenberg#77372) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Refactor Admin UI / Breadcrumbs to use DS components and design tokens (WordPress/gutenberg#77012) - ui: Unify hairline border across overlay popups (WordPress/gutenberg#77691) - Base Styles: Remove stale z-index entries (WordPress/gutenberg#77714) - CircularOptionPicker: Inline z-index values (WordPress/gutenberg#77715) - ComplementaryArea: Inline z-index values (WordPress/gutenberg#77717) - Disable TinyMCE: Warning instead of direct redirect (WordPress/gutenberg#77747) - Tooltip: Fix flaky unit test (WordPress/gutenberg#77751) - Admin UI: ensure consistent header spacing with and without actions (WordPress/gutenberg#76683) - RTC: fix connection lost error on large update cause by mismatch between update size bounds check and expanded base64 update size (WordPress/gutenberg#77669) - Add `@wordpress/grid` package (WordPress/gutenberg#77562) - Base styles: update changelog to be clearer (WordPress/gutenberg#77767) - Media editor modal: add interactive grid (WordPress/gutenberg#77771) - Media editor: avoid double-mount flicker on open (WordPress/gutenberg#77732) - Command Palette: Fix macOs label for sites unable to determine UA via PHP (WordPress/gutenberg#77638) - Accordion: Remove invalid `isBlock` prop from `ToggleControl` (WordPress/gutenberg#77776) - Guidelines: Extract initial public API methods (WordPress/gutenberg#77643) - Embed: Restore paragraph with URL when undoing paste-to-embed transform (WordPress/gutenberg#77551) - Guidelines: Split singleton REST API into dedicated /content-guidelines route (WordPress/gutenberg#77734) - Allow EmptyState from @wordpress/ui in recommended components (WordPress/gutenberg#77765) - Block Editor: Fix blockGap fallback parsing for nested var() values (WordPress/gutenberg#77750) - Core Data: Remove redundant memoization wrapper from 'getQueriedItems' (WordPress/gutenberg#77483) - Enhancement: Add descriptive name for docker container images (WordPress/gutenberg#67827) - Fix: Add Missing Dimension Controls & Limited Customization in Accordion Block (WordPress/gutenberg#77780) - Connectors: keep focus on action Button during install (WordPress/gutenberg#77544) - Widgets: add widget-types data layer (WordPress/gutenberg#77752) - Grid: fix `width: 'fill'` when tiles span multiple rows (WordPress/gutenberg#77769) - CollapsibleCard: Prevent focus ring clipping by content overflow (WordPress/gutenberg#77667) - Block editor: Remove stale reusable block z-index styles (WordPress/gutenberg#77774) - Grid: add @types/jest devDependency (WordPress/gutenberg#77801) - Env: Minor refactoring of cacheDirectoryPath evaluation (WordPress/gutenberg#77799) - User Taxonomies: show Public field in create/edit form (WordPress/gutenberg#77802) - Experiment: Taxonomies REST controller (WordPress/gutenberg#77697) - Experiment: Taxonomies implement `auto-fill labels` (WordPress/gutenberg#77786) - UI: Recommend Link component for use (WordPress/gutenberg#77505) - ExternalLink: Align appearance with Link from @wordpress/ui (WordPress/gutenberg#77790) - Disable TinyMCE: Repurpose experiment as Classic block removal (WordPress/gutenberg#77838) - Media Upload Modal: Fix pagination and search (WordPress/gutenberg#77872) - Disable Classic block: Always register, hide from inserter conditionally (WordPress/gutenberg#77840) - Disable Classic block: Control inserter support via filter (WordPress/gutenberg#77845) - Classic Block: Unwrap experiment to hide it from inserter (WordPress/gutenberg#77911) - RTC: Attach sync observers after hydrating persisted CRDT doc (WordPress/gutenberg#77966) - RTC: Fix compaction unit test (WordPress/gutenberg#77986) - RTC: Fix divergence when two offline users reconnect (WordPress/gutenberg#77980) - Fix PHP multisite tests (WordPress/gutenberg#77825) - Connectors: Stop e2e capability restriction from leaking across specs (WordPress/gutenberg#77857) Props adamsilverstein, jorbin, westonruter, wildworks. Fixes #65558. Built from https://develop.svn.wordpress.org/trunk@62581 git-svn-id: http://core.svn.wordpress.org/trunk@61861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Summary
When themes register image sizes with the same dimensions as WordPress built-in sizes (e.g., Twenty Eleven's
largeis 768x1024, same asmedium_large), client-side media processing creates duplicate physical files with-1suffixes. Server-side uploads handle this correctly.This PR fixes the issue by:
sizesToGenerateby effective dimensions (width, height, crop) before the sideload loop. Only one physical file is generated per unique dimension set, and all matching size names are passed to the server in a single sideload request.image_sizeparameter to accept an array of size names, so one uploaded file is registered under all matching sizes in attachment metadata.Changes
packages/upload-media/src/store/private-actions.ts— Group sizes by dimensions using aMap, pass array of names when multiple sizes share dimensionspackages/upload-media/src/store/types.ts— Updateimage_sizetype tostring | string[]lib/media/class-gutenberg-rest-attachments-controller.php— AcceptoneOfstring or array forimage_sizeparam, loop over all names when registering in metadatapackages/upload-media/src/store/test/actions.ts— Add test verifying deduplication behaviorTest plan
Test on trunk vs PR:
-1suffixes in the uploads directoryFixes #77035