Skip to content

Conversation

@frosso
Copy link
Contributor

@frosso frosso commented Nov 7, 2025

Fixes STRIPE-798

Changes proposed in this Pull Request:

I noticed that the help text on the express checkout buttons settings page has some weird spacing.
Fixing to use the description attribute on the option itself, instead, which achieves the same result.

Before:
Screenshot 2025-11-07 at 3 33 52 PM

After:
Screenshot 2025-11-07 at 3 34 11 PM

Testing instructions

  • In wp-admin, navigate to WooCommerce > Settings > Payments > Stripe
  • Scroll down the page, click "Customize" next to "Google Pay / Apple Pay"
  • In the "Settings" section, notice how the help text of the "Theme" options is now better aligned

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@frosso frosso requested a review from Copilot November 7, 2025 14:42
@frosso frosso self-assigned this Nov 7, 2025
@frosso frosso added the type: bug The issue is a confirmed bug. label Nov 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR attempts to refactor the express checkout theme settings to use a simpler structure by replacing interpolateComponents with description properties on radio button options. However, the implementation has a critical bug that will prevent the descriptions from rendering.

  • Removes custom CSS for help text spacing
  • Refactors button theme options from embedded help text to separate description properties
  • Updates changelog entries to document the UI spacing adjustment

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
readme.txt Adds changelog entry documenting the UI spacing fix
changelog.txt Adds changelog entry documenting the UI spacing fix
client/entrypoints/express-checkout-settings/style.scss Removes custom CSS styling for option help text
client/entrypoints/express-checkout-settings/express-checkout-settings-section.js Refactors button theme options to use description properties instead of interpolated components, but introduces a bug where descriptions won't render
Comments suppressed due to low confidence (1)

client/entrypoints/express-checkout-settings/express-checkout-settings-section.js:115

  • The RadioControl component from @wordpress/components does not support a description property on individual options. It only accepts label and value properties in the options array. The descriptions added here ('Recommended for white or light-colored backgrounds...', etc.) will not be rendered in the UI.

If the goal is to display these descriptions separately from the labels, you may need to either:

  1. Use a custom RadioControl wrapper that supports per-option descriptions
  2. Use the help prop on the RadioControl component itself (though this applies to all options, not per-option)
  3. Embed the descriptions in the label as was done previously with makeButtonThemeText and interpolateComponents
const buttonThemeOptions = [
	{
		label: __( 'Dark', 'woocommerce-gateway-stripe' ),
		description: __(
			'Recommended for white or light-colored backgrounds with high contrast.',
			'woocommerce-gateway-stripe'
		),
		value: 'dark',
	},
	{
		label: __( 'Light', 'woocommerce-gateway-stripe' ),
		description: __(
			'Recommended for dark or colored backgrounds with high contrast.',
			'woocommerce-gateway-stripe'
		),
		value: 'light',
	},
	{
		label: __( 'Outline', 'woocommerce-gateway-stripe' ),
		description: __(
			'Recommended for white or light-colored backgrounds with insufficient contrast.',
			'woocommerce-gateway-stripe'
		),
		value: 'light-outline',
	},
];

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@frosso frosso requested review from a team, daledupreez and diegocurbelo and removed request for a team November 7, 2025 14:58
Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @frosso!

The changes look good, and the removed CSS is not used anywhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug The issue is a confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants