Skip to content

Conversation

@dhasilva
Copy link
Contributor

Part of FORMS-60

Proposed changes:

  • Fixes warnings when there is no custom block styling
  • Fixes the behavior of the block inserter
  • Adds styling for the input on the frontend

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

For the warning fix:

  • On an unsandboxed Simple site, create an image select field and add images, but do not change the default style
  • Publish it and go to the frontend
  • Check that there are warnings
  • Sandbox your test Simple site with this PR
  • Go to the published post again
  • Check that the warnings are gone

For the block inserter behavior:

  • Without this PR, go to the block editor and add an image select field
  • Hover between two options. Check that the block inserter does not appear
  • Apply this PR
  • Check that the vertical block inserter is displayed now

For the frontend styles:

  • Publish a form with two image select fields containing images on all options. In one of them, enable multi selection.
  • Style the options as desired. Try disabling the style syncing on the image select field and then styling each option differently
  • Check that the selected images have checkmarks on them, emulating the normal checkboxes

Note: Contrary to all other use cases of checkboxes and radio inputs, this one sits on top of an image, which can be difficult to see depending on the colors and the image. Also, the way used on other places to determine colors will not work on this case as each option can be styled separately, so I used filters to determine a combination of colors based on the text color as a proposal.

Before After
Screenshot from 2025-08-28 21-42-26 Screenshot from 2025-08-28 21-15-53

@dhasilva dhasilva requested a review from a team August 29, 2025 00:45
@dhasilva dhasilva self-assigned this Aug 29, 2025
@dhasilva dhasilva added [Status] Needs Review This PR is ready for review. [Type] Task I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. labels Aug 29, 2025
@github-actions github-actions bot added [Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form labels Aug 29, 2025
@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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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 🤖


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
Copy link
Contributor

github-actions bot commented Aug 29, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the update/forms-image-select-input-style branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-image-select-input-style

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@jp-launch-control
Copy link

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/modules/form/view.js 0/241 (0.00%) 0.00% 7 💔
projects/packages/forms/src/contact-form/class-contact-form-field.php 735/1367 (53.77%) -0.04% 1 ❤️‍🩹
projects/packages/forms/src/blocks/input-image-option/edit.tsx 0/24 (0.00%) 0.00% -2 💚

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@dhasilva dhasilva merged commit 97b045a into trunk Aug 29, 2025
73 checks passed
@dhasilva dhasilva deleted the update/forms-image-select-input-style branch August 29, 2025 21:18
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Package] Forms [Type] Task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants