Repository navigation
Conversation
The sidebar now renders the leadimage blockSchema read from the block configuration, plus the alt text field, which is stored in the content item's image_caption field and kept out of the block data.
…image-sidebar-blockdataform * claude/core-blocks-blockschema-69ed0e: Fix saving a type layout with blocks that have a blockSchema
…image-sidebar-blockdataform * claude/core-blocks-blockschema-69ed0e: Add a Form test for submitting blocks with a blockSchema without content
2 tasks
davisagli
approved these changes
Oct 21, 2026
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.
Stacked on #8472: this PR targets that branch, so the diff only shows the sidebar port. Merge #8472 first; GitHub then retargets this PR to
main.#8472 gave the
leadimageblock ablockSchema(align,href,openLinkInNewTab) but leftLeadImageSidebaras a hand-built form with legacy widgets, so the editor and the config were two separate sources. This PR ports the sidebar toBlockDataForm.What changed
LeadImageSidebarreads the schema fromblocksConfig[data['@type']].blockSchema(falling back toLeadImageBlockSchema), the same wayImageSidebarandMapsSidebardo after Add a blockSchema to the image, maps, toc, html and leadimage core blocks #8472. Add-ons can now change the lead image sidebar through the block config, andschemaEnhancers apply.image_captionfield. The sidebar adds it as the first field of the form, shows the content value, and routes its changes toonChangeField(content) instead ofonChangeBlock.BlockDataFormcallsonChangeBlockwith the whole form data when it mounts, so the sidebar strips content fields before writing the block. If an older block already stored animage_captionin its data (the block view still falls back to it), that value is kept as is.hrefuses theurlwidget, which stores a flattened URL string like the old text field did.Editor look
The fields are now rendered by the standard block form, so the sidebar looks like the Image block sidebar: alt text and alignment in the default fieldset, then a "Link settings" accordion with "Link to" (URL field with the object browser button) and "Open in a new tab". Before, the same fields were laid out by hand in a similar order.
Locales
pnpm i18ndrops three message IDs that the old sidebar defined but never rendered:Origin,External URLandNo image set in image content field. The other locale changes are source-reference updates.Tests
LeadImageSidebar.test.jsxnow mocksBlockDataFormand checks that the form gets the block schema plus the alt text field, that alt text changes go to the content and other changes to the block, that content fields stay out of the block data (and a legacyimage_captionin the block data is preserved), and that no form renders without a lead image. The snapshot changed because the hand-built widgets are replaced by the form; that change is intended.@type,align,hrefandopenLinkInNewTab. Alt text persistence itself could not be checked there, since that site has noimage_captionfield.