: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
fix(desktop): explain paused sign-ups on the desktop access screen (#118798)
Charles Vien1c3f39907e7a
diff --git a/products/desktop/packages/shared/src/analytics-events.ts b/products/desktop/packages/shared/src/analytics-events.tsindex 22f35a5892ca..c10ef0ae2f26 100644--- a/products/desktop/packages/shared/src/analytics-events.ts+++ b/products/desktop/packages/shared/src/analytics-events.ts@@ -349,6 +349,12 @@ export interface ProjectMenuActionProperties {changed?: boolean;}+export interface DesktopAccessScreenShownProperties {+ status: "blocked" | "error";+ /** Null on a block means new sign-ups are paused. */+ reason: "startup_plan" | "prepaid_credits" | null;+}+export type TaskListSurface = "sidebar" | "space" | "saved_search";export interface TaskListGroupingChangedProperties {@@ -1838,6 +1844,7 @@ export const ANALYTICS_EVENTS = {CANVAS_DATA_REQUEST_REJECTED: "Canvas data request rejected",CONTEXT_ACTION: "Context action",PROJECT_MENU_ACTION: "Project menu action",+ DESKTOP_ACCESS_SCREEN_SHOWN: "Desktop access screen shown",// Autoresearch eventsAUTORESEARCH_ARMED: "Autoresearch armed",@@ -2064,6 +2071,7 @@ export type EventPropertyMap = {[ANALYTICS_EVENTS.CANVAS_DATA_REQUEST_REJECTED]: CanvasDataRequestRejectedProperties;[ANALYTICS_EVENTS.CONTEXT_ACTION]: ContextActionProperties;[ANALYTICS_EVENTS.PROJECT_MENU_ACTION]: ProjectMenuActionProperties;+ [ANALYTICS_EVENTS.DESKTOP_ACCESS_SCREEN_SHOWN]: DesktopAccessScreenShownProperties;// Autoresearch events[ANALYTICS_EVENTS.AUTORESEARCH_ARMED]: AutoresearchArmedProperties;diff --git a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.stories.tsx b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.stories.tsxindex c5fd0c1c5cd7..e492a39bb17c 100644--- a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.stories.tsx+++ b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.stories.tsx@@ -46,6 +46,12 @@ export const PrepaidCredits: Story = {},};+export const SignupsPaused: Story = {+ args: {+ access: { projectId: 1, status: "blocked", reason: null },+ },+};+export const TechnicalError: Story = {args: {access: { projectId: 1, status: "error", reason: null },diff --git a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.test.tsx b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.test.tsxindex c4e3fe12f02c..81dc5c7d9d6a 100644--- a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.test.tsx+++ b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.test.tsx@@ -1,8 +1,12 @@+import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";import { render, screen } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { describe, expect, it, vi } from "vitest";import { DesktopAccessScreen } from "./DesktopAccessScreen";+const { track } = vi.hoisted(() => ({ track: vi.fn() }));+vi.mock("@posthog/ui/shell/analytics", () => ({ track }));+const orgProjectsMap = {"org-1": {orgName: "First organization",@@ -62,10 +66,16 @@ describe("DesktopAccessScreen", () => {it.each([["startup_plan", "Organizations in the Startup or YC program"],["prepaid_credits", "[email protected]"],+ [null, "We'll contact you with next steps"],] as const)("renders the %s reason", (reason, expectedCopy) => {+ track.mockClear();renderScreen({ projectId: 1, status: "blocked", reason });expect(screen.getByText(new RegExp(expectedCopy))).toBeInTheDocument();+ expect(track).toHaveBeenCalledExactlyOnceWith(+ ANALYTICS_EVENTS.DESKTOP_ACCESS_SCREEN_SHOWN,+ { status: "blocked", reason },+ );expect(screen.getByText("First organization")).toBeInTheDocument();expect(screen.getByText("Website")).toBeInTheDocument();});diff --git a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsxindex ea60263bfd36..3188df4e8d15 100644--- a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx+++ b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx@@ -2,6 +2,7 @@ import {ArrowClockwise,CaretDown,Coins,+ HourglassMedium,RocketLaunch,SignOut,WarningCircle,@@ -25,13 +26,15 @@ import {Field,FieldLabel,} from "@posthog/quill";+import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";import { FullScreenLayout } from "@posthog/ui/primitives/FullScreenLayout";import { Spinner } from "@posthog/ui/primitives/Spinner";+import { track } from "@posthog/ui/shell/analytics";import {FIELD_CONTENT_CLASS,FIELD_TRIGGER_CLASS,} from "@posthog/ui/styles/fieldTrigger";-import { useMemo, useRef, useState } from "react";+import { useEffect, useMemo, useRef, useState } from "react";interface OrganizationOption {id: string;@@ -58,6 +61,15 @@ const BLOCKED_CONTENT = {},} as const;+// The server blocks with a null reason only while new sign-ups are paused. It sends no+// dedicated reason, because older Desktop builds and the LLM gateway reject unknown reasons.+const SIGNUPS_PAUSED_CONTENT = {+ icon: <HourglassMedium />,+ title: "Desktop sign-ups are paused",+ description:+ "Sorry, we aren't accepting new sign-ups for PostHog Desktop right now. We'll contact you with next steps when we're ready.",+};+interface DesktopAccessScreenProps {access: DesktopAccess;orgProjectsMap: OrgProjectsMap;@@ -116,13 +128,17 @@ export function DesktopAccessScreen({projects.find((project) => project.id === currentProjectId) ?? null;const controlsDisabled = isSwitching || access.status === "checking";+ useEffect(() => {+ if (access.status !== "blocked" && access.status !== "error") return;+ track(ANALYTICS_EVENTS.DESKTOP_ACCESS_SCREEN_SHOWN, {+ status: access.status,+ reason: access.reason,+ });+ }, [access.status, access.reason]);+const blockedContent = access.reason? BLOCKED_CONTENT[access.reason]- : {- icon: <WarningCircle />,- title: "Desktop isn't available for this organization",- description: "Select another organization or project to continue.",- };+ : SIGNUPS_PAUSED_CONTENT;const isTechnicalError = access.status === "error";const icon = isTechnicalError ? <WarningCircle /> : blockedContent?.icon;const title = isTechnicalError@@ -131,6 +147,7 @@ export function DesktopAccessScreen({const description = isTechnicalError? "Try again, or select another organization or project.": blockedContent?.description;+ const isSignupsPaused = access.status === "blocked" && !access.reason;const footerRight = (<Button@@ -154,7 +171,19 @@ export function DesktopAccessScreen({<EmptyHeader><EmptyMedia variant="icon">{icon}</EmptyMedia><EmptyTitle>{title}</EmptyTitle>- <EmptyDescription>{description}</EmptyDescription>+ <EmptyDescription+ className={+ isSignupsPaused ? "text-destructive-foreground" : undefined+ }+ >+ {isSignupsPaused && (+ <WarningCircle+ aria-hidden="true"+ className="mr-1 inline-block align-text-bottom"+ />+ )}+ {description}+ </EmptyDescription></EmptyHeader><EmptyContent className="w-full max-w-md gap-4"><div className="flex w-full flex-col gap-4">