Forms: Add CSS class names to multi-step form buttons #47324
Conversation
Add specific CSS class names to the previous, next, and submit buttons in multi-step form variations to enable more granular styling control. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Pull request overview
This PR adds specific CSS class names to multi-step form navigation buttons and migrates from the deprecated metaName property to the current WordPress block API standard metadata: { name: ... } property. The changes align the button definitions in the multistep-form variation with the button templates already established in the form-step-navigation edit.js file.
Changes:
- Added CSS class names (
form-button-previous is-previous,form-button-next is-next,form-button-submit is-submit) to Previous, Next, and Submit buttons in the multi-step form variation - Migrated from deprecated
metaNameproperty tometadata: { name: ... }following WordPress block API standards - Added
type: 'submit'attribute to the submit button for proper form submission behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| projects/packages/forms/src/blocks/contact-form/variations.js | Updated multi-step form button definitions to include CSS classes and proper metadata structure, matching the templates in form-step-navigation/edit.js |
| projects/packages/forms/changelog/fix-button-multi-step-variation | Added changelog entry documenting the CSS class additions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage SummaryCoverage changed in 1 file.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude review this PR. |
|
Claude finished @enejb's task in 1m 38s —— View job PR Review
SummaryThis PR adds CSS class names to multi-step form navigation buttons in
|
| Button | Class in edit.js template | Class in variations.js (this PR) |
|---|---|---|
| Previous | is-style-outline form-button-previous is-previous |
is-style-outline form-button-previous is-previous ✅ |
| Next | form-button-next is-next |
form-button-next is-next ✅ |
| Submit | form-button-submit is-submit |
form-button-submit is-submit ✅ |
The migration from the deprecated metaName to metadata: { name: ... } aligns with the WordPress block API standard, and adding type: 'submit' to the submit button is the correct approach for proper form submission.
class-contact-form-plugin.php — ✅ Looks Good
The PHP fix at the $is_submit_btn block is clean and backward-compatible:
if ( $processor->has_class( 'is-submit' ) ) {
$processor->add_class( 'is-hidden' );
} else {
$processor->add_class( 'is-submit is-hidden' );
}- New forms (with
is-submitalready inclassNamefrom variations.js): onlyis-hiddenis added. ✅ - Existing/legacy forms (without
is-submit): bothis-submit is-hiddenare still added. ✅
This is a good defensive fix to prevent duplicate classes.
changelog/fix-button-multi-step-variation — ⚠️ Minor Issues
The AI-generated changelog entry has a couple of issues per the repository's guidelines (AGENTS.md):
- Type should be
fixed, notchanged: This is fixing missing CSS classes that were supposed to be there, not introducing a new user-visible change. - Entry describes implementation details rather than the user perspective. "Add CSS class names to multi-step form buttons" describes the implementation. A user-facing description would be something like:
"Multi-step Form: Fix navigation button styling to support granular CSS customization."
Current entry:
Significance: patch
Type: changed
Add CSS class names to multi-step form buttons for improved styling control
Suggested improvement: Fix this →
Overall Assessment
This is a well-targeted fix. The core logic changes in both files are correct and the approach is solid. The only actionable feedback is adjusting the changelog entry type and description. The changes are safe to merge once the changelog is updated.
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes missing multi-step variation updates.
Follow up on - #46166
Proposed changes:
form-button-previous,is-previous,form-button-next,is-next,form-button-submit,is-submit) to multi-step form navigation buttonsOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
form-button-previous is-previousform-button-next is-nextform-button-submit is-submitChangelog
🤖 Generated with Claude Code