Skip to content

[CI] (4c70a79) react-native/expo-react-native-hacker-news - #3872

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

[CI] (4c70a79) react-native/expo-react-native-hacker-news#3872
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-4c70a79-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 4c70a79
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-4c70a79-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-09T22:32:35.260Z
Duration: 537.4s

YARA Scanner

✓ 180 tool calls scanned, 0 violations detected

No violations: ✓ 180 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Author

Now I have all the context I need. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a React Native (Expo) Hacker News reader app. It adds the posthog-react-native SDK, initializes it via a shared module, wraps the app in PostHogProvider and PostHogErrorBoundary, implements manual screen tracking via Expo Router's usePathname, and adds multiple meaningful capture() calls across components for user interactions like opening stories, comments, and author profiles.

Files changed Lines added Lines removed
10 +146 -29

Confidence score: 5/5 🧙

  • No identify() call: The app has no user identification. While this Hacker News reader appears to lack authentication, identifying users is a recommended practice even for anonymous apps (PostHog auto-generates anonymous IDs, but explicit identification is standard). [MEDIUM]
  • Web target not initialized: The project configures iOS, Android, and Web targets (app.json has a web section, package.json has a web script), but only posthog-react-native is installed. The web target may not capture events properly without posthog-js. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 5/5 PostHog singleton initialization with env var validation and dev warnings
app/_layout.tsx 5/5 Wraps app with PostHogProvider and PostHogErrorBoundary, graceful fallback when PostHog is unavailable
components/PostHogScreenTracking.tsx 4/5 Screen tracking using usePathname + useEffect; valid pattern for Expo Router
app/[itemId].tsx 5/5 Adds capture events for author profile, external link, and parent item navigation
components/posts/Post.tsx 5/5 Adds capture events for story opens and external links with source context
components/comments/comment.tsx 5/5 Adds capture events for author profile and comment thread opens
components/Select.tsx 5/5 Captures story feed type changes with previous/new values
.env.example 5/5 Documents required PostHog env vars
app.config.js 5/5 Passes env vars through Expo Constants
package.json 5/5 Adds posthog-react-native dependency

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors, valid JSX/TSX, correct dependency added
Preserves existing env vars & configs Yes Existing app.json preserved via spread in app.config.js; layout restructured cleanly
No syntax or type errors Yes All code is syntactically valid
Correct imports/exports Yes posthog-react-native imports are correct (PostHog, PostHogProvider, PostHogErrorBoundary)
Minimal, focused changes Yes All changes are PostHog-related; layout restructuring is minimal and necessary
Pre-existing issues None

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid — package.json properly updated
  • app.config.js correctly extends app.json with extra config

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.68.4 added to package.json
PostHog client initialized Yes Singleton in lib/posthog.ts using new PostHog(token, { host, captureAppLifecycleEvents: true })
capture() Yes 8 meaningful capture calls across 4 components
identify() No No identify() call anywhere in the codebase changes
Error tracking Yes PostHogErrorBoundary wraps the entire app in _layout.tsx
Reverse proxy N/A React Native mobile app — reverse proxy is not applicable

Issues

  • Missing identify(): No posthog.identify() call is implemented. Even though this Hacker News reader may not have authentication, identify() should be set up for when/if user identification becomes available. At minimum, the pattern should be documented or stubbed. [MEDIUM]
  • Web target uninitialized: The project has explicit web configuration (app.json web section, expo start --web script, react-native-web dependency). posthog-react-native may not capture events on the web target. The web platform should have posthog-js initialized separately, or the limitation should be documented. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via Expo Constants (not hardcoded)
  • Host correctly configured from environment variable
  • Screen views tracked via PostHogScreenTracking component using usePathname + posthog.screen()
  • captureAppLifecycleEvents: true enables app lifecycle tracking
  • Graceful degradation when PostHog credentials are missing (returns undefined, app still works)
  • Dev-mode warnings when env vars are missing

PostHog insights and events ✅

Filename PostHog events Description
components/posts/Post.tsx story_opened, external_story_opened Tracks when users open stories (internal navigation vs external URL) with source context
components/comments/comment.tsx author_profile_opened, comment_thread_opened Tracks comment author clicks and thread navigation
components/Select.tsx story_feed_changed Tracks feed type switching with previous/new values
app/[itemId].tsx author_profile_opened, external_story_opened, parent_item_opened Tracks detail page interactions
components/PostHogScreenTracking.tsx `` (via posthog.screen()) Tracks all screen views on route changes
app/_layout.tsx captureException (via PostHogErrorBoundary) Captures uncaught exceptions in the React tree

Other completed criteria

  • Events represent real user actions (opening stories, navigating to profiles, switching feeds)
  • Events enable product insights — can build funnels (story list → story opened → external link clicked), retention (daily active readers), and behavioral analysis
  • Events include enriched properties (item_id, source, story_type, previous_story_type, parent_item_id)
  • No PII in event properties — only item IDs and source identifiers
  • Event names are descriptive, consistent snake_case, and describe actual user actions

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