-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Content only and patterns: detach edit fields from the content only experience #73605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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: -13 B (0%) Total Size: 2.57 MB
ℹ️ View Unchanged
|
packages/block-editor/src/components/inspector-controls-tabs/content-tab.js
Show resolved
Hide resolved
c0c3d5e to
7a4a5d5
Compare
lib/experiments-page.php
Outdated
| * when their parent experiments are disabled | ||
| */ | ||
| add_action( 'admin_init', 'gutenberg_handle_experiments_setting_submission' ); | ||
| function gutenberg_handle_experiments_setting_submission() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Piggy backing on this hook as a general experiments settings hook.
I'm using it to ensure that the inspector fields experiment is unset when the content only experiment is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually I like the idea that we can support sub-experiments 👍
For this particular experiment, though, is it needed? Does anything bad happen if the edit fields experiment is enabled and the content only experiment is disabled? For simplicity sake, I was wondering if it's better to just handle this in the description of the test, without needing to make the PHP logic here more complex.
On the other hand, as we continue to add more experiments, this experiments page could use some love (i.e. headings for different sections, and I'm sure this won't be the last time we need to create sub-experiments to try out different parts of experimental features).
Just thinking out loud 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything bad happen if the edit fields experiment is enabled and the content only experiment is disabled?
Not really I guess. The beef of the change checks for both: https://github.com/WordPress/gutenberg/pull/73605/files#diff-d193f64fcbd7c0c3b7c974f3768478220bf73faf5463233eb2274a1d0b3dbb11R18
We could check for both in the block library too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could check for both in the block library too?
I don't think we need both checks in the block library, though, as they're only used for the window.__experimentalContentOnlyInspectorFields experiment. If the latter is switched on and the former experiment isn't, does anything bad happen?
I guess what I'm trying to say is, the experiments seem fairly isolated to me. Or do we never want to test the editable inspector fields separately from the logic that turns inserted patterns into contentOnly?
To try to use simpler words: is it useful to test editable content fields in isolation? My hunch was that it might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Good point. It's worth a look to avoid all this complexity I reckon. I'll try it out.
…ector fields' setting and implement dependency checks for related experiments. Update UI to reflect changes in inspector controls based on experiment states.
… instead of 'experimentalContentOnlyPatternInsertion' across multiple block files for improved inspector field handling.
… to manage template activation and experiment dependencies more effectively. Ensure sub-experiments are disabled when their parent experiment is not active, enhancing the integrity of experiment states.
…and streamline the submission process for template activation settings.
f0f967f to
aba76f6
Compare
andrewserong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing nicely for me in splitting out the experiments:
With just gutenberg-content-only-pattern-insertion
With both gutenberg-content-only-pattern-insertion and `'gutenberg-content-only-inspector-fields'
And everything still appears to work as on trunk with the experiments disabled.
LGTM — I think this will help both test the pattern insertion behaviour in isolation, while allowing iterative development on the editable fields, which is a bit more of an experimental feature.
|
I appreciate all the testing/reviews |
What?
Resolves #73532
Adds a sub-experiment
gutenberg-content-only-inspector-fieldsthat gates the editable inspector fields (from PR #73374). The sub-experiment is only available whengutenberg-content-only-pattern-insertionis enabled.Changes:
ContentOnlyControlswith editable fields only shows when both experiments are enabledBlockQuickNavigation(pre-PR ContentOnly Patterns experiment: Add content only inspector fields #71730 behavior)Testing Instructions
contentOnly: Make patterns contentOnly by default upon insertionexperimentcontentOnly: Enable editable inspector fieldscheckbox appears and is enabledContentOnlyControlsshows with all editable fields (media, links, alt text, etc.)BlockQuickNavigationis shown insteadBlockQuickNavigation