Skip to content

Commit 28121b6

Browse files
taipeicoderclaude
andcommitted
site-setup: hide the Back button on the entry steps instead of exiting home
Following the removal of the goals step's inbound links, the design picker and import capture steps had their Back buttons repointed to exit to the site home. A Back button that jumps out to /home is more confusing than no Back button, and both are entry steps with nothing before them. Omit goBack for those steps so the shared step chrome hides the Back button. The design picker's back handler now mirrors that: it renders a back affordance only when the flow supplies one, keeping the shared design picker free of flow-specific knowledge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cc542cb commit 28121b6

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

client/landing/stepper/declarative-flow/flows/site-setup-flow/site-setup-flow.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ const siteSetupFlow: Flow = {
391391
}
392392

393393
switch ( currentStep ) {
394-
case 'design-setup':
395-
return exitFlow( `/home/${ siteId ?? siteSlug }` );
396-
397394
case 'importList': {
398395
if ( backToStep ) {
399396
return navigate( `${ backToStep }?siteSlug=${ siteSlug }` );
@@ -453,9 +450,6 @@ const siteSetupFlow: Flow = {
453450
case 'importReadyPreview':
454451
return navigate( `import?siteSlug=${ siteSlug }` );
455452

456-
case 'import':
457-
return exitFlow( `/home/${ siteId ?? siteSlug }` );
458-
459453
case 'verifyEmail':
460454
case 'trialAcknowledge':
461455
return navigate( `importerWordpress?${ urlQueryParams.toString() }` );
@@ -485,7 +479,18 @@ const siteSetupFlow: Flow = {
485479
}
486480
};
487481

488-
return { goNext, goBack, goToStep, submit, exitFlow };
482+
// The design picker and import capture are the flow's entry steps, so
483+
// there is nothing to go back to — omit goBack to hide the Back button
484+
// rather than send the user out to the site home.
485+
const isEntryStep = currentStep === 'design-setup' || currentStep === 'import';
486+
487+
return {
488+
goNext,
489+
goBack: isEntryStep ? undefined : goBack,
490+
goToStep,
491+
submit,
492+
exitFlow,
493+
};
489494
},
490495

491496
useAssertConditions(): AssertConditionResult {

client/landing/stepper/declarative-flow/internals/steps-repository/design-setup/unified-design-picker.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,13 @@ const UnifiedDesignPickerStep: StepType< {
426426
if ( isComingFromSuccessfulImport ) {
427427
return undefined;
428428
}
429-
return intent === 'update-design'
430-
? () =>
431-
submit?.( {
432-
eventProps: commonFilterProperties,
433-
} )
434-
: () => handleBackClick();
429+
if ( intent === 'update-design' ) {
430+
return () =>
431+
submit?.( {
432+
eventProps: commonFilterProperties,
433+
} );
434+
}
435+
return goBack ? () => handleBackClick() : undefined;
435436
};
436437

437438
const backButton = getGoBackHandler();

0 commit comments

Comments
 (0)