[WIP] Update form title modal implementation based on feedback#47114
Draft
[WIP] Update form title modal implementation based on feedback#47114
Conversation
Shows a modal when creating a new form to prompt the user to name it. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the FormTitleModal component from the contact-form block to the form-editor plugins directory. This centralizes form editor functionality and removes the dependency from the block's edit component. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all hooks before any conditional returns to comply with React's rules of hooks. The conditional logic now happens after all hooks are called, avoiding the need for eslint-disable comments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Stop auto-registering the form title modal and instead register/unregister it when entering/leaving the form editor. Changes: - Import and export FormTitleModal from the plugin file instead of registering it there. - Add NEW_FORMS_MODAL_PLUGIN constant and registerPlugin/unregisterPlugin calls in the form editor subscription so the plugin is only active while in the form editor. - Guard unregister with getPlugin to avoid errors and remove the static import of the plugin file. This keeps the modal's lifecycle tied to the editor state and avoids global plugin side effects.
3 tasks
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 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
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.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.