fix(routing): finish /home migration in WelcomeStep3 + VerifyEmailPage
The original public-landing routing refactor migrated WelcomeRouter, WelcomeStep1, and WelcomeStep2 post-onboarding redirects to /home, but left four sites still pointing at the old / + query-string destinations: - WelcomeStep3 `completeWizardAndExit` (Send invites) - WelcomeStep3 `handleSkipStep` (Skip) - VerifyEmailPage post-verify auto-redirect (`setTimeout`) - VerifyEmailPage success-state "Go to dashboard" Link These all worked by accident because PublicLanding redirects authed users from / to /home — so users still landed on the dashboard, but through an unnecessary mount-and-redirect flicker, and the `?welcome=true` / `?verified=1` query markers got dropped on the way. Drop both query markers — neither is read anywhere in the codebase (grepped frontend/src; the dashboard's onboarding UX is driven by `getOnboardingStatus`, not URL state). Carrying dead URL params just invites future "is this load-bearing?" investigations. Test stubs in WelcomeStep3.test.tsx and VerifyEmailPage.test.tsx moved from `<Route path="/">` to `<Route path="/home">` so the assertions verify the new destination instead of accidentally matching the old one (the previous stubs masked the partial migration). Out of scope: AcceptInvitePage and OAuthCallbackPage still use `?welcome=teammate`, but that one carries an explicit "decoded by the dashboard in Task 41" annotation and may be wired up later, so left untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ function makeEmptyRow(): InviteRow {
|
||||
*
|
||||
* 1. POST `/accounts/me/invites/bulk` with populated rows.
|
||||
* 2. PATCH `/users/me/onboarding-step` `{step: 3, action: "complete"}`.
|
||||
* 3. Navigate to `/?welcome=true` and fire a "You're all set" toast.
|
||||
* 3. Navigate to `/home` and fire a "You're all set" toast.
|
||||
*
|
||||
* Partial-failure UX: rows in `failed[]` keep their input and show an
|
||||
* inline error. The wizard does NOT auto-advance when there are failures —
|
||||
@@ -109,7 +109,7 @@ export function WelcomeStep3() {
|
||||
await onboardingApi.updateStep({ step: 3, action: 'complete' })
|
||||
await fetchUser()
|
||||
toast.success("You're all set!")
|
||||
navigate('/?welcome=true')
|
||||
navigate('/home')
|
||||
}
|
||||
|
||||
const handleSendInvites = async () => {
|
||||
@@ -177,7 +177,7 @@ export function WelcomeStep3() {
|
||||
await onboardingApi.updateStep({ step: 3, action: 'skip' })
|
||||
await fetchUser()
|
||||
toast.success("You're all set!")
|
||||
navigate('/?welcome=true')
|
||||
navigate('/home')
|
||||
} catch {
|
||||
setError('Could not save. Please try again.')
|
||||
setSubmitting(null)
|
||||
|
||||
@@ -88,7 +88,7 @@ function renderPage() {
|
||||
<MemoryRouter initialEntries={['/welcome/step-3']}>
|
||||
<Routes>
|
||||
<Route path="/welcome/step-3" element={<WelcomeStep3 />} />
|
||||
<Route path="/" element={<div>dashboard</div>} />
|
||||
<Route path="/home" element={<div>dashboard</div>} />
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user