Skip to content

[CI] (3f39e0e) react-native/expo-react-native-hacker-news - #4171

Closed
wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-3f39e0e-react-native-expo-react-native-hacker-news
Closed

wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-3f39e0e-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f39e0e
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-3f39e0e-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-23T22:12:51.155Z
Duration: 535.3s

YARA Scanner

✓ 209 tool calls scanned, 0 violations detected

No violations: ✓ 209 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Author

Now I have all the information needed to evaluate this PR. Let me compile the review.


PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app by adding the posthog-react-native SDK, initializing it with environment variables, wrapping the app in PostHogProvider, and adding custom event captures across multiple components. It also sets up error tracking autocapture and a structured logging adapter.

Files changed Lines added Lines removed
12 +159 -35

Confidence score: 5/5 🧙

  • No screen view tracking configured: The PostHogProvider wraps the Stack component but there is no explicit screen tracking setup (e.g., autocapture prop on PostHogProvider or useNavigationTracker hook). With expo-router, automatic screen tracking may not work without explicit configuration. [MEDIUM]
  • Behavioral change in Select.tsx: The onChange callback is now gated behind !isSelected, preventing it from firing when the already-selected option is tapped. This changes existing app behavior beyond the PostHog integration. [LOW]

File changes

Filename Score Description
lib/posthog.ts 5/5 PostHog initialization with env vars, error tracking autocapture, lifecycle events, and structured logging config
lib/posthog-logger.ts 4/5 Logger adapter wrapping the SDK's logger API for structured log export
app/_layout.tsx 4/5 PostHogProvider wrapping the navigation stack, with graceful fallback when unconfigured
package.json 5/5 Correct SDK and required peer dependencies added
.env.example 5/5 Environment variables documented
app/[itemId].tsx 5/5 Event captures for author profile, external link, and parent discussion actions
components/posts/Post.tsx 5/5 Event captures for story interactions with descriptive source properties
components/posts/Posts.tsx 4/5 Structured logging for feed load success/failure
components/comments/comment.tsx 5/5 Event captures for author profile and discussion navigation
components/Select.tsx 3/5 Event capture for feed type change, but introduces behavioral change to onChange
.gitignore 5/5 .env added to gitignore
app.json 4/5 expo-localization plugin added (PostHog dependency)

App sanity check ✅

Criteria Result Description
App builds and runs Yes All imports resolve, SDK dependencies properly added
Preserves existing env vars & configs Yes No existing config modified destructively
No syntax or type errors Yes Valid TypeScript throughout
Correct imports/exports Yes posthog-react-native used correctly for both PostHog class and PostHogProvider
Minimal, focused changes Yes All changes relate to PostHog integration, with one minor behavioral adjustment
Pre-existing issues None —

Issues

  • Behavioral change in Select.tsx: The onChange(item.id) call is now inside if (!isSelected), meaning tapping the already-selected option no longer calls onChange. While arguably correct, this is a functional change beyond the PostHog integration scope. [LOW]

Other completed criteria

  • Environment variables documented in .env.example with EXPO_PUBLIC_ prefix
  • .env added to .gitignore to prevent secrets from being committed
  • Build config valid — required expo peer dependencies (expo-application, expo-device, expo-file-system, expo-localization) added

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.77.0 added with required Expo peer dependencies
PostHog client initialized Yes new PostHog(projectToken, { host, captureAppLifecycleEvents, logs, errorTracking }) in lib/posthog.ts with graceful fallback when env vars missing
capture() Yes 7 distinct capture calls across 5 component files
identify() N/A App is an anonymous Hacker News reader with no authentication system
Error tracking Yes errorTracking.autocapture configured with uncaughtExceptions and unhandledRejections
Reverse proxy N/A React Native mobile SDK — not applicable

Issues

  • No explicit screen view tracking: The PostHogProvider wraps the Stack navigator, but with expo-router the NavigationContainer is internal. Without explicit screen tracking configuration (e.g., autocapture prop on PostHogProvider or using useNavigationTracker), screen view events may not fire. The app should verify screen views are being captured or add manual tracking. [MEDIUM]

Other completed criteria

  • API key loaded from EXPO_PUBLIC_POSTHOG_KEY environment variable
  • Host configured from EXPO_PUBLIC_POSTHOG_HOST environment variable
  • PostHogProvider conditionally renders based on initialization success
  • Dev-mode error thrown when env vars are missing to prevent silent misconfiguration
  • App lifecycle events captured via captureAppLifecycleEvents: true
  • Structured logging configured with serviceName: "hacker-native"

PostHog insights and events ✅

Filename PostHog events Description
app/[itemId].tsx author_profile_opened, external_link_opened, story_discussion_opened Tracks user navigation from item detail view to author profiles, external URLs, and parent discussions
components/posts/Post.tsx external_link_opened, story_opened, story_discussion_opened Tracks story card interactions — opening external links, stories, and comment threads
components/posts/Posts.tsx posthogLogger.info, posthogLogger.warn Structured logs for feed load success (with story count) and failure
components/comments/comment.tsx author_profile_opened, story_discussion_opened Tracks author profile and discussion navigation from comments
components/Select.tsx story_feed_changed Tracks when user switches feed type (top, new, best, etc.)
lib/posthog.ts captureException (autocapture) Automatic exception tracking for uncaught errors and unhandled rejections

Issues

None — events are well-structured and meaningful.

Other completed criteria

  • Events represent real user actions (navigating to profiles, opening links, switching feeds)
  • Events enable product insights — could build funnels (feed → story → external link), track engagement patterns by source
  • All events include source property identifying the UI context where the action occurred
  • No PII in event properties — only action context (source, story_type)
  • Event names use consistent snake_case convention with descriptive verb_noun pattern

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