:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(auth): add glass auth flow variant with the garden design language (#78517)
Fernando Gomes089c809305e1
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex a3d3258268b9..44f57da17449 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -185,7 +185,7 @@ export const FEATURE_FLAGS = {AI_OBSERVABILITY_DAILY_DIGEST_SCOUT: 'ai-observability-daily-digest-scout', // owner: #team-ai-observability, gates the daily digest scout buttonAI_TRAINING: 'ai-training', // owner: @nicowaltz #team-replay #ai-research, gates the AI training opt-out UI and API enforcementAUDIT_LOGS_ACCESS: 'audit-logs-access', // owner: #team-platform-features, used to control access to audit logs- AUTH_FLOW_VARIANT: 'auth-flow-variant', // owner: @fercgomes #team-growth multivariate=legacy,paper-desk — selects the auth flow experience (login, signup, invited signup, email verification); paper-desk is the new design, legacy is the existing design+ AUTH_FLOW_VARIANT: 'auth-flow-variant', // owner: @fercgomes #team-growth multivariate=legacy,paper-desk,glass; selects the auth flow experience across login, signup, invited signup, and email verificationBATCH_EXPORT_EARLIEST_BACKFILL: 'batch-export-earliest-backfill', // owner: #team-batch-exports, allow backfilling from beginning of timeCONTROL_SUPPORT_LOGIN: 'control_support_login', // owner: #team-security, used to control whether users can opt out of support impersonationCUSTOM_CSS_THEMES: 'custom-css-themes', // owner: #team-growth, used to enable custom CSS for teams who want to have fundiff --git a/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx b/frontend/src/scenes/authentication/authFlowVariantRegistry.tsxindex f45b85c265da..d1e8d7577ea7 100644--- a/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx+++ b/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx@@ -1,10 +1,14 @@import type { AuthFlowVariant } from './authFlowVariants'+import { GlassInviteSignup } from './invite-signup/variants/glass/GlassInviteSignup'import { LegacyInviteSignup } from './invite-signup/variants/legacy/LegacyInviteSignup'import { PaperDeskInviteSignup } from './invite-signup/variants/paper-desk/PaperDeskInviteSignup'+import { GlassLogin } from './login/variants/glass/GlassLogin'import { LegacyLogin } from './login/variants/legacy/LegacyLogin'import { PaperDeskLogin } from './login/variants/paper-desk/PaperDeskLogin'+import { GlassSignup } from './signup/variants/glass/GlassSignup'import { LegacySignup } from './signup/variants/legacy/LegacySignup'import { PaperDeskSignup } from './signup/variants/paper-desk/PaperDeskSignup'+import { GlassVerifyEmail } from './verify-email/variants/glass/GlassVerifyEmail'import { LegacyVerifyEmail } from './verify-email/variants/legacy/LegacyVerifyEmail'import { PaperDeskVerifyEmail } from './verify-email/variants/paper-desk/PaperDeskVerifyEmail'@@ -29,4 +33,10 @@ export const authFlowVariantRegistry: Record<AuthFlowVariant, AuthFlowVariantComInviteSignup: PaperDeskInviteSignup,VerifyEmail: PaperDeskVerifyEmail,},+ glass: {+ Login: GlassLogin,+ Signup: GlassSignup,+ InviteSignup: GlassInviteSignup,+ VerifyEmail: GlassVerifyEmail,+ },}diff --git a/frontend/src/scenes/authentication/authFlowVariants.ts b/frontend/src/scenes/authentication/authFlowVariants.tsindex 23686adba3fb..d3a0e2fc5476 100644--- a/frontend/src/scenes/authentication/authFlowVariants.ts+++ b/frontend/src/scenes/authentication/authFlowVariants.ts@@ -1,11 +1,11 @@import { FEATURE_FLAGS } from 'lib/constants'import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'-export type AuthFlowVariant = 'legacy' | 'paper-desk'+export type AuthFlowVariant = 'legacy' | 'paper-desk' | 'glass'const DEFAULT_VARIANT: AuthFlowVariant = 'legacy'-export const AUTH_FLOW_VARIANTS: AuthFlowVariant[] = ['legacy', 'paper-desk']+export const AUTH_FLOW_VARIANTS: AuthFlowVariant[] = ['legacy', 'paper-desk', 'glass']export function resolveAuthFlowVariant(featureFlags: FeatureFlagsSet): AuthFlowVariant {const variant = featureFlags[FEATURE_FLAGS.AUTH_FLOW_VARIANT]diff --git a/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsx b/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsxnew file mode 100644index 000000000000..ec007ee94626--- /dev/null+++ b/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsx@@ -0,0 +1,149 @@+import type { Meta, StoryFn } from '@storybook/react'+import { HttpResponse, delay } from 'msw'+import { useEffect } from 'react'++import { FEATURE_FLAGS } from 'lib/constants'+import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'++import { mswDecorator, useStorybookMocks } from '~/mocks/browser'+import preflightJson from '~/mocks/fixtures/_preflight.json'++import { InviteSignup } from './InviteSignup'+import { inviteSignupLogic } from './inviteSignupLogic'++const MOCK_INVITE_ID = '1234'++type StoryArgs = {+ scenario: 'new-user' | 'existing-account' | 'invalid-link'+ cloud: boolean+ googleOAuth: boolean+ github: boolean+ gitlab: boolean+ ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'+}++const meta: Meta<StoryArgs> = {+ title: 'Scenes-Other/Invite Signup (glass)',+ tags: ['test-skip'],+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },+ },+ decorators: [+ mswDecorator({+ get: {+ [`/api/signup/${MOCK_INVITE_ID}/`]: () => [+ 200,+ {+ id: MOCK_INVITE_ID,+ target_email: '[email protected]',+ first_name: 'Jane Doe',+ organization_name: 'Acme Corp',+ },+ ],+ '/api/signup/not-found/': () => [404, { detail: 'Invite not found or already used.' }],+ },+ post: {+ '/api/signup': async () => {+ await delay(1000)+ return HttpResponse.json({ success: true })+ },+ [`/api/signup/${MOCK_INVITE_ID}`]: async () => {+ await delay(1000)+ return HttpResponse.json({ success: true })+ },+ },+ }),+ ],+ argTypes: {+ scenario: {+ control: 'select',+ name: 'Scenario',+ options: ['new-user', 'existing-account', 'invalid-link'],+ },+ cloud: { control: 'boolean', name: 'Cloud' },+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },+ github: { control: 'boolean', name: 'GitHub' },+ gitlab: { control: 'boolean', name: 'GitLab' },+ ssoEnforcement: {+ control: 'select',+ name: 'SSO enforcement',+ options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],+ },+ },+ args: {+ scenario: 'new-user',+ cloud: true,+ googleOAuth: true,+ github: true,+ gitlab: true,+ ssoEnforcement: 'none',+ },+}+export default meta++const Template: StoryFn<StoryArgs> = ({ scenario, cloud, googleOAuth, github, gitlab, ssoEnforcement }) => {+ const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement+ const isExistingAccount = scenario === 'existing-account'+ const inviteId = scenario === 'invalid-link' ? 'not-found' : MOCK_INVITE_ID++ useStorybookMocks({+ get: {+ '/_preflight': {+ ...preflightJson,+ cloud,+ realm: cloud ? 'cloud' : 'hosted-clickhouse',+ is_debug: cloud,+ can_create_org: cloud,+ available_social_auth_providers: {+ 'google-oauth2': googleOAuth,+ github,+ gitlab,+ saml: false,+ },+ },+ '/api/users/@me': isExistingAccount+ ? () => [200, { email: '[email protected]', first_name: 'Jane Doe', organization: { name: 'Acme Corp' } }]+ : () => [500, null],+ },+ post: {+ '/api/login/precheck': { sso_enforcement: enforcement, saml_available: false },+ },+ })++ useDelayedOnMountEffect(() => {+ inviteSignupLogic.actions.prevalidateInvite(inviteId)+ })++ useEffect(() => {+ if (enforcement) {+ inviteSignupLogic.actions.prevalidateInvite(inviteId)+ }+ }, [enforcement, inviteId])++ return <InviteSignup />+}++export const Default: StoryFn<StoryArgs> = Template.bind({})++export const NewUserCloud: StoryFn<StoryArgs> = Template.bind({})+NewUserCloud.args = { scenario: 'new-user', cloud: true }++export const NewUserSelfHosted: StoryFn<StoryArgs> = Template.bind({})+NewUserSelfHosted.args = {+ scenario: 'new-user',+ cloud: false,+ googleOAuth: false,+ github: false,+ gitlab: false,+}++export const ExistingAccount: StoryFn<StoryArgs> = Template.bind({})+ExistingAccount.args = { scenario: 'existing-account' }++export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})+InvalidLink.args = { scenario: 'invalid-link' }++export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})+SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }diff --git a/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsx b/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsxnew file mode 100644index 000000000000..1514e8350d96--- /dev/null+++ b/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsx@@ -0,0 +1,12 @@+import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'++import { PaperDeskInviteSignup } from '../paper-desk/PaperDeskInviteSignup'++/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */+export function GlassInviteSignup(): JSX.Element {+ return (+ <PaperDeskThemeProvider theme="glass">+ <PaperDeskInviteSignup />+ </PaperDeskThemeProvider>+ )+}diff --git a/frontend/src/scenes/authentication/login/GlassLogin.stories.tsx b/frontend/src/scenes/authentication/login/GlassLogin.stories.tsxnew file mode 100644index 000000000000..d14875f54820--- /dev/null+++ b/frontend/src/scenes/authentication/login/GlassLogin.stories.tsx@@ -0,0 +1,136 @@+import type { Meta, StoryFn } from '@storybook/react'+import { useEffect } from 'react'++import { FEATURE_FLAGS } from 'lib/constants'++import { useStorybookMocks } from '~/mocks/browser'+import preflightJson from '~/mocks/fixtures/_preflight.json'++import { Login } from './Login'+import { loginLogic } from './loginLogic'++type StoryArgs = {+ cloud: boolean+ region: 'US' | 'EU'+ googleOAuth: boolean+ github: boolean+ gitlab: boolean+ samlAvailable: boolean+ ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'+ generalError: 'none' | 'invalid_credentials' | 'code_based_verification_sent'+}++const meta: Meta<StoryArgs> = {+ title: 'Scenes-Other/Login (glass)',+ tags: ['test-skip'],+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },+ },+ argTypes: {+ cloud: { control: 'boolean', name: 'Cloud' },+ region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },+ github: { control: 'boolean', name: 'GitHub' },+ gitlab: { control: 'boolean', name: 'GitLab' },+ samlAvailable: { control: 'boolean', name: 'SAML available' },+ ssoEnforcement: {+ control: 'select',+ name: 'SSO enforcement',+ options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],+ },+ generalError: {+ control: 'select',+ name: 'General error',+ options: ['none', 'invalid_credentials', 'code_based_verification_sent'],+ },+ },+ args: {+ cloud: true,+ region: 'US',+ googleOAuth: true,+ github: true,+ gitlab: true,+ samlAvailable: false,+ ssoEnforcement: 'none',+ generalError: 'none',+ },+}+export default meta++const Template: StoryFn<StoryArgs> = ({+ cloud,+ region,+ googleOAuth,+ github,+ gitlab,+ samlAvailable,+ ssoEnforcement,+ generalError,+}) => {+ const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement++ useStorybookMocks({+ get: {+ '/_preflight': {+ ...preflightJson,+ cloud,+ region: cloud ? region : undefined,+ realm: cloud ? 'cloud' : 'hosted-clickhouse',+ is_debug: cloud,+ can_create_org: cloud,+ available_social_auth_providers: {+ 'google-oauth2': googleOAuth,+ github,+ gitlab,+ saml: samlAvailable,+ },+ },+ },+ post: {+ '/api/login/precheck': { sso_enforcement: enforcement, saml_available: samlAvailable },+ },+ })++ useEffect(() => {+ if (enforcement) {+ loginLogic.actions.setLoginValue('email', '[email protected]')+ loginLogic.actions.precheck({ email: '[email protected]' })+ }+ }, [enforcement])++ useEffect(() => {+ if (generalError !== 'none') {+ const messages: Record<string, string> = {+ invalid_credentials: 'Invalid email or password.',+ code_based_verification_sent: 'Check your email to verify your account.',+ }+ loginLogic.actions.setGeneralError(generalError, messages[generalError] ?? '')+ } else {+ loginLogic.actions.clearGeneralError()+ }+ }, [generalError])++ return <Login />+}++export const Default: StoryFn<StoryArgs> = Template.bind({})++export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})+SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false, samlAvailable: false }++export const CloudEU: StoryFn<StoryArgs> = Template.bind({})+CloudEU.args = { region: 'EU' }++export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})+SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }++export const SAMLAvailable: StoryFn<StoryArgs> = Template.bind({})+SAMLAvailable.args = { samlAvailable: true }++export const LoginError: StoryFn<StoryArgs> = Template.bind({})+LoginError.args = { generalError: 'invalid_credentials' }++export const EmailVerification: StoryFn<StoryArgs> = Template.bind({})+EmailVerification.args = { generalError: 'code_based_verification_sent' }diff --git a/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsx b/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsxnew file mode 100644index 000000000000..5014c2559f34--- /dev/null+++ b/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsx@@ -0,0 +1,12 @@+import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'++import { PaperDeskLogin } from '../paper-desk/PaperDeskLogin'++/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */+export function GlassLogin(): JSX.Element {+ return (+ <PaperDeskThemeProvider theme="glass">+ <PaperDeskLogin />+ </PaperDeskThemeProvider>+ )+}diff --git a/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx b/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsxindex 12116df3175d..f4f23d044294 100644--- a/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx+++ b/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx@@ -19,7 +19,7 @@ import { isEmail } from 'lib/utils/url'import { ERROR_MESSAGES } from 'scenes/authentication/shared/loginErrorMessages'import { OtherRegionHint } from 'scenes/authentication/shared/OtherRegionHint'import { CardTitle } from 'scenes/authentication/shared/paperDesk/CardTitle'-import { PaperDeskCard, PaperDeskScene } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'+import { PaperDeskCard, PaperDeskScene, usePaperDeskTheme } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'import { RegionField } from 'scenes/authentication/shared/paperDesk/RegionField'import { RedirectIfLoggedInOtherInstance } from 'scenes/authentication/shared/RedirectToLoggedInInstance'import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'@@ -52,6 +52,7 @@ function Login(): JSX.Element {autoRedirectingToProvider,} = useValues(loginLogic)const { preflight } = useValues(preflightLogic)+ const theme = usePaperDeskTheme()const isPasswordHidden = !!precheckResponse.sso_enforcement || isPasswordLoginUnavailableconst isCodeSent = codeVerificationRequired@@ -85,7 +86,20 @@ function Login(): JSX.Element {{preflight?.cloud && <RedirectIfLoggedInOtherInstance />}<PaperDeskCard footer={footer}><CardTitle- title={isCodeSent ? 'Enter your login code' : 'Log in to PostHog'}+ title={+ isCodeSent ? (+ 'Enter your login code'+ ) : theme === 'glass' ? (+ <>+ Log in to{' '}+ <span className="px-1 rounded-md bg-[color-mix(in_srgb,var(--color-blue-500)_10%,transparent)] text-[var(--color-blue-500)]">+ @PostHog+ </span>+ </>+ ) : (+ 'Log in to PostHog'+ )+ }sub={isCodeSent ? undefined : "Welcome back. Let's go ship something."}/><SessionRiskBanner className="mb-4" />diff --git a/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss b/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scssindex 9e066d9d57a7..d03aa8d7ec22 100644--- a/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss+++ b/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss@@ -25,6 +25,33 @@16px 16px;}+// Glass variant uses posthog.com's layered garden greens with a soft light well behind the card.+// The base color overrides the parchment `bg-[#eef0e7]` utility because unlayered rules beat+// Tailwind's cascade layer.+.PaperDesk--glass {+ --color-text-warning: var(--color-text-primary);++ background-color: #b5cd8f;+ background-image:+ radial-gradient(80% 70% at 50% 30%, rgb(255 253 240 / 45%), transparent 70%),+ linear-gradient(180deg, #cfe0ae 0%, #b5cd8f 55%, #9dbb78 100%);+ background-repeat: no-repeat;+ background-size: auto;++ // The cream OS-window card the new website (and the self-driving onboarding) uses.+ .PaperDesk__card {+ background: #f6f5f0;+ border-color: #e3e0d4;+ border-radius: 1rem;+ box-shadow: 0 16px 40px rgb(30 50 10 / 25%);+ }++ // Corner notes read as dark-green ink on the garden rather than gray on parchment.+ .PaperDesk__notes div {+ color: rgb(45 74 22 / 65%);+ }+}+// Paper sheet resting on the desk — the login card and the dev login panel share it..PaperDesk__card {background: #fff;diff --git a/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx b/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsxindex 752accc59663..16c9f8dd605e 100644--- a/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx+++ b/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx@@ -1,16 +1,43 @@import './PaperDesk.scss'-import { type ReactNode } from 'react'+import { type ReactNode, createContext, useContext } from 'react'import { Logo } from 'lib/brand'+import { cn } from 'lib/utils/css-classes'import { DevLoginPanel } from './DevLoginPanel'import { Typewriter } from './Typewriter'+/** Which skin the stage wears: the parchment desk, or the posthog.com garden ("glass" variant). */+export type PaperDeskTheme = 'paper' | 'glass'++const PaperDeskThemeContext = createContext<PaperDeskTheme>('paper')++export function usePaperDeskTheme(): PaperDeskTheme {+ return useContext(PaperDeskThemeContext)+}++/** Wrap a paper-desk page to re-skin it - the glass variant renders the same pages through this. */+export function PaperDeskThemeProvider({+ theme,+ children,+}: {+ theme: PaperDeskTheme+ children: ReactNode+}): JSX.Element {+ return <PaperDeskThemeContext.Provider value={theme}>{children}</PaperDeskThemeContext.Provider>+}+/** Full-viewport paper-desk stage: dotted parchment + accent glow + mono corner notes. */export function PaperDeskScene({ notes, children }: { notes: string[]; children: ReactNode }): JSX.Element {+ const theme = usePaperDeskTheme()return (- <div className="PaperDesk relative h-screen overflow-x-hidden overflow-y-auto font-sans text-primary bg-[#eef0e7]">+ <div+ className={cn(+ 'PaperDesk relative h-screen overflow-x-hidden overflow-y-auto font-sans text-primary bg-[#eef0e7]',+ theme === 'glass' && 'PaperDesk--glass'+ )}+ ><div className="hidden sm:block"><Typewriter lines={notes} /></div>diff --git a/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx b/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsxindex 398aac855868..e4a21f33d382 100644--- a/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx+++ b/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx@@ -37,7 +37,7 @@ export function Typewriter({ lines }: { lines: string[] }): JSX.Element {const parts = full.slice(0, shown).split('\n')return (<div- className="absolute top-[clamp(20px,4vh,40px)] left-[clamp(20px,4vw,44px)] z-[2] min-h-[2.6em] font-mono text-xs leading-relaxed whitespace-pre"+ className="PaperDesk__notes absolute top-[clamp(20px,4vh,40px)] left-[clamp(20px,4vw,44px)] z-[2] min-h-[2.6em] font-mono text-xs leading-relaxed whitespace-pre"aria-hidden// Chrome's in-page translation replaces text nodes with <font> elements; on this// 40ms-tick animation React then crashes removing text it no longer ownsdiff --git a/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsx b/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsxnew file mode 100644index 000000000000..bc2c9353c855--- /dev/null+++ b/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsx@@ -0,0 +1,118 @@+import type { Meta, StoryFn } from '@storybook/react'+import { HttpResponse, delay } from 'msw'+import { useEffect } from 'react'++import { FEATURE_FLAGS } from 'lib/constants'+import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'+import { userLogic } from 'scenes/userLogic'++import { mswDecorator, useStorybookMocks } from '~/mocks/browser'+import preflightJson from '~/mocks/fixtures/_preflight.json'++import { SignupContainer } from './SignupContainer'+import { signupLogic } from './signupForm/signupLogic'++type PanelOption = '1: Email' | '2: Password' | '3: Profile'++const PANEL_INDEX: Record<PanelOption, 0 | 1 | 2> = {+ '1: Email': 0,+ '2: Password': 1,+ '3: Profile': 2,+}++type StoryArgs = {+ cloud: boolean+ region: 'US' | 'EU'+ googleOAuth: boolean+ github: boolean+ gitlab: boolean+ panel: PanelOption+}++const meta: Meta<StoryArgs> = {+ title: 'Scenes-Other/Signup (glass)',+ tags: ['test-skip'],+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ featureFlags: {+ [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass',+ },+ },+ decorators: [+ mswDecorator({+ get: { '/api/users/@me': () => [500, null] },+ post: {+ '/api/signup': async () => {+ await delay(1000)+ return HttpResponse.json({ success: true })+ },+ },+ }),+ ],+ argTypes: {+ cloud: { control: 'boolean', name: 'Cloud' },+ region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },+ github: { control: 'boolean', name: 'GitHub' },+ gitlab: { control: 'boolean', name: 'GitLab' },+ panel: {+ control: 'select',+ name: 'Step',+ options: ['1: Email', '2: Password', '3: Profile'] satisfies PanelOption[],+ },+ },+ args: {+ cloud: true,+ region: 'US',+ googleOAuth: true,+ github: true,+ gitlab: true,+ panel: '1: Email',+ },+}+export default meta++const Template: StoryFn<StoryArgs> = ({ cloud, region, googleOAuth, github, gitlab, panel: panelOption }) => {+ const panel = PANEL_INDEX[panelOption]+ useStorybookMocks({+ get: {+ '/_preflight': {+ ...preflightJson,+ cloud,+ region: cloud ? region : undefined,+ realm: cloud ? 'cloud' : 'hosted-clickhouse',+ is_debug: cloud,+ can_create_org: cloud,+ available_social_auth_providers: {+ 'google-oauth2': googleOAuth,+ github,+ gitlab,+ saml: false,+ },+ },+ },+ })++ useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))++ useEffect(() => {+ signupLogic.actions.setPanel(panel)+ if (panel > 0) {+ signupLogic.actions.setSignupPanelEmailValue('email', '[email protected]')+ }+ }, [panel])++ return <SignupContainer />+}++export const Default: StoryFn<StoryArgs> = Template.bind({})++export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})+SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false }++export const PasswordStep: StoryFn<StoryArgs> = Template.bind({})+PasswordStep.args = { panel: '2: Password' }++export const ProfileStep: StoryFn<StoryArgs> = Template.bind({})+ProfileStep.args = { panel: '3: Profile' }diff --git a/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsx b/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsxnew file mode 100644index 000000000000..206d70bbce84--- /dev/null+++ b/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsx@@ -0,0 +1,12 @@+import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'++import { PaperDeskSignup } from '../paper-desk/PaperDeskSignup'++/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */+export function GlassSignup(): JSX.Element {+ return (+ <PaperDeskThemeProvider theme="glass">+ <PaperDeskSignup />+ </PaperDeskThemeProvider>+ )+}diff --git a/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsx b/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsxnew file mode 100644index 000000000000..360f4bbfada3--- /dev/null+++ b/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsx@@ -0,0 +1,68 @@+import type { Meta, StoryFn } from '@storybook/react'+import { useEffect } from 'react'++import { FEATURE_FLAGS } from 'lib/constants'++import { useStorybookMocks } from '~/mocks/browser'+import preflightJson from '~/mocks/fixtures/_preflight.json'++import { VerifyEmail } from './VerifyEmail'+import { verifyEmailLogic } from './verifyEmailLogic'++type VerifyEmailView = 'pending' | 'verify' | 'success' | 'invalid'++type StoryArgs = {+ view: VerifyEmailView+}++const meta: Meta<StoryArgs> = {+ title: 'Scenes-Other/Verify Email (glass)',+ tags: ['test-skip'],+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },+ },+ argTypes: {+ view: {+ control: 'select',+ name: 'View',+ options: ['pending', 'verify', 'success', 'invalid'] satisfies VerifyEmailView[],+ },+ },+ args: {+ view: 'pending',+ },+}+export default meta++const Template: StoryFn<StoryArgs> = ({ view }) => {+ useStorybookMocks({+ get: {+ '/_preflight': { ...preflightJson },+ '/api/users/@me': () => [200, { email: '[email protected]', first_name: 'Test' }],+ },+ })++ useEffect(() => {+ verifyEmailLogic.actions.setView(view)+ verifyEmailLogic.actions.setUuid('12345678')+ }, [view])++ return <VerifyEmail />+}++export const Default: StoryFn<StoryArgs> = Template.bind({})++export const Pending: StoryFn<StoryArgs> = Template.bind({})+Pending.args = { view: 'pending' }++export const Verifying: StoryFn<StoryArgs> = Template.bind({})+Verifying.args = { view: 'verify' }+Verifying.parameters = { testOptions: { waitForLoadersToDisappear: false } }++export const Success: StoryFn<StoryArgs> = Template.bind({})+Success.args = { view: 'success' }++export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})+InvalidLink.args = { view: 'invalid' }diff --git a/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsx b/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsxnew file mode 100644index 000000000000..8b9a285ff8ac--- /dev/null+++ b/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsx@@ -0,0 +1,12 @@+import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'++import { PaperDeskVerifyEmail } from '../paper-desk/PaperDeskVerifyEmail'++/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */+export function GlassVerifyEmail(): JSX.Element {+ return (+ <PaperDeskThemeProvider theme="glass">+ <PaperDeskVerifyEmail />+ </PaperDeskThemeProvider>+ )+}