Skip to content
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ed85b32
Add RefreshedSplash component.
ankitrox Sep 16, 2025
0a7e3d2
Add refresh flow test.
ankitrox Sep 16, 2025
a5c43c2
Update tests and snapshots.
ankitrox Sep 16, 2025
ba39e16
Add stories for SFR.
ankitrox Sep 16, 2025
bda97c5
Add support for wider viewport.
ankitrox Sep 17, 2025
e7864a6
Fix: Redo plugin setup layout.
ankitrox Sep 17, 2025
f548203
Add lazy svg component.
ankitrox Sep 17, 2025
686b0ef
Update tests.
ankitrox Sep 18, 2025
9d5fea2
Restore package.json file.
ankitrox Sep 18, 2025
1908d8a
Snapshots updated.
ankitrox Sep 18, 2025
51938ab
Revert file changes.
ankitrox Sep 18, 2025
447b585
Resolve conflicts.
ankitrox Sep 25, 2025
f22e3c6
Address CR feedback.
ankitrox Sep 25, 2025
908a079
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 26, 2025
5b3d138
Address CR feedback.
ankitrox Sep 26, 2025
88e397a
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 30, 2025
82f43ad
Address CR feedback.
ankitrox Sep 30, 2025
893b317
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 30, 2025
0f9ffaa
Add minor styling adjustments.
ankitrox Sep 30, 2025
193db13
Update status.
ankitrox Sep 30, 2025
bb45f16
Align opt-in checkbox.
ankitrox Sep 30, 2025
63c655f
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Oct 6, 2025
9c8edce
Update: CR feedback addressal.
ankitrox Oct 6, 2025
f0d7501
Update reference images.
ankitrox Oct 6, 2025
40a9c51
Fix: splash screen VRT differences.
ankitrox Oct 6, 2025
0f68333
Update responsive designs.
ankitrox Oct 6, 2025
974e8e1
Update VRT reference images.
ankitrox Oct 6, 2025
a81a9b4
Add `viewBox` to `splash-screenshot-wide-viewport.svg`.
techanvil Oct 7, 2025
8524fba
Simplify screenshot rendering, remove unneeded image, and fix styling.
techanvil Oct 7, 2025
88c5036
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Oct 8, 2025
5734453
Merge branch 'enhancement/11333-splash-screen' of github.com:google/s…
ankitrox Oct 8, 2025
856d9a9
Restore inline rendering of SVGs for the legacy splash screen.
techanvil Oct 8, 2025
5503dbb
Update snapshots.
techanvil Oct 8, 2025
47f3af6
Update VRT reference images.
ankitrox Oct 8, 2025
7bbba32
Update VRT reference images.
ankitrox Oct 8, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/**
* LegacySplashContent component.
*
* Site Kit by Google, Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* External dependencies
*/
import PropTypes from 'prop-types';

/**
* WordPress dependencies
*/
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import ActivateAnalyticsNotice from '@/js/components/setup/ActivateAnalyticsNotice';
import CompatibilityChecks from '@/js/components/setup/CompatibilityChecks';
import Link from '@/js/components/Link';
import P from '@/js/components/Typography/P';
import WelcomeSVG from '@/svg/graphics/welcome.svg';
import WelcomeAnalyticsSVG from '@/svg/graphics/welcome-analytics.svg';
import Typography from '@/js/components/Typography';
import { Cell, Row } from '@/js/material-components';
import { DISCONNECTED_REASON_CONNECTED_URL_MISMATCH } from '@/js/googlesitekit/datastore/user/constants';

export default function LegacySplashContent( {
analyticsModuleActive,
analyticsModuleAvailable,
children,
connectedProxyURL,
description,
disconnectedReason,
getHelpURL,
homeURL,
secondAdminLearnMoreLink,
showLearnMoreLink,
title,
} ) {
const cellDetailsProp = analyticsModuleActive
? { smSize: 4, mdSize: 8, lgSize: 6 }
: { smSize: 4, mdSize: 8, lgSize: 8 };

return (
<Row className="googlesitekit-setup__content">
<Cell
smSize={ 4 }
mdSize={ 8 }
lgSize={ ! analyticsModuleActive ? 4 : 6 }
className="googlesitekit-setup__icon"
>
{ analyticsModuleActive && (
<WelcomeSVG width="570" height="336" />
) }
{ ! analyticsModuleActive && (
<WelcomeAnalyticsSVG height="167" width="175" />
) }
</Cell>

<Cell { ...cellDetailsProp }>
<Typography
as="h1"
className="googlesitekit-setup__title"
size="large"
type="headline"
>
{ title }
</Typography>

<p className="googlesitekit-setup__description">
{ ! showLearnMoreLink && description }

{ showLearnMoreLink &&
createInterpolateElement(
sprintf(
/* translators: 1: The description. 2: The learn more link. */
__(
'%1$s <Link>%2$s</Link>',
'google-site-kit'
),
description,
__( 'Learn more', 'google-site-kit' )
),
{
Link: (
<Link
href={ secondAdminLearnMoreLink }
external
/>
),
}
) }
</p>
{ getHelpURL && (
<Link href={ getHelpURL } external>
{ __( 'Get help', 'google-site-kit' ) }
</Link>
) }
{ DISCONNECTED_REASON_CONNECTED_URL_MISMATCH ===
disconnectedReason &&
connectedProxyURL !== homeURL && (
<P>
{ sprintf(
/* translators: %s: Previous Connected Proxy URL */
__( '— Old URL: %s', 'google-site-kit' ),
connectedProxyURL
) }
<br />
{ sprintf(
/* translators: %s: Connected Proxy URL */
__( '— New URL: %s', 'google-site-kit' ),
homeURL
) }
</P>
) }

{ analyticsModuleAvailable && ! analyticsModuleActive && (
<ActivateAnalyticsNotice />
) }

<CompatibilityChecks>{ children }</CompatibilityChecks>
</Cell>
</Row>
);
}

LegacySplashContent.propTypes = {
analyticsModuleActive: PropTypes.bool,
analyticsModuleAvailable: PropTypes.bool,
children: PropTypes.func,
connectedProxyURL: PropTypes.oneOfType( [
PropTypes.string,
PropTypes.bool,
] ),
description: PropTypes.string,
disconnectedReason: PropTypes.string,
getHelpURL: PropTypes.string,
homeURL: PropTypes.string,
secondAdminLearnMoreLink: PropTypes.string,
title: PropTypes.string.isRequired,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* SetupFlowSVG component.
*
* Site Kit by Google, Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* WordPress dependencies
*/
import { lazy, Suspense } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import PreviewBlock from '@/js/components/PreviewBlock';
import MediaErrorHandler from '@/js/components/MediaErrorHandler';

const LazySVGComponent = lazy( () =>
import( '../../../../svg/graphics/splash-screenshot.svg' )
);

export default function SetupFlowSVG() {
return (
<Suspense fallback={ <PreviewBlock width="100%" height="100%" /> }>
<MediaErrorHandler
errorMessage={ __(
'Failed to load graphic',
'google-site-kit'
) }
>
<LazySVGComponent />
</MediaErrorHandler>
</Suspense>
);
}
133 changes: 32 additions & 101 deletions assets/js/components/setup/SetupUsingProxyWithSignIn/Splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,28 @@ import punycode from 'punycode';
/**
* WordPress dependencies
*/
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { getQueryArg } from '@wordpress/url';

/**
* Internal dependencies
*/
import { useSelect } from 'googlesitekit-data';
import WelcomeSVG from '@/svg/graphics/welcome.svg';
import WelcomeAnalyticsSVG from '@/svg/graphics/welcome-analytics.svg';
import Link from '@/js/components/Link';
import ActivateAnalyticsNotice from '@/js/components/setup/ActivateAnalyticsNotice';
import CompatibilityChecks from '@/js/components/setup/CompatibilityChecks';
import { useFeature } from '@/js/hooks/useFeature';
import LegacySplashContent from '@/js/components/setup/SetupUsingProxyWithSignIn/LegacySplashContent';
import SplashContent from '@/js/components/setup/SetupUsingProxyWithSignIn/SplashContent';
import { CORE_MODULES } from '@/js/googlesitekit/modules/datastore/constants';
import { CORE_SITE } from '@/js/googlesitekit/datastore/site/constants';
import {
CORE_USER,
DISCONNECTED_REASON_CONNECTED_URL_MISMATCH,
} from '@/js/googlesitekit/datastore/user/constants';
import { Cell, Grid, Row } from '@/js/material-components';
import { Grid } from '@/js/material-components';
import { MODULE_SLUG_ANALYTICS_4 } from '@/js/modules/analytics-4/constants';
import Typography from '@/js/components/Typography';
import P from '@/js/components/Typography/P';

export default function Splash( { children } ) {
const setupFlowRefreshEnabled = useFeature( 'setupFlowRefresh' );

const analyticsModuleAvailable = useSelect( ( select ) =>
select( CORE_MODULES ).isModuleAvailable( MODULE_SLUG_ANALYTICS_4 )
);
Expand All @@ -75,10 +72,6 @@ export default function Splash( { children } ) {
select( CORE_SITE ).getDocumentationLinkURL( 'url-has-changed' )
);

const cellDetailsProp = analyticsModuleActive
? { smSize: 4, mdSize: 8, lgSize: 6 }
: { smSize: 4, mdSize: 8, lgSize: 8 };

let title;
let description;
let showLearnMoreLink = false;
Expand Down Expand Up @@ -114,6 +107,8 @@ export default function Splash( { children } ) {
'google-site-kit'
);
showLearnMoreLink = true;
} else if ( setupFlowRefreshEnabled ) {
title = __( 'Let’s get started!', 'google-site-kit' );
} else {
title = __( 'Set up Site Kit', 'google-site-kit' );
description = __(
Expand All @@ -122,97 +117,33 @@ export default function Splash( { children } ) {
);
}

return (
<section className="googlesitekit-setup__splash">
<Grid>
<Row className="googlesitekit-setup__content">
<Cell
smSize={ 4 }
mdSize={ 8 }
lgSize={ ! analyticsModuleActive ? 4 : 6 }
className="googlesitekit-setup__icon"
>
{ analyticsModuleActive && (
<WelcomeSVG width="570" height="336" />
) }
{ ! analyticsModuleActive && (
<WelcomeAnalyticsSVG height="167" width="175" />
) }
</Cell>

<Cell { ...cellDetailsProp }>
<Typography
as="h1"
className="googlesitekit-setup__title"
size="large"
type="headline"
>
{ title }
</Typography>

<p className="googlesitekit-setup__description">
{ ! showLearnMoreLink && description }
const classname = setupFlowRefreshEnabled
? 'googlesitekit-splash'
: 'googlesitekit-setup__splash';

{ showLearnMoreLink &&
createInterpolateElement(
sprintf(
/* translators: 1: The description. 2: The learn more link. */
__(
'%1$s <Link>%2$s</Link>',
'google-site-kit'
),
description,
__( 'Learn more', 'google-site-kit' )
),
{
Link: (
<Link
href={
secondAdminLearnMoreLink
}
external
/>
),
}
) }
</p>
{ getHelpURL && (
<Link href={ getHelpURL } external>
{ __( 'Get help', 'google-site-kit' ) }
</Link>
) }
{ DISCONNECTED_REASON_CONNECTED_URL_MISMATCH ===
disconnectedReason &&
connectedProxyURL !== homeURL && (
<P>
{ sprintf(
/* translators: %s: Previous Connected Proxy URL */
__(
'— Old URL: %s',
'google-site-kit'
),
connectedProxyURL
) }
<br />
{ sprintf(
/* translators: %s: Connected Proxy URL */
__(
'— New URL: %s',
'google-site-kit'
),
homeURL
) }
</P>
) }
const SplashComponent = setupFlowRefreshEnabled
? SplashContent
: LegacySplashContent;

{ analyticsModuleAvailable &&
! analyticsModuleActive && (
<ActivateAnalyticsNotice />
) }
const splashProps = {
analyticsModuleActive,
secondAdminLearnMoreLink,
homeURL,
analyticsModuleAvailable,
disconnectedReason,
title,
description,
getHelpURL,
connectedProxyURL,
showLearnMoreLink,
};

<CompatibilityChecks>{ children }</CompatibilityChecks>
</Cell>
</Row>
return (
<section className={ classname }>
<Grid>
<SplashComponent { ...splashProps }>
{ children }
</SplashComponent>
</Grid>
</section>
);
Expand Down
Loading
Loading