Skip to content

[CI] (edaca63) react-native/expo-react-native-hacker-news - #2893

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-edaca63-react-native-expo-react-native-hacker-news
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-edaca63-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: edaca63
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-edaca63-react-native-expo-react-native-hacker-news
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-16T17:16:33.124Z
Duration: 160.8s

YARA Scanner

✓ 53 tool calls scanned, 0 violations detected

No violations: ✓ 53 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app using the posthog-react-native SDK. It adds a PostHog client initialization module, wraps the app in PostHogProvider, implements manual screen tracking via Expo Router's usePathname, and adds event capture across feed selection, story navigation, external link opens, and profile views.

Files changed Lines added Lines removed
7 +123 -23

Confidence score: 4/5 👍

  • No error tracking implemented: No captureException, error boundary, or exception autocapture configured. This is a missing PostHog feature. [MEDIUM]
  • No .env.example update: Environment variables EXPO_PUBLIC_POSTHOG_PROJECT_TOKEN and EXPO_PUBLIC_POSTHOG_HOST are not documented in an example file. The setup report mentions this as a TODO but doesn't implement it. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 5/5 New file: initializes PostHog React Native SDK from env vars with lifecycle events enabled
app/_layout.tsx 5/5 Wraps app in PostHogProvider, adds manual screen tracking via usePathname
app/index.tsx 5/5 Captures story_type_selected event on feed filter change
app/[itemId].tsx 5/5 Captures events for profile opens, discussion opens, and external link opens
components/posts/Post.tsx 5/5 Captures story_opened and external_story_opened events from the feed
package.json 5/5 Adds posthog-react-native dependency
posthog-setup-report.md 4/5 Useful report but notes incomplete steps (env example, dashboard)

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax or type errors; all imports resolve correctly
Preserves existing env vars & configs Yes Existing layout, routing, and query client preserved; PostHogProvider wraps existing tree
No syntax or type errors Yes All TypeScript valid; proper typing of refs and state
Correct imports/exports Yes posthog-react-native used correctly for both PostHog class and PostHogProvider
Minimal, focused changes Yes Only PostHog-related changes; event captures added inline in existing event handlers
Pre-existing issues .env contains real API key The .env file (not changed by this PR) contains a real PostHog project token phc_xxxx...CV6a. This should be in .env.example with a placeholder instead.

Issues

  • No .env.example file: The PR adds two new required environment variables (EXPO_PUBLIC_POSTHOG_PROJECT_TOKEN, EXPO_PUBLIC_POSTHOG_HOST) but does not create or update a .env.example file to document them. The setup report even acknowledges this as a TODO. [MEDIUM]

Other completed criteria

  • All changes are PostHog-related with no unrelated modifications
  • Code follows existing patterns (same import style, inline Pressable handlers, consistent formatting)
  • Build configuration is valid — posthog-react-native added correctly to package.json dependencies

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.56.3 added to package.json
PostHog client initialized Yes Correct React Native pattern: new PostHog(token, { host, captureAppLifecycleEvents: true }) in lib/posthog.ts, wrapped in PostHogProvider in _layout.tsx
capture() Yes 6 distinct capture calls across 4 files covering core user interactions
identify() N/A No authentication system exists in this read-only HN reader app
Error tracking No No captureException, error boundary, or exception autocapture configured
Reverse proxy N/A Mobile React Native app — reverse proxies are not applicable

Issues

  • Missing error tracking: No error boundary or captureException calls are implemented. For React Native, wrapping the app tree in an error boundary with posthog.captureException(error) would capture uncaught exceptions. [MEDIUM]

Other completed criteria

  • API key loaded from EXPO_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • Host correctly configured from EXPO_PUBLIC_POSTHOG_HOST environment variable
  • PostHogProvider correctly wraps the app tree with client={posthog}
  • Screen tracking implemented via useEffect + usePathname with posthog.screen() — valid use of useEffect for external system synchronization
  • captureAppLifecycleEvents: true enables automatic app lifecycle tracking
  • debug: __DEV__ enables debug mode only in development
  • Runtime validation of env vars with throw new Error() prevents silent failures

PostHog insights and events ✅

Filename PostHog events Description
app/_layout.tsx screen (via posthog.screen()) Tracks screen views with previous screen context on every route change
app/index.tsx story_type_selected Captures feed filter changes with the selected story type
components/posts/Post.tsx story_opened, external_story_opened Captures story navigation from feed with story_id, entry_point, has_comments
app/[itemId].tsx user_profile_opened, story_discussion_opened, external_story_opened Captures story detail interactions with entry_point context

Issues

None — events are well-designed and cover the core user journey.

Other completed criteria

  • Events represent real user actions (opening stories, changing feeds, navigating to discussions)
  • Events enable product insights — can build funnels (feed → story → discussion/external link), track feed type preferences, and measure engagement depth
  • Events include contextual properties (story_id, entry_point, has_comments, comment_count, story_type, previous_screen)
  • No PII in event properties — only numeric IDs and behavioral context
  • Consistent snake_case naming convention with descriptive action names

Reviewed by wizard workbench PR evaluator

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants