-
Notifications
You must be signed in to change notification settings - Fork 14
feat(inbox): gate remaining inbox surfaces behind posthog-code-inbox flag #1840
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
Merged
joshsny
merged 1 commit into
posthog-code/gate-inbox-behind-feature-flag
from
joshsny/gate-inbox-remaining-surfaces-6eca
Apr 22, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,4 @@ | ||||||||||
| import { useFeatureFlag } from "@hooks/useFeatureFlag"; | ||||||||||
| import { | ||||||||||
| ArrowRight, | ||||||||||
| ChartLine, | ||||||||||
|
|
@@ -8,37 +9,42 @@ import { | |||||||||
| } from "@phosphor-icons/react"; | ||||||||||
| import { Button, Flex, Text } from "@radix-ui/themes"; | ||||||||||
| import explorerHog from "@renderer/assets/images/hedgehogs/explorer-hog.png"; | ||||||||||
| import { useCallback, useEffect, useRef, useState } from "react"; | ||||||||||
| import { useCallback, useEffect, useMemo, useRef, useState } from "react"; | ||||||||||
| import { FeatureListItem } from "./FeatureListItem"; | ||||||||||
| import { OnboardingHogTip } from "./OnboardingHogTip"; | ||||||||||
| import { StepActions } from "./StepActions"; | ||||||||||
|
|
||||||||||
| const FEATURES = [ | ||||||||||
| const ALL_FEATURES = [ | ||||||||||
| { | ||||||||||
| id: "signals-inbox", | ||||||||||
| icon: <Tray size={24} />, | ||||||||||
| title: "Your signals inbox", | ||||||||||
| description: | ||||||||||
| "Automatically surfaces the highest-impact work from your product data so you always know what to do next.", | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| id: "product-data", | ||||||||||
| icon: <ChartLine size={24} />, | ||||||||||
| title: "Product data as context", | ||||||||||
| description: | ||||||||||
| "Your agents have context from your analytics, session replays and feature flags built in.", | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| id: "any-model", | ||||||||||
| icon: <Robot size={24} />, | ||||||||||
| title: "Any model, any harness", | ||||||||||
| description: | ||||||||||
| "Bring your own agent framework or use our built-in harnesses. Swap models without changing your workflow.", | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| id: "ship-work", | ||||||||||
| icon: <Cloud size={24} />, | ||||||||||
| title: "Ship work, not messages", | ||||||||||
| description: | ||||||||||
| "Run tasks in parallel across local and cloud environments. Work gets done whether you're watching or not.", | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| id: "review-ship", | ||||||||||
| icon: <GitPullRequest size={24} />, | ||||||||||
| title: "Review and ship with confidence", | ||||||||||
| description: | ||||||||||
|
|
@@ -51,18 +57,26 @@ interface WelcomeScreenProps { | |||||||||
| } | ||||||||||
|
|
||||||||||
| const CYCLE_INTERVAL_MS = 2500; | ||||||||||
| const CYCLE_START_DELAY_MS = FEATURES.length * 100 + 400; | ||||||||||
| const CYCLE_START_DELAY_MS = ALL_FEATURES.length * 100 + 400; | ||||||||||
|
|
||||||||||
| export function WelcomeScreen({ onNext }: WelcomeScreenProps) { | ||||||||||
| const inboxEnabled = useFeatureFlag("posthog-code-inbox"); | ||||||||||
| const features = useMemo( | ||||||||||
| () => | ||||||||||
| inboxEnabled | ||||||||||
| ? ALL_FEATURES | ||||||||||
| : ALL_FEATURES.filter((f) => f.id !== "signals-inbox"), | ||||||||||
| [inboxEnabled], | ||||||||||
| ); | ||||||||||
| const [activeIndex, setActiveIndex] = useState(-1); | ||||||||||
| const timerRef = useRef<ReturnType<typeof setInterval>>(null); | ||||||||||
|
|
||||||||||
| const startCycling = useCallback(() => { | ||||||||||
| if (timerRef.current) clearInterval(timerRef.current); | ||||||||||
| timerRef.current = setInterval(() => { | ||||||||||
| setActiveIndex((prev) => (prev + 1) % FEATURES.length); | ||||||||||
| setActiveIndex((prev) => (prev + 1) % features.length); | ||||||||||
| }, CYCLE_INTERVAL_MS); | ||||||||||
| }, []); | ||||||||||
| }, [features.length]); | ||||||||||
|
|
||||||||||
| useEffect(() => { | ||||||||||
| const timeout = setTimeout(() => { | ||||||||||
|
|
@@ -126,7 +140,7 @@ export function WelcomeScreen({ onNext }: WelcomeScreenProps) { | |||||||||
| </Flex> | ||||||||||
|
|
||||||||||
| <Flex direction="column" style={{ width: "100%", gap: 8 }}> | ||||||||||
| {FEATURES.map((feature, index) => ( | ||||||||||
| {features.map((feature, index) => ( | ||||||||||
| <FeatureListItem | ||||||||||
| key={feature.title} | ||||||||||
|
Comment on lines
144
to
145
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.
Each item in
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/onboarding/components/WelcomeScreen.tsx
Line: 144-145
Comment:
**Prefer stable `id` as React list key**
Each item in `ALL_FEATURES` now has a dedicated `id` field. Using it as the list key is more robust than relying on the display title string.
```suggestion
<FeatureListItem
key={feature.id}
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||
| icon={feature.icon} | ||||||||||
|
|
||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
CYCLE_START_DELAY_MSignores runtime feature countThis constant is computed at module load using
ALL_FEATURES.length(5), so when inbox is disabled the animation intro delay is 900 ms instead of the intended 800 ms (4 items × 100 ms + 400 ms). The difference is imperceptible, but the intent was clearly to match the number of rendered items. Consider deriving the delay inside the component fromfeatures.lengthinstead.Prompt To Fix With AI