-
Notifications
You must be signed in to change notification settings - Fork 808
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
[PoC] Forms: Try using inner blocks for fields to aid styling via Global Styles #41281
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:
Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
d712a9f
to
ec6af81
Compare
ec6af81
to
af364c4
Compare
Code Coverage SummaryNo summary data is avilable for parent commit bdf6479, cannot calculate coverage changes. 😴 If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, you might try re-running the Tests / Publish coverage data job on this PR once the corresponding job on the trunk commit has succeeded. |
af364c4
to
ba9cd57
Compare
projects/packages/forms/src/blocks/contact-form/child-blocks.js
Outdated
Show resolved
Hide resolved
0ca93b3
to
2840207
Compare
be7c411
to
529d1f7
Compare
7ef2355
to
b1e5716
Compare
b1e5716
to
273a949
Compare
a089e1d
to
22728c4
Compare
Important: Note that this commit does not include updates that will apply global styles and block support styles to the individual option fields. This will require a larger refactor that might also change based on how inner blocks for the choice fields shake out.
This PR was meant as a vehicle for exploring blockers, backward compatibility requirements, necessary compromises, and UX implications of inner blocks on form fields. It has served its purpose so I'll close it now to avoid further confusion and expectations for this PR to be merged. Some next steps from here will be:
|
Thank you for this exploration @aaronrobertshaw! I know this is something really challenging but I'm curious about the main blockers that led you to close this PR instead of pushing forwards? |
Thanks for the question @ntsekouras 👍 I'm in the process of writing up findings but to answer your question specifically:
I closed the PR to manage expectations not due to blockers. On the contrary, switching to inner block based form fields in a backward compatible manner is definitely achievable. This PR has been referenced multiple times in a way that suggests to others following less closely that it is: a) imminent When a complete implementation gets a green light, there is nothing preventing this PR being resurrected. |
At this stage, it isn't even really ready for discussion and is mostly just a collection of quick hacks and copy pasta 😅
Proposed changes:
Update form fields to use inner blocks for labels and inputs. This aims to allow each of those inner blocks to opt into appropriate block supports and benefit from styling via Global Styles and theme.json.
Exploration Phase 1
What this exploration aims to answer
What Doesn't This Draft PR Do?
withSharedInputAttributes
andwithSharedLabelAttributes
Next steps
If we choose to invest further time into leveraging inner blocks for form fields, the next steps should include:
Quick Demo
Screen.Recording.2025-01-23.at.8.03.34.pm.mp4
What this exploration aims to answer
Some of the questions this exploration aims to answer include:
What Doesn't This Draft PR Do?
Essentially, most field types have been migrated to inner blocks (albeit in a hacky way). Time ran out on the exploration before new options related blocks could be implemented and choice fields properly migrated. So while the list above notes choice fields with inner blocks aren't complete or working, they should definitely be doable.
Next steps
If we choose to invest further time into leveraging inner blocks for form fields, the next steps should include:
Testing instructions:
TBA