: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(organization): guide users with no org and no invite (#72366)
posthog[bot]4c4020993e73
diff --git a/frontend/src/scenes/organization/CreateOrganizationModal.tsx b/frontend/src/scenes/organization/CreateOrganizationModal.tsxindex 9a45844b8d9e..db23172ae769 100644--- a/frontend/src/scenes/organization/CreateOrganizationModal.tsx+++ b/frontend/src/scenes/organization/CreateOrganizationModal.tsx@@ -5,9 +5,11 @@ import { IconLetter } from '@posthog/icons'import { LemonButton, LemonDivider, LemonInput, LemonModal, Link } from '@posthog/lemon-ui'import { pendingInvitesLogic } from 'lib/components/Account/pendingInvitesLogic'+import { LemonBanner } from 'lib/lemon-ui/LemonBanner'import { LemonField } from 'lib/lemon-ui/LemonField'import { organizationLogic } from 'scenes/organizationLogic'import { urls } from 'scenes/urls'+import { userLogic } from 'scenes/userLogic'export function CreateOrganizationModal({isVisible,@@ -19,11 +21,16 @@ export function CreateOrganizationModal({inline?: boolean}): JSX.Element {const { createOrganization } = useActions(organizationLogic)- const { currentOrganizationLoading } = useValues(organizationLogic)+ const { currentOrganizationLoading, isCurrentOrganizationUnavailable } = useValues(organizationLogic)const { pendingInvites } = useValues(pendingInvitesLogic)+ const { user } = useValues(userLogic)+ const { logout } = useActions(userLogic)const [name, setName] = useState<string>('')const hasPendingInvites = pendingInvites.length > 0+ // Only stuck users see this: no organization membership and no invite waiting. Someone deliberately creating an+ // additional org from the account menu still has a current org, so this guidance stays hidden for them.+ const showNoInviteHelp = !hasPendingInvites && isCurrentOrganizationUnavailableconst closeModal: () => void = () => {if (onClose) {@@ -72,6 +79,19 @@ export function CreateOrganizationModal({isOpen={isVisible}inline={inline}>+ {showNoInviteHelp && (+ <LemonBanner type="info" className="mb-4">+ <p className="mb-2">+ You're not part of any organization yet. If your team already uses PostHog, ask an admin there+ to send you an invite.+ </p>+ <p className="mb-0">+ You're signed in as <strong>{user?.email}</strong>. If your invite went to a different address,{' '}+ <Link onClick={() => logout()}>log out</Link> and sign back in with that email. Otherwise,+ create your own organization below.+ </p>+ </LemonBanner>+ )}{hasPendingInvites && (<><LemonField.Pure label="You've been invited to join" className="mb-2">