Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

feat(inbox): Gate Inbox preview behind inbox-gated-due-to-scale flag - #1960

Merged
Twixes merged 1 commit into
mainfrom
posthog-code/gate-inbox-for-large-customers
May 5, 2026
Merged

Twixes merged 1 commit into
mainfrom
posthog-code/gate-inbox-for-large-customers

Conversation

@posthog

@posthog posthog Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Self-driving Inbox is still in preview, and we want to throttle who sees it in terms of large customers (let's say, >=$500 MRR). These folks should hit a teaser instead of the actual Inbo for now, with a simple way to register interest.

Changes

Screenshot 2026-04-30 at 20 32 22@2x

New PostHog boolean feature flag inbox-gated-due-to-scale (created in PostHog via MCP server 🎉 targets the organization group with mrr ≥ 500 at 100% rollout).

For customers with this flag enabled, instead of InboxSignalsTab contents we render GatedDueToScalePane.

Clicking "Let me know when self-driving is available for my organization" fires a typed Inbox interest registered event.

Slack convo where @abhischekt helped out a lot with the gating logic here: https://posthog.slack.com/archives/C01MGUHFH6G/p1777552501110089

~@Twixes


Created with PostHog Code

Show a teaser pane to large customers (gated via PostHog feature flag) while
self-driving Inbox rolls out. The teaser invites the user to register
interest, capturing an event that PostHog can use to track demand per org.

Generated-By: PostHog Code
Task-Id: 0aec9747-6100-4e9c-8948-e57a8babf58e
@Twixes Twixes changed the title feat(inbox): gate Inbox preview behind inbox-gated-due-to-scale flag feat(inbox): Gate Inbox preview behind inbox-gated-due-to-scale flag Apr 30, 2026
@Twixes
Twixes requested review from a team April 30, 2026 18:32
@Twixes
Twixes marked this pull request as ready for review April 30, 2026 18:45
@greptile-apps

greptile-apps Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/code/src/renderer/features/inbox/components/InboxEmptyStates.tsx:136
**Ephemeral registered state allows duplicate analytics events**

`registered` is `useState(false)`, so it resets to `false` every time `GatedDueToScalePane` unmounts (i.e., every navigation away from and back to Inbox). A user can fire `INBOX_INTEREST_REGISTERED` on every visit. If you want to track unique registrations accurately, persist the flag to `localStorage` (or treat the analytics event as idempotent and deduplicate server-side).

### Issue 2 of 2
apps/code/src/renderer/features/inbox/components/InboxView.tsx:10
**Brief flash of `InboxSignalsTab` for gated customers**

`useFeatureFlag` initialises to `false` (its `defaultValue`) when PostHog flags haven't loaded yet (see `useFeatureFlag.ts` lines 8–9). Until the `onFeatureFlagsLoaded` callback fires, `isGatedDueToScale` is `false`, so gated customers briefly see `InboxSignalsTab` before the gate pane replaces it. If flags are reliably loaded before the Inbox is reachable this is a non-issue, but if there's any race at startup it's worth adding a loading guard or initialising with `null` and rendering a neutral state until the flag resolves.

Reviews (1): Last reviewed commit: "feat(inbox): gate Inbox preview behind i..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/inbox/components/InboxView.tsx
@Twixes
Twixes merged commit 7046de8 into main May 5, 2026
15 checks passed
@Twixes
Twixes deleted the posthog-code/gate-inbox-for-large-customers branch May 5, 2026 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant