Skip to content

[WIP] Update form title modal implementation based on feedback#47114

Draft
Copilot wants to merge 10 commits intotrunkfrom
copilot/sub-pr-47105
Draft

[WIP] Update form title modal implementation based on feedback#47114
Copilot wants to merge 10 commits intotrunkfrom
copilot/sub-pr-47105

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

  • Understand the codebase and existing test patterns
  • Create comprehensive tests for FormTitleModal component
    • Test: modal appears for new untitled forms without inner blocks
    • Test: modal does not appear for forms with titles
    • Test: modal does not appear for forms with inner blocks
    • Test: form title is saved correctly when user submits
    • Test: modal closes without saving when user clicks skip
    • Additional tests for edge cases and interactions (13 tests total)
  • Run tests to verify they pass (all 13 tests passing)
  • Run all form-editor tests to ensure no regressions (96 tests passing)
  • Add changelog entry
  • Final code review and security check

💡 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.

enejb and others added 8 commits February 12, 2026 13:36
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add testing instructions.
  • 🔴 Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

## Testing instructions:

* Go to '..'
*

🔴 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:

## Does this pull request change what data or activity we track or use?

My PR adds *x* and *y*.

Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Contact Form [Package] Forms [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants