Skip to content

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

Open
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/gate-inbox-for-large-customers
Open

feat(inbox): Gate Inbox preview behind inbox-gated-due-to-scale flag#1960
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/gate-inbox-for-large-customers

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented Apr 30, 2026

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
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

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

@@ -130,6 +134,78 @@ export function WarmingUpPane({
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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).

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/InboxEmptyStates.tsx
Line: 136

Comment:
**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).

How can I resolve this? If you propose a fix, please make it concise.

import { GatedDueToScalePane } from "./InboxEmptyStates";
import { InboxSignalsTab } from "./InboxSignalsTab";

export function InboxView() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/InboxView.tsx
Line: 10

Comment:
**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.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants