Forms: disable the non-functional device visibility control on fields and inputs#49973
Open
CGastrell wants to merge 3 commits into
Open
Forms: disable the non-functional device visibility control on fields and inputs#49973CGastrell wants to merge 3 commits into
CGastrell wants to merge 3 commits into
Conversation
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
Device/viewport visibility ("Hide on…") is not honored on the field wrapper
at render time — the field render pipeline bypasses core's render_block
visibility filter — so the control did nothing. Disable the 'visibility'
block support on field and input blocks on both the JS (shared/settings,
input) and PHP (register_block_type_args filter) registrations so the
non-functional option no longer appears. Labels keep visibility support.
See FORMS-694.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aa49d16 to
5d61ca2
Compare
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.
Proposed changes
Interim "disable" measure for FORMS-694 while we decide whether to fully support per-field device visibility.
render_blockvisibility filter (gutenberg_render_block_visibility_support), so thewp-block-hidden-*classes + generated media-query CSS are never applied to the field wrapper.visibilityblock support on field and input blocks so the option no longer appears. Labels keep visibility support (they're handled separately vialabelhiddenbyblockvisibility).shared/settings/index.js(covers all field blocks) andinput/index.js.register_block_type_argsfilter scoped tojetpack/inputandjetpack/field-*(excluding the internalfield-option-*), mirroring the JS.Related
Does this pull request change what data or activity we track or use?
No.
Testing instructions
wp.blocks.hasBlockSupport( 'jetpack/field-name', 'visibility', true )returnsfalse, and server-sideWP_Block_Type_Registryreportsvisibility=falsefor fields/input while labels and other blocks remaintrue.Note
This is the lightweight "disable" path. The alternative — fully supporting per-field device visibility — would mean replicating core's
gutenberg_render_block_visibility_supportlogic inside the forms render pipeline (thewp-block-hidden-*classes + style-engine media queries) and deciding how required-and-hidden fields interact with validation and the form token. Tracked in FORMS-694.