integration: landing + ai-structured-outputs + l1-workspace (Phase 1 internal-only) #190

Closed
chihlasm wants to merge 13 commits from feat/three-feature-integration into main
4 changed files with 11 additions and 13 deletions
Showing only changes of commit f9f98b1a65 - Show all commits

View File

@@ -20,8 +20,7 @@ const SUCCESS_REDIRECT_MS = 1200
* "Already verified" state. No API call.
* - Else fire `POST /auth/email/verify` exactly once (a `useRef` guard keeps
* React 19 strict-mode double-invoke from double-firing the call). On
* success, refresh the auth store and bounce to `/?verified=1` so the
* dashboard surfaces a toast.
* success, refresh the auth store and bounce to `/home`.
* - On error, show "Invalid or expired token" + a "Resend" CTA that calls
* `POST /auth/email/send-verification`.
*/
@@ -70,10 +69,9 @@ export function VerifyEmailPage() {
if (cancelled) return
setStatus('success')
toast.success('Email verified')
// Brief success state, then redirect with a query flag so the
// dashboard can re-surface confirmation if it wants to.
// Brief success state, then redirect to the dashboard.
window.setTimeout(() => {
navigate('/?verified=1', { replace: true })
navigate('/home', { replace: true })
}, SUCCESS_REDIRECT_MS)
})
.catch((err) => {
@@ -126,7 +124,7 @@ export function VerifyEmailPage() {
Redirecting you to the dashboard
</p>
<Link
to="/?verified=1"
to="/home"
replace
className={cn(
'mt-6 inline-flex items-center rounded-lg bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground',

View File

@@ -52,7 +52,7 @@ function renderPage(initialPath: string) {
<MemoryRouter initialEntries={[initialPath]}>
<Routes>
<Route path="/verify-email" element={<VerifyEmailPage />} />
<Route path="/" element={<div>dashboard</div>} />
<Route path="/home" element={<div>dashboard</div>} />
</Routes>
</MemoryRouter>
</HelmetProvider>,
@@ -130,7 +130,7 @@ describe('VerifyEmailPage', () => {
<MemoryRouter initialEntries={['/verify-email?token=valid-token']}>
<Routes>
<Route path="/verify-email" element={<VerifyEmailPage />} />
<Route path="/" element={<div>dashboard</div>} />
<Route path="/home" element={<div>dashboard</div>} />
</Routes>
</MemoryRouter>
</HelmetProvider>,
@@ -142,7 +142,7 @@ describe('VerifyEmailPage', () => {
<MemoryRouter initialEntries={['/verify-email?token=valid-token']}>
<Routes>
<Route path="/verify-email" element={<VerifyEmailPage />} />
<Route path="/" element={<div>dashboard</div>} />
<Route path="/home" element={<div>dashboard</div>} />
</Routes>
</MemoryRouter>
</HelmetProvider>,

View File

@@ -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)

View File

@@ -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>,
)