Skip to content

Update Channel Visibility meta box UI to match the latest designs#3262

Open
ankitrox wants to merge 26 commits intofeature/in-product-placementsfrom
update/GOOWOO-450-metabox-ui
Open

Update Channel Visibility meta box UI to match the latest designs#3262
ankitrox wants to merge 26 commits intofeature/in-product-placementsfrom
update/GOOWOO-450-metabox-ui

Conversation

@ankitrox
Copy link
Collaborator

@ankitrox ankitrox commented Feb 19, 2026

Changes proposed in this Pull Request:

Closes: https://linear.app/a8c/issue/GOOWOO-450/update-channel-visibility-meta-box-ui-to-match-the-latest-designs

Screenshots:

Screenshot 2026-02-27 at 12 48 08

Detailed test instructions:

  1. Enabled Woo Usage Tracking.
  2. Open the browser console and run the following so that events are logged: localStorage.setItem( 'debug', 'wc-admin:*' );
  3. Go to the detail page of a product under Woocommerce > Products
  4. Based on the visibility of the block (see Acceptance criteria) it should trigger the following events upon load and click.
  5. Events that are fired:
  • On component visible:
    • Event name: gla_google_ads_promo_shown
    • Context: channel-visibility-meta-box
  • On Create campaign CTA click:
    • Event name: gla_google_ads_promo_create_campaign_click
    • Context: channel-visibility-meta-box
    • Link: The CTA URL
  • On Get started CTA click:
    • Event name: gla_google_ads_promo_get_started_click
    • Context: channel-visibility-meta-box
    • Link: The CTA URL
  • On Dismiss Link click:
    • Event name: gla_google_ads_promo_dismiss_click
    • Context: channel-visibility-meta-box
  1. Ensure the events are fired as per the AC.
  2. Ensure the settings persist upon saving or updating products
  3. Component functionality and layout should match the designs from the ACs

Additional details:

Changelog entry

@github-actions github-actions bot added the changelog: update Big changes to something that wasn't broken. label Feb 19, 2026
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.7%. Comparing base (3a2489a) to head (fa8df1c).
⚠️ Report is 12 commits behind head on feature/in-product-placements.

Files with missing lines Patch % Lines
src/Admin/Admin.php 0.0% 22 Missing ⚠️
views/meta-box/channel_visibility.php 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                        Coverage Diff                        @@
##             feature/in-product-placements   #3262     +/-   ##
=================================================================
+ Coverage                             66.3%   66.7%   +0.5%     
- Complexity                            5118    5119      +1     
=================================================================
  Files                                  507     868    +361     
  Lines                                20390   26249   +5859     
  Branches                                 0    1477   +1477     
=================================================================
+ Hits                                 13515   17518   +4003     
- Misses                                6875    8558   +1683     
- Partials                                 0     173    +173     
Flag Coverage Δ
js-unit-tests 67.9% <ø> (?)
php-unit-tests 66.4% <0.0%> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
views/meta-box/channel_visibility.php 0.0% <0.0%> (ø)
src/Admin/Admin.php 0.0% <0.0%> (ø)

... and 361 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from update/GOOWOO-456-expose-campaign-creation-state to feature/in-product-placements February 20, 2026 11:39
Copy link
Collaborator

@asvinb asvinb left a comment

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Can you kindly check my comment please? Also, if you can merge the latest from feature/in-product-placements and merge any conflicts please.

Copy link
Collaborator

@asvinb asvinb left a comment

Choose a reason for hiding this comment

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

@AlejandroPerezMartin I left some comments in the PR. Can you kindly check them out please? Also there are a few things missing:

  • @fires JS Docs for events
  • updating the tracking doc via npm run doc:tracking
  • When I select a value from the select, hits the update button, the value is not persisted upon page refresh
  • Update the test instructions please.


const GoogleAdsPromoSetupCompleted = () => {
const [ channelVisibility, setChannelVisibility ] = useState(
product_is_visible ? channel_visibility : 'dont-sync-and-show'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Why this condition is tied to whether the product is visible? 🤔 ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Any chance of not hard coding the 'dont-sync-and-show' value?

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't think so, same logic and issues was in the php version, there's no way to know that unless we get rid of that logic

* Google Ads Promo "Get started" button is clicked.
*
* @event gla_google_ads_promo_create_campaign_click
* @property {string} context Context of the Google Ads Promo.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Let's add the context name here since we already know the value.

Copy link
Collaborator

@AlejandroPerezMartin AlejandroPerezMartin Mar 4, 2026

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

/**
* Get Started CTA component.
*
* @fires gla_google_ads_promo_create_campaign_click with `{ context: CHANNEL_VISIBILITY_CONTEXT, href: getGetStartedUrl() }`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Let's use the values here instead of the CHANNEL_VISIBILITY_CONTEXT and the getGetStartedUrl() function. Also there's a typo in the function name.

/**
* Google Ads Promo CTA component.
*
* @fires gla_google_ads_promo_dismiss_click with `{ context: CHANNEL_VISIBILITY_CONTEXT }`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

See my note above.


const GoogleAdsPromoSetupCompleted = () => {
const [ channelVisibility, setChannelVisibility ] = useState(
product_is_visible ? channel_visibility : 'dont-sync-and-show'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Any chance of not hard coding the 'dont-sync-and-show' value?

*
* @fires gla_google_ads_promo_shown with `{ context: CHANNEL_VISIBILITY_CONTEXT }`.
*
* @return {JSX.Element|null} The Google Ads Promo component or null.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Is the comment up to date since I don't see the component returning null 🤔

import { glaData } from '~/constants';

const GoogleAdsPromo = lazy( () =>
import( /* webpackChunkName: "google-ads-promo" */ './google-ads-promo' )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import( /* webpackChunkName: "google-ads-promo" */ './google-ads-promo' )
import( /* webpackChunkName: "channel-visibility-google-ads-promo" */ './google-ads-promo' )

Just so that there's no conflict with the order attribution one.

} = {},
} = glaData || {};

const GoogleAdsPromoSetupCompleted = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Let's add some JSDocs explaining when this component is rendered.

*
* @return {JSX.Element} The Google Ads Promo CTA component.
*/
const GoogleAdsPromoCTA = ( { onDismiss } ) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin I feel having GoogleAds in the component name is redundant. Can we just name it PromoCTA or PromoActions? Same thing applies to GoogleAdsPromoSetupCompleted component. I feel the GoogleAds prefix is unecessary.

} = {},
} = glaData || {};

const GoogleAdsPromoSetupCompleted = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlejandroPerezMartin Also maybe we should rename the component to ChannelVisibilitySettings.

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

Labels

changelog: update Big changes to something that wasn't broken.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants