Skip to content

[CI] (6b2dc8b) react-native/expo-react-native-hacker-news - #3735

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

[CI] (6b2dc8b) react-native/expo-react-native-hacker-news#3735
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-6b2dc8b-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 6b2dc8b
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-6b2dc8b-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-09-01T15:56:55.701Z
Duration: 449.0s

YARA Scanner

✓ 159 tool calls scanned, 0 violations detected

No violations: ✓ 159 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Author

Now I have all the context I need to evaluate this PR comprehensively.


PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News app using the posthog-react-native SDK. It adds the PostHogProvider in the root layout, implements screen tracking via a ScreenTracker component, captures meaningful user interaction events across multiple components, and sets up error tracking with PostHogErrorBoundary. The API key is loaded from environment variables via Expo Constants.

Files changed Lines added Lines removed
9 +147 -30

Confidence score: 5/5 🧙

  • No identify() call is implemented anywhere in the app — there is no auth/login flow visible, but this is still a gap for any future user identification needs. Since this is a Hacker News reader without authentication, this is acceptable as N/A.
  • The ScreenTracker component uses useEffect to call posthog.screen() on route changes, which is the correct React Native pattern for screen tracking since posthog-react-native does not autocapture screens by default. However, posthog from usePostHog() is listed as a dependency in the effect, which could cause unnecessary re-renders — though in practice the reference is stable. [LOW]
  • The errorTracking: { autocapture: { console: [] } } configuration passes an empty array for console, which effectively disables console error autocapture. This is an intentional choice but reduces error tracking coverage. [LOW]

File changes

Filename Score Description
lib/posthog.ts 5/5 New config helper that reads PostHog key/host from Expo Constants with dev-mode validation
app/_layout.tsx 4/5 Adds PostHogProvider, PostHogErrorBoundary, and ScreenTracker; well-structured with graceful fallback when unconfigured
app/[itemId].tsx 5/5 Adds capture calls for story author, external story, and parent story navigation
components/posts/Post.tsx 5/5 Adds capture calls for story opens and external link opens
components/comments/comment.tsx 5/5 Adds capture calls for comment author and thread navigation
components/Select.tsx 5/5 Adds capture call for story type filter selection
app.config.js 5/5 Exposes env vars through Expo config extras
.env.example 5/5 Documents required PostHog environment variables
package.json 5/5 Adds posthog-react-native dependency

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors, all imports resolve, SDK version is valid
Preserves existing env vars & configs Yes Existing app.json is spread into the new app.config.js; all existing code preserved
No syntax or type errors Yes All TypeScript/JSX is valid; proper type assertions used
Correct imports/exports Yes posthog-react-native exports PostHogProvider, PostHogErrorBoundary, usePostHog correctly
Minimal, focused changes Yes All changes are PostHog-related; layout restructuring is necessary to wrap with provider
Pre-existing issues None

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid — package.json has correct dependency format
  • app.config.js correctly extends existing app.json

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.66.3 added to dependencies
PostHog client initialized Yes PostHogProvider wraps the app in _layout.tsx with apiKey and host options
capture() Yes Multiple meaningful capture calls across 4 component files
identify() N/A App is a Hacker News reader with no authentication — no user identity to link
Error tracking Yes PostHogErrorBoundary wraps the app with a fallback component; errorTracking.autocapture configured
Reverse proxy N/A React Native app — reverse proxy is for browser posthog-js only

Issues

  • Console error autocapture disabled: The errorTracking: { autocapture: { console: [] } } passes an empty array, which disables console error autocapture. If error tracking coverage is desired, remove the empty array or populate it with error levels like ['error']. [LOW]

Other completed criteria

  • API key loaded from environment variable via Expo Constants (not hardcoded)
  • Host correctly configured via environment variable, defaulting to https://us.i.posthog.com
  • Screen views registered via ScreenTracker component using posthog.screen() with pathname tracking
  • Graceful degradation when PostHog is not configured (returns app without provider)

PostHog insights and events ✅

Filename PostHog events Description
app/_layout.tsx screen (via posthog.screen()) Tracks screen views on every route change with pathname and param metadata
app/[itemId].tsx story_author_opened, external_story_opened, parent_story_opened Captures navigation to author profiles, external URLs, and parent stories
components/posts/Post.tsx story_opened, external_story_opened Captures story detail navigation and external link opens with story_id
components/comments/comment.tsx story_author_opened, comment_thread_opened Captures comment author navigation and thread drilling with comment_id
components/Select.tsx story_type_selected Captures filter type changes with story_type property
app/_layout.tsx capturedException (via PostHogErrorBoundary) Automatically captures unhandled React component exceptions

Issues

None.

Other completed criteria

  • Events represent real user actions (reading stories, navigating to authors, opening external links, filtering)
  • Events enable product insights — can build funnels for story discovery → story open → external link click
  • Events include relevant properties (story_id, comment_id, story_type)
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case naming convention

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