-
Notifications
You must be signed in to change notification settings - Fork 14
feat(inbox): Gate Inbox preview behind inbox-gated-due-to-scale flag #1960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| import { useFeatureFlag } from "@hooks/useFeatureFlag"; | ||
| import { useSetHeaderContent } from "@hooks/useSetHeaderContent"; | ||
| import { EnvelopeSimpleIcon } from "@phosphor-icons/react"; | ||
| import { Flex, Text } from "@radix-ui/themes"; | ||
| import { INBOX_GATED_DUE_TO_SCALE_FLAG } from "@shared/constants"; | ||
| import { useMemo } from "react"; | ||
| import { GatedDueToScalePane } from "./InboxEmptyStates"; | ||
| import { InboxSignalsTab } from "./InboxSignalsTab"; | ||
|
|
||
| export function InboxView() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Prompt To Fix With AIThis 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. |
||
| const isGatedDueToScale = useFeatureFlag(INBOX_GATED_DUE_TO_SCALE_FLAG); | ||
|
|
||
| const headerContent = useMemo( | ||
| () => ( | ||
| <Flex align="center" gap="2" className="w-full min-w-0"> | ||
|
|
@@ -24,7 +29,7 @@ export function InboxView() { | |
|
|
||
| return ( | ||
| <div className="h-full"> | ||
| <InboxSignalsTab /> | ||
| {isGatedDueToScale ? <GatedDueToScalePane /> : <InboxSignalsTab />} | ||
| </div> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
registeredisuseState(false), so it resets tofalseevery timeGatedDueToScalePaneunmounts (i.e., every navigation away from and back to Inbox). A user can fireINBOX_INTEREST_REGISTEREDon every visit. If you want to track unique registrations accurately, persist the flag tolocalStorage(or treat the analytics event as idempotent and deduplicate server-side).Prompt To Fix With AI