Skip to content

feat: add GuestPreviewScreen#8724

Open
thomastayler wants to merge 24 commits intomainfrom
tommytayler/nes-1265-create-guest-navigation-screen
Open

feat: add GuestPreviewScreen#8724
thomastayler wants to merge 24 commits intomainfrom
tommytayler/nes-1265-create-guest-navigation-screen

Conversation

@thomastayler
Copy link
Contributor

@thomastayler thomastayler commented Feb 12, 2026

  • Introduced a new GuestPreviewScreen component for guest users.
  • Updated MultiStepForm to include navigation to GuestPreviewScreen.
  • Modified LinksScreen to redirect to GuestPreviewScreen if the user is not signed in.
  • Updated localization files to include new text for the GuestPreviewScreen.
  • Adjusted the customization flow configuration to support the new screen.

Summary by CodeRabbit

  • New Features

    • Added a Guest Preview step with responsive journey preview, title display, and a "Continue with account" CTA; unsigned users are routed to the guest preview, signed-in users continue the normal flow.
  • Localization

    • Added English strings for onboarding progress, account prompt, external-link notice, card zoom hint, and sharing guidance.
  • Tests

    • Added tests covering guest preview UI and sign-in/navigation flows.

- Introduced a new GuestPreviewScreen component for guest users.
- Updated MultiStepForm to include navigation to GuestPreviewScreen.
- Modified LinksScreen to redirect to GuestPreviewScreen if the user is not signed in.
- Updated localization files to include new text for the GuestPreviewScreen.
- Adjusted the customization flow configuration to support the new screen.
@thomastayler thomastayler self-assigned this Feb 12, 2026
@linear
Copy link

linear bot commented Feb 12, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new GuestPreviewScreen component and tests, wires it into the TemplateCustomization MultiStepForm flow, routes unauthenticated users from LinksScreen to the new 'guestPreview' screen, extends the CustomizationScreen type with 'guestPreview', and adds related English locale keys.

Changes

Cohort / File(s) Summary
GuestPreviewScreen component
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx, apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/index.ts
New screen component rendering journey card previews, responsive headings, account CTA and sign-in redirect logic; index re-export added.
MultiStepForm integration
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/MultiStepForm.tsx
Imports and adds a render branch for 'guestPreview' in the form's screen rendering.
LinksScreen change
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LinksScreen/LinksScreen.tsx, apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LinksScreen/LinksScreen.spec.tsx
Adds next-firebase-auth useUser check to compute isSignedIn; after submit, unsigned users are routed to 'guestPreview' via handleScreenNavigation; tests updated to mock auth/router and assert this path.
Screens barrel & types
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/index.ts, apps/journeys-admin/src/components/TemplateCustomization/utils/getCustomizeFlowConfig/getCustomizeFlowConfig.ts
Re-exports GuestPreviewScreen and adds 'guestPreview' to the CustomizationScreen union type.
Localization
libs/locales/en/apps-journeys-admin.json
Adds six English translation keys used by the guest preview UI (headings, prompts, CTA, informational text).
Tests
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.spec.tsx
New unit tests covering GuestPreviewScreen rendering and behavior (desktop/mobile subtitles, title rendering, CardsPreview presence).

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant LinksScreen as "LinksScreen\nrgba(52,152,219,0.5)"
    participant MultiStepForm as "MultiStepForm\nrgba(41,128,185,0.5)"
    participant GuestPreview as "GuestPreviewScreen\nrgba(46,204,113,0.5)"
    participant AccountDialog as "AccountCheckDialog\nrgba(155,89,182,0.5)"
    participant AuthFlow as "AuthFlow (sign-in)\nrgba(241,196,15,0.5)"

    User->>LinksScreen: Submit links step
    LinksScreen->>LinksScreen: check isSignedIn
    alt not signed in
        LinksScreen->>MultiStepForm: handleScreenNavigation('guestPreview')
        MultiStepForm->>GuestPreview: render guestPreview
        GuestPreview->>User: show preview + CTA
        User->>GuestPreview: click "Continue with account"
        GuestPreview->>AccountDialog: open dialog
        AccountDialog->>AuthFlow: trigger sign-in (build redirect URL)
        AuthFlow->>User: navigate to /users/sign-in?redirect=...
    else signed in
        LinksScreen->>LinksScreen: handleNext()
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jianwei1
  • csiyang
  • Kneesal
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tommytayler/nes-1265-create-guest-navigation-screen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Feb 12, 2026

View your CI Pipeline Execution ↗ for commit 6c9d761

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 34s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 28s View ↗
nx run player-e2e:e2e ✅ Succeeded 4s View ↗
nx run resources-e2e:e2e ✅ Succeeded 23s View ↗
nx run watch-e2e:e2e ✅ Succeeded 31s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 6s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-05 22:31:53 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Fri Mar 6 11:25:48 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Fri Mar 6 11:25:31 NZDT 2026

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/MultiStepForm.tsx`:
- Around line 65-66: The guestPreview case currently returns <GuestPreviewScreen
/> while getCustomizeFlowConfig's screens array doesn't include 'guestPreview',
causing screens.indexOf(activeScreen) to be -1 and ProgressStepper to render
incorrectly; update either getCustomizeFlowConfig to include 'guestPreview' in
its screens array or change the render logic in MultiStepForm (where
activeScreen and screens are used for ProgressStepper) to detect 'guestPreview'
and hide the ProgressStepper entirely; additionally, ensure the "Edit Manually"
button rendering logic (the conditional that currently hides it for 'language')
also hides it when activeScreen === 'guestPreview' so guest users don't see an
inapplicable editor action.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx`:
- Around line 92-110: The desktop Typography in GuestPreviewScreen currently
shows copy copied from LinksScreen that is incorrect for a guest preview; update
the text rendered in the Typography with display={displayDesktop} (inside the
GuestPreviewScreen component) to a guest-appropriate message (e.g., a preview or
sign-up prompt) instead of "This content contains buttons linking to external
sites. Check them and update the links below." — locate the desktop variant
Typography in GuestPreviewScreen and replace its i18n key/string with the
correct guest-facing translation key or plain text, ensuring you keep the same
props (variant="subtitle2", color="text.secondary", align="center",
fontWeight={400}) and use the t(...) i18n call.
- Line 16: The file imports Box from the wrong package; change the import in
GuestPreviewScreen.tsx to pull Box from '@mui/material/Box' instead of
'@mui/system/Box' so it matches other components (e.g., MultiStepForm.tsx) and
uses the proper MUI theming behavior; update the import statement that
references Box accordingly.
- Around line 39-60: handleSignIn currently builds baseUrl without any query
params so baseUrl.includes('createNew') is always false and the use of login ??
false is redundant; modify handleSignIn to read existing query params (e.g.,
from router.query or window.location.search / URLSearchParams) and check for the
presence of createNew there, then build url by appending either &screen=social
or ?createNew=true&screen=social based on that check, and simplify the
router.push query to use login (not login ?? false); keep the rest of the
router.push shape and shallow option intact and update references to
baseUrl/journey?.id and the created url accordingly.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LinksScreen/LinksScreen.tsx`:
- Around line 192-196: The updatePromises currently invokes
blockUpdateLinkAction, blockUpdateEmailAction, and blockUpdatePhoneAction
unconditionally and then relies on Promise.allSettled to swallow auth errors for
guests; modify the logic that builds updatePromises (the section creating
promises for link/email/phone updates) to only push or call those mutation
functions when isSignedIn is true—i.e., wrap calls to blockUpdateLinkAction,
blockUpdateEmailAction, and blockUpdatePhoneAction with an if (isSignedIn) check
so guest users do not trigger the authenticated mutations (keep existing
navigation flow using handleNext/handleScreenNavigation unchanged).
🧹 Nitpick comments (3)
apps/journeys-admin/src/components/TemplateCustomization/utils/getCustomizeFlowConfig/getCustomizeFlowConfig.ts (1)

6-12: Type extension is correct; consider updating the doc comment.

Adding 'guestPreview' to the union type is the right approach since it's used as a navigation target but not part of the standard flow. The JSDoc on Line 29 still says screens are "always ordered as: language → text → links → social → done" — a brief note about guestPreview being a conditional redirect would keep the docs accurate.

libs/locales/en/apps-journeys-admin.json (1)

1020-1025: New locale strings look good — note the near-duplicate keys.

Line 1020 ("Almost There!") and Line 1021 ("Almost there!") differ only in casing. This is technically valid (distinct i18n keys), but could cause translator confusion. If the intent is the same phrase, consider unifying to a single key.

apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx (1)

13-15: Import grouping is inconsistent; CardsPreview creates cross-screen coupling.

The @core import on Line 13 is placed between relative imports (Lines 11–12 and Line 15), breaking the conventional grouping (external → @core → relative).

More importantly, importing CardsPreview from ../LinksScreen/CardsPreview (Line 15) couples GuestPreviewScreen to LinksScreen's internal module. If CardsPreview is reused across screens, consider extracting it to a shared location (e.g., a sibling components/ directory).

@github-actions github-actions bot temporarily deployed to Preview - watch-modern February 12, 2026 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 12, 2026 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 12, 2026 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys February 12, 2026 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 12, 2026 02:05 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Fri Mar 6 11:26:04 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Fri Mar 6 11:26:43 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Fri Mar 6 11:26:59 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Fri Mar 6 11:26:54 NZDT 2026

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@libs/locales/en/apps-journeys-admin.json`:
- Line 1008: There are two near-duplicate locale keys ("Almost there!" and
"Almost There!") causing ambiguity; pick a single canonical key (e.g., "Almost
There!" or "Almost there!") and remove the duplicate entry from
libs/locales/en/apps-journeys-admin.json, then update any components/usages to
reference the chosen key (search for "Almost there!" and "Almost There!" in the
repo) and adjust tests or docs accordingly; if the distinction was intentional,
add a brief comment in the JSON or locale documentation explaining the
difference.
🧹 Nitpick comments (2)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx (2)

23-29: Consider narrowing the useMemo dependency to journey?.blocks.

The memo depends on [journey], but only journey.blocks is consumed inside it. If the journey object reference changes for reasons unrelated to blocks (e.g., title update), this will needlessly recompute the tree. Narrowing the dependency avoids unnecessary work.

Proposed fix
  const steps = useMemo(
    () =>
      journey != null
        ? (transformer(journey.blocks ?? []) as Array<TreeBlock<StepBlock>>)
        : [],
-   [journey]
+   [journey?.blocks]
  )

154-158: Extract inline onClose handler into a named function.

Per coding guidelines, event functions should use a "handle" prefix. The inline arrow on onClose could be extracted for consistency with handleContinueToPreview and handleSignIn.

Proposed fix
+ function handleCloseAccountDialog(): void {
+   setOpenAccountDialog(false)
+ }
+
  ...
  <AccountCheckDialog
    open={openAccountDialog}
-   onClose={() => setOpenAccountDialog(false)}
+   onClose={handleCloseAccountDialog}
    handleSignIn={handleSignIn}
  />

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Fri Mar 6 11:27:54 NZDT 2026

- Updated GuestPreviewScreen to accept handleScreenNavigation as a prop for improved navigation control.
- Modified MultiStepForm to pass the handleScreenNavigation function to GuestPreviewScreen.
@github-actions github-actions bot temporarily deployed to Preview - watch-modern February 16, 2026 23:02 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 16, 2026 23:02 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 16, 2026 23:02 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 16, 2026 23:02 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys February 16, 2026 23:02 Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/MultiStepForm.tsx`:
- Around line 63-70: In MultiStepForm.tsx the switch cases are reversed: the
'guestPreview' case returns DoneScreen and the 'done' case returns
GuestPreviewScreen; update the switch so case 'guestPreview' returns
<GuestPreviewScreen handleScreenNavigation={handleScreenNavigation} /> and case
'done' returns <DoneScreen handleScreenNavigation={handleScreenNavigation} />
(and tidy/remove the stale commented labels if desired) to restore correct
rendering.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx`:
- Line 41: The handleContinueToPreview function is currently a no-op; update it
to call setOpenAccountDialog(true) so clicking "Continue with account" opens the
account dialog, ensure the AccountCheckDialog component is rendered in the
component JSX (e.g., before the closing </Stack>) with props
open={openAccountDialog}, onClose={() => setOpenAccountDialog(false)} and
handleSignIn={handleSignIn}; this uses the existing openAccountDialog state,
setOpenAccountDialog setter, AccountCheckDialog import, and handleSignIn handler
to restore the intended interaction.
- Around line 76-96: The two duplicate Typography blocks in GuestPreviewScreen
both render t('Almost there!') with only variant and display differing; remove
the duplicate and render a single Typography in place of both (reference:
component GuestPreviewScreen and the duplicated Typography elements) that uses a
responsive variant and display via the sx prop or useMediaQuery — e.g., replace
the two elements with one Typography that sets sx={{ typography: { xs: 'h5', sm:
'h3' }, display: { xs: displayMobile, sm: displayDesktop }, mb: { xs: 0, sm: 2 }
}} and keep gutterBottom and the same translated text to preserve layout and
behavior.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed.


In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx`:
- Around line 76-96: The two duplicate Typography blocks in GuestPreviewScreen
both render t('Almost there!') with only variant and display differing; remove
the duplicate and render a single Typography in place of both (reference:
component GuestPreviewScreen and the duplicated Typography elements) that uses a
responsive variant and display via the sx prop or useMediaQuery — e.g., replace
the two elements with one Typography that sets sx={{ typography: { xs: 'h5', sm:
'h3' }, display: { xs: displayMobile, sm: displayDesktop }, mb: { xs: 0, sm: 2 }
}} and keep gutterBottom and the same translated text to preserve layout and
behavior.
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx (1)

76-96: Consider consolidating duplicate heading Typography elements.

The desktop and mobile headings both render t('Almost there!') with nearly identical props — only variant and display differ. This could be simplified with a single Typography using responsive variant via the sx prop or the MUI useMediaQuery hook, reducing duplication.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/GuestPreviewScreen/GuestPreviewScreen.tsx`
around lines 76 - 96, The two duplicate Typography blocks in GuestPreviewScreen
both render t('Almost there!') with only variant and display differing; remove
the duplicate and render a single Typography in place of both (reference:
component GuestPreviewScreen and the duplicated Typography elements) that uses a
responsive variant and display via the sx prop or useMediaQuery — e.g., replace
the two elements with one Typography that sets sx={{ typography: { xs: 'h5', sm:
'h3' }, display: { xs: displayMobile, sm: displayDesktop }, mb: { xs: 0, sm: 2 }
}} and keep gutterBottom and the same translated text to preserve layout and
behavior.

@github-actions github-actions bot temporarily deployed to Preview - journeys February 17, 2026 00:50 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 17, 2026 00:50 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 17, 2026 00:50 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern February 17, 2026 00:50 Inactive
csiyang
csiyang previously approved these changes Feb 17, 2026
thomastayler and others added 10 commits February 17, 2026 03:01
- Adjusted typography properties for better mobile and desktop display.
- Ensured consistent font usage across different screen sizes.
- Adjusted screen rendering logic to correctly handle 'done' and 'guestPreview' cases.
- Introduced a new variable to manage active step for the progress stepper based on the current screen.
- Enhanced guest preview screen insertion logic based on user sign-in status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants