Skip to content

[CI] (0ae2102) react-native/expo-react-native-hacker-news#1235

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

[CI] (0ae2102) react-native/expo-react-native-hacker-news#1235
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0ae2102-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented Apr 15, 2026

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0ae2102
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-0ae2102-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-04-15T19:32:16.623Z
Duration: 521.1s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented Apr 15, 2026

PR Evaluation Report

Summary

This PR integrates PostHog analytics into an Expo React Native Hacker News app using the posthog-react-native SDK. It adds a shared PostHog client configuration, wraps the app with PostHogProvider, implements manual screen tracking, and instruments 12 custom events across 6 files covering content consumption and navigation flows.

Files changed Lines added Lines removed
12 +246 -24

Confidence score: 5/5 🧙

  • No user identification implemented: The app has no posthog.identify() call anywhere. For a Hacker News reader app without authentication this may be expected, but if users can log in, this is a gap. Since the app appears to be read-only with no auth, this is N/A.
  • Error tracking not implemented: No captureException() calls, no error boundary wrapping, and capture_exceptions is not enabled in the PostHog config. [MEDIUM]
  • No reverse proxy configured: This is a React Native app (not browser-based), so reverse proxy is N/A.
  • story_feed_viewed captured in useEffect: The event in app/index.tsx fires inside a useEffect with an empty dependency array but references storyType state — the initial value is captured but subsequent changes are not tracked by this event (the story_type_changed event covers that separately, so this is a minor concern). [LOW]

File changes

Filename Score Description
src/config/posthog.ts 4/5 Creates shared PostHog client using expo-constants for config. Good defensive coding with disabled mode when unconfigured.
app/_layout.tsx 4/5 Wraps app with PostHogProvider, adds manual screen tracking via pathname changes. Well-structured refactor.
app/[itemId].tsx 4/5 Adds 3 capture events for upvote, external link, and parent item navigation in event handlers.
app/index.tsx 3/5 Adds story_feed_viewed event in useEffect — acceptable for screen view tracking but references storyType without including it in deps.
app/users/[userId].tsx 4/5 Adds user_profile_viewed event correctly triggered on userId change.
components/Select.tsx 5/5 Clean event capture for story type changes in the onPress handler with good properties.
components/comments/comment.tsx 4/5 Adds events for comment author tap and thread opening in event handlers.
components/posts/Post.tsx 4/5 Comprehensive event tracking for post interactions — opens, upvotes, comments, external links.
app.config.js 4/5 Properly exposes PostHog env vars via expo-constants extra field.
package.json 5/5 Adds posthog-react-native dependency correctly.
.gitignore 5/5 Adds .env to gitignore to prevent secret leakage.
posthog-setup-report.md 4/5 Comprehensive setup report documenting all events and next steps.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors, proper imports, valid dependency added
Preserves existing env vars & configs Yes Existing app.json is replaced by app.config.js which preserves all original config values plus adds PostHog extras
No syntax or type errors Yes All TypeScript/JSX syntax is valid
Correct imports/exports Yes All imports from posthog-react-native, expo-constants, and internal config are correct
Minimal, focused changes Yes All changes are PostHog-related
Pre-existing issues None No pre-existing issues observed

Issues

  • app.json replaced by app.config.js: The PR creates a new app.config.js but the diff doesn't show app.json being deleted. If both exist, Expo should prefer app.config.js, but having both could cause confusion. [LOW]

Other completed criteria

  • Environment variables documented via .env in .gitignore and posthog-setup-report.md mentions setting POSTHOG_PROJECT_TOKEN and POSTHOG_HOST
  • Build configuration is valid — posthog-react-native added to package.json dependencies
  • Code follows existing codebase patterns (same import style, component structure)

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.41.2 added to package.json
PostHog client initialized Yes Shared client in src/config/posthog.ts using new PostHog() with expo-constants for config; PostHogProvider wraps app in _layout.tsx
capture() Yes 12 meaningful capture calls across 6 files covering the full user journey
identify() N/A App appears to be a read-only Hacker News client with no authentication — no user identity to link
Error tracking No No captureException() calls, no error boundary, capture_exceptions not enabled in config
Reverse proxy N/A React Native app — not browser-based, ad blockers don't apply

Issues

  • No error tracking: The PR does not implement any error tracking. There's no error boundary component, no try/catch with captureException(), and the PostHog config doesn't enable capture_exceptions: true. This is a missed opportunity for a mobile app where crash reporting is valuable. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via Constants.expoConfig?.extra?.posthogProjectToken — not hardcoded
  • Host correctly configured via environment variable with fallback
  • Graceful degradation when PostHog is not configured (disabled mode with warning)
  • Manual screen tracking implemented via posthog.screen() on pathname changes
  • captureAppLifecycleEvents: true enabled for app open/close tracking
  • Debug mode enabled in development via __DEV__

PostHog insights and events ✅

Filename PostHog events Description
app/_layout.tsx screen (via posthog.screen()) Tracks screen views on pathname changes with previous screen and route params
app/index.tsx story_feed_viewed Captures when user views the home screen feed
components/Select.tsx story_type_changed Tracks story category switches with previous and new type
components/posts/Post.tsx post_opened, post_external_link_opened, post_upvoted, post_comments_opened Comprehensive post interaction tracking
app/[itemId].tsx item_upvoted, item_external_link_opened, parent_item_opened Item detail page interaction tracking
app/users/[userId].tsx user_profile_viewed Tracks user profile page views
components/comments/comment.tsx comment_author_tapped, comment_thread_opened Comment interaction tracking

Issues

  • No critical or medium issues with event quality.

Other completed criteria

  • Events represent real user actions in a Hacker News reader (viewing feeds, opening posts, upvoting, viewing comments, navigating to profiles)
  • Events enable product insights — content engagement funnel (story_feed_viewedpost_openedcomment_thread_opened), story type popularity breakdown, external link click trends
  • Events include relevant contextual properties (post_id, post_title, post_score, comment_count, story_type, url, etc.)
  • No PII in event properties — viewed_user_id and author are public Hacker News usernames, not personal data
  • Event names are descriptive and consistently use snake_case (post_opened, story_type_changed, comment_thread_opened)

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