Skip to content

Close the help center when clicking the Big Sky add site card #103937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions client/dashboard/sites/add-new-site/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Button,
} from '@wordpress/components';
import { useViewportMatch } from '@wordpress/compose';
import { useDispatch } from '@wordpress/data';
import { __, sprintf } from '@wordpress/i18n';
import { download, reusableBlock, Icon } from '@wordpress/icons';
import devSiteBanner from 'calypso/assets/images/a8c-for-agencies/dev-site-banner.svg';
Expand Down Expand Up @@ -44,11 +45,6 @@ const offerClick = () => {
action: 'offer',
} );
};
const bigSkyClick = () => {
recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
action: 'big-sky',
} );
};

function AddNewSite( { context }: AddNewSiteProps ) {
const isDesktop = useViewportMatch( 'medium' );
Expand All @@ -60,6 +56,7 @@ function AddNewSite( { context }: AddNewSiteProps ) {
numberFormatOptions: { style: 'percent' },
} )
);
const { setShowHelpCenter } = useDispatch( 'automattic/help-center' );

return (
<Wrapper alignment="flex-start" style={ { padding: '16px' } } spacing={ 6 }>
Expand All @@ -77,7 +74,12 @@ function AddNewSite( { context }: AddNewSiteProps ) {
description={ __(
'Prompt, edit, and launch WordPress websites with Artificial Intelligence.'
) }
onClick={ bigSkyClick }
onClick={ () => {
setShowHelpCenter( false ); // Close the help center
Copy link
Contributor

@paulopmt1 paulopmt1 Jun 3, 2025

Choose a reason for hiding this comment

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

Nice! It's working as expected, and after understanding the code, I can ensure this is indeed a proper solution.

Once we close the help center, we send a PUT request to our backend

image

That's used on both Calypso + /wp-admin to know whether to show it or not:

image

Thanks for the quick fix!

recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
action: 'big-sky',
} );
} }
href={ `/setup/ai-site-builder?source=${ context }&ref=new-site-popover` }
/>
<MenuItem
Expand Down