refactor: move the Setup Wizard into @rocket.chat/ui-setup-wizard

Merged
TA
5d ago
+333-21

Proposed changes (including videos or screenshots)

Moves the Setup Wizard UI out of @rocket.chat/ui-client and the Meteor app into a new private workspace, @rocket.chat/ui-setup-wizard. Behavior doesn't change.

Each commit can be reviewed on its own:

  1. Add the @rocket.chat/ui-setup-wizard workspace. It's empty and set up like ui-media (tsc build, Jest, Storybook, oxlint).
  2. Move the Setup Wizard view. ui-client/src/views/setupWizard moves into the package with git mv, so history is kept. The only things it still takes from ui-client come through ui-client's public exports: ModalRegion, useInvalidateLicense, clientCallbacks and links. ui-client no longer depends on @rocket.chat/onboarding-ui, @rocket.chat/tools or @rocket.chat/layout.
  3. Ship the setup-wizard route type with the package. The type now lives in a regular .ts module, so it ends up in dist. That removes the duplicate declaration in apps/meteor/client/startup/routes.tsx.
  4. Lazy-load the route from the package entry. SetupWizardRoute is exported as lazy(() => import('./SetupWizardRoute')), the way ui-client exported it before. Importing the package doesn't pull the wizard or @rocket.chat/onboarding-ui into the main bundle.
  5. Move useRedirectToSetupWizard into the package. It now sits next to useRouteLock, so the rules for who enters and who leaves the wizard are in one place.
  6. Add Storybook stories for each wizard step. They cover admin info, organization info (including an already-registered workspace), server registration with and without internet, offline registration, and awaiting confirmation. The stories render SetupWizardPage against a mocked wizard context and use the real English translations.

No changeset, since the change isn't user-visible.

Issue(s)

ARCH-2596

Steps to test or reproduce

  1. Start a fresh workspace (Show_Setup_Wizard = pending). You should be sent to /setup-wizard, and every step should behave as before.
  2. On a workspace that has completed setup, opening /setup-wizard should redirect you to /home.
  3. yarn workspace @rocket.chat/ui-setup-wizard storybook shows a story for each step.

Further comments

What I verified: build, typecheck, lint and unit tests pass for ui-client and ui-setup-wizard, and apps/meteor typechecks. A static Storybook build renders every story without console errors. I haven't run the wizard in the app itself.

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • The setup wizard remains available at its existing route, and its setup flow is unchanged.
    • Administrators can continue through administrator details, organization details, server registration, offline registration, and cloud confirmation.
    • Existing workspaces that are already registered continue to skip cloud registration.
    • No changes to the setup experience are noted.