Skip to content

Block locking: add "Lock design" action that turns content into a pattern - #79158

Closed
jasmussen wants to merge 1 commit into
trunkfrom
try/lock-design-from-lock-modal
Closed

jasmussen wants to merge 1 commit into
trunkfrom
try/lock-design-from-lock-modal

Conversation

@jasmussen

Copy link
Copy Markdown
Contributor

What?

Fixes #73599.

Adds a "Lock design…" action to the block lock modal. Selecting it closes the lock modal and opens the existing create-pattern flow, defaulting to an unsynced pattern.

state

Testing Instructions

Create a design, pick the ellipsis, choose "Lock" and see the "Lock design" button.

Use of AI Tools

Claude Opus 4.8 and hand-rolled CSS.

…tern

Adds a "Lock design…" action to the block lock modal. Selecting it closes
the lock modal and opens the existing create-pattern flow, defaulting to an
unsynced pattern. As of the WP 7.0 "pattern editing" feature, an unsynced
pattern (a block carrying `metadata.patternName`) is treated as content-only:
the design and inner layout are locked while content stays editable. So this
reuses existing infrastructure rather than introducing a new lock mechanism.

To respect package layering (block-editor must not depend on patterns/
core-data), the modal exposes a private `BlockLockModalActionsSlotFill`; the
patterns package fills it with the "Lock design…" button. The button is hidden
when the selection is already a pattern, since its design is already locked.

Addresses #73599

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jasmussen jasmussen self-assigned this Jun 12, 2026
@jasmussen
jasmussen requested a review from ellatrix as a code owner June 12, 2026 15:41
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Jun 12, 2026
@github-actions github-actions Bot added [Package] Block editor /packages/block-editor [Package] Patterns /packages/patterns labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown

Size Change: +917 B (+0.01%)

Total Size: 8.59 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 380 kB +44 B (+0.01%)
build/scripts/patterns/index.min.js 8.65 kB +694 B (+8.72%) 🔍
build/styles/block-editor/style-rtl.css 18.8 kB +46 B (+0.24%)
build/styles/block-editor/style-rtl.min.css 16.1 kB +45 B (+0.28%)
build/styles/block-editor/style.css 18.9 kB +46 B (+0.24%)
build/styles/block-editor/style.min.css 16.1 kB +42 B (+0.26%)

compressed-size-action

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 12329e4.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27426265599
📝 Reported issues:

@talldan

talldan commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

I know there's also #78608, which takes a slightly different approach. Not sure if the two are mutually compatible or if we want to pick one over the other.

@github-actions

Copy link
Copy Markdown

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 props-bot label.

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: jasmussen <joen@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: mtias <matveb@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>

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

@jasmussen

Copy link
Copy Markdown
Contributor Author

Thanks for connecting with that one, Dan. I think they are mutually exclusive, but I have no problem closing this one in favor of the other, if that's what needs to happen. I'll respond on the other thread!

@jasmussen

Copy link
Copy Markdown
Contributor Author

Closing in favor of #78608

@jasmussen jasmussen closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Package] Block editor /packages/block-editor [Package] Patterns /packages/patterns [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contentOnly patterns: add an option to lock styles in lock screen that turns content into a pattern

2 participants