Skip to content

implement the onboarding screen#1

Merged
Retsomm merged 1 commit into
mainfrom
dev
May 18, 2026
Merged

implement the onboarding screen#1
Retsomm merged 1 commit into
mainfrom
dev

Conversation

@Retsomm
Copy link
Copy Markdown
Owner

@Retsomm Retsomm commented May 18, 2026

Summary by CodeRabbit

  • New Features
    • Introduced onboarding experience with welcome screen
    • Added language selection screen
    • Implemented bottom tab navigation (Home, Learn, AI Teacher, Chat, Profile)
    • Added lesson browser with learning content system
    • Launched audio-based AI teacher lessons with live captions and real-time streaming
    • Updated design system color tokens for visual consistency

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

This pull request establishes a complete feature roadmap and initial implementation for a Duolingo-inspired language learning app. It includes foundational engineering guidelines, design system setup, home screen refactor, authentication flow, learning content system, navigation, lesson UI, audio integration with Vision Agents backend, and analytics instrumentation.

Changes

Language Learning App Feature Roadmap

Layer / File(s) Summary
Foundation & Engineering Guidelines
prompts/AGENTS.md
Project scope, tech stack, development philosophy, decision-making rules, and architecture guidance for the React Native teaching app.
Design System & Home Screen Refactor
prompts/01-nativewind.md, prompts/02-design-theme.md, app/index.tsx
NativeWind v5 setup instructions, design token implementation, and home screen color data migration from value to hex fields with updated ColorItem type and ColorGroup rendering.
User Onboarding & Authentication
app/onboarding.tsx, prompts/03-onboarding-ui.md, prompts/04-authentication-ui.md, prompts/05-clerk.md
Onboarding screen component with safe-area layout and branding, Sign Up/Sign In UI design specs, verification-code modal flow, and Clerk auth integration.
Learning Content & Language Selection
prompts/06-content-system.md, prompts/07-language-ui.md, prompts/08-zustand.md
TypeScript learning content system with hardcoded languages, units, lessons, and vocabulary; language selection UI; and Zustand+AsyncStorage state persistence.
Navigation & Home Screen UI
prompts/09-bottom-tab-nav.md, prompts/10-home-ui.md
Bottom tab navigation with animated active indicator and five tab routes (Home, Learn, AI Teacher, Chat, Profile); Home screen rendering Clerk user data, selected language, and lesson progress.
Lesson Browsing & Audio Lesson System
prompts/11-lesson-ui.md, prompts/12-audio-lesson-ui.md, prompts/13-stream-integration.md
Lessons screen showing language-specific lessons from learning data; audio-only AI Teacher lesson screen with controls and feedback UI; Stream audio call setup with token generation and explicit call states.
Vision Agents Backend & Agent-UI Connection
prompts/14-vision-agents.md, prompts/15-connection-to-ui.md
Python Vision Agents voice teacher using OpenAI Realtime and Stream Edge; Expo API routes to start/stop agent and pass lesson metadata; agent lifecycle management and session cleanup.
AI Teacher Refinement & Analytics
prompts/16-ai-teacher-improvements.md, prompts/17-live-captions.md, prompts/18-more-posthog.md
AI teacher behavioral instructions for warm, interactive, vocabulary-paced responses; realtime live captions for teacher and user speech; PostHog identify and custom event tracking (language_selected, lesson_started, lesson_abandoned).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hops with delight through the roadmap so grand,
Design system, auth, and lessons all planned!
Audio lessons with Vision Agents bright,
Learning flows dancing—what a feature-packed sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'implement the onboarding screen' directly and accurately describes the main change: a new onboarding screen component was added to the app (app/onboarding.tsx), with supporting navigation and design tokens.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
prompts/AGENTS.md (1)

86-87: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Complete or remove the dangling architecture directive.

The sentence ends with a colon but no structure follows, leaving a required guideline undefined.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/AGENTS.md` around lines 86 - 87, The line "Use this structure unless
there is a strong reason to change it:" ends with a colon but has no structure;
either complete it by appending the intended structure/example (e.g., a bullet
list or template showing the required fields/format) or remove the colon and
rephrase to a complete sentence (e.g., "Use this structure unless there is a
strong reason to change it.") so the directive in prompts/AGENTS.md is no longer
dangling.
🧹 Nitpick comments (3)
prompts/11-lesson-ui.md (1)

5-5: ⚡ Quick win

Reduce required data expansion for the first iteration.

Requiring “at least 5 more lessons” may over-scope the initial implementation; consider “add only enough lessons to support the required UI states” for faster, simpler delivery.

Based on learnings: "Build feature by feature... build the smallest useful version first, and refactor only when repetition or complexity appears".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/11-lesson-ui.md` at line 5, Update the lesson data expansion rule in
the "Allow users to select/open any lesson" requirement so it no longer mandates
adding "at least 5 more lessons"; instead change the instruction text to say
"add only enough lessons to support the required UI states" (or equivalent
minimal expansion). Locate the sentence in the prompt that currently requires
"at least 5 more lessons" and replace it with the smaller-scope phrasing so UI
implementation can create only the minimal number of placeholder lessons needed
for selection/opening and state coverage.
app/onboarding.tsx (2)

6-6: ⚡ Quick win

Consider consolidating image imports for consistency.

Line 6 uses require() directly for mascotWelcome, while Line 26 uses the images constant for mascotLogo. For maintainability, consider adding mascotWelcome to the images constant and importing it from there.

♻️ Suggested approach

Add to constants/images:

mascotWelcome: require("../assets/images/mascot-welcome.png")

Then update this file:

-const mascotWelcome = require("../assets/images/mascot-welcome.png");
-
 export default function OnboardingScreen() {
           <Image
-            source={mascotWelcome}
+            source={images.mascotWelcome}
             resizeMode="contain"

Also applies to: 26-26

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/onboarding.tsx` at line 6, Consolidate image imports by adding
mascotWelcome to the shared images constant (e.g., add mascotWelcome:
require("../assets/images/mascot-welcome.png") in constants/images) and then
replace the local require in onboarding.tsx by importing mascotWelcome from the
images object like mascotLogo is used; update any references in onboarding.tsx
to use images.mascotWelcome (or the destructured mascotWelcome) so all image
assets are consistently loaded from the images constant.

40-40: 💤 Low value

Hardcoded color value instead of design token.

Line 40 uses #626b85 directly. Consider extracting this to a design token in your Tailwind theme (e.g., text-lingua-text-secondary or similar) for consistency with the rest of the color system.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/onboarding.tsx` at line 40, Replace the hardcoded color hex in the Text
element's className in app/onboarding.tsx (the JSX Text with className
"mt-[10px] font-poppins text-[11px] leading-[16px] text-[`#626b85`]") with a
design-token class (e.g., text-lingua-text-secondary) and add that token to the
Tailwind theme colors in your tailwind.config.js (map the token to the `#626b85`
value) so the component uses the new token consistently across the app.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/onboarding.tsx`:
- Line 66: The "Get Started" Link in app/onboarding.tsx currently navigates to
"/" but should go to the Sign Up screen; update the Link component's href prop
(the Link usage that wraps the "Get Started" button) to point to the Sign Up
route (e.g., "/signup" or the app's signup path) so clicking Get Started
navigates to the Sign Up screen instead of home.
- Around line 30-31: Replace the hardcoded app name "lingua" in the onboarding
UI with the required name "muolingo": update the Text element (the JSX element
rendering the app title in app/onboarding.tsx, i.e., the Text node with
className "font-poppins-bold text-[14px] leading-[18px]
text-lingua-text-primary") so its displayed string is "muolingo" instead of
"lingua".

In `@prompts/05-clerk.md`:
- Line 7: Fix the typo in the route text by replacing the malformed route string
"(/onboarding(" with the correct closing-parenthesis form "(/onboarding)";
update the sentence that reads "If not authenticated, show onboarding route
(/onboarding(" so it reads "If not authenticated, show onboarding route
(/onboarding)" to ensure the route path is correctly closed.

In `@prompts/10-home-ui.md`:
- Line 3: The prompt text is ambiguous and repetitive ("exactly ... exactly
done"); replace that clause with one concise constraint sentence that specifies
fidelity to the provided design for spacing and layout, while keeping the two
functional requirements (display logged-in user info from Clerk and the selected
language from Zustand + AsyncStorage). Update the prompt in
prompts/10-home-ui.md to remove duplicate "exactly" phrasing, state a single
clear constraint about following the attached design's spacing/layout, and
explicitly retain the requirements to show Clerk user info and the
Zustand+AsyncStorage language selection for implementers.

In `@prompts/18-more-posthog.md`:
- Line 19: Update the custom-events numbering so the sequence is consecutive:
change the "4. lesson_abandoned — fires when the user exits a lesson before
lesson_completed fires (back navigation, screen unmount before completion)."
entry number from 4 to 3 (the event identifier is lesson_abandoned) so the list
reads 1, 2, 3 rather than skipping to 4.
- Around line 20-25: The spec mismatches the property name for the
lesson-abandon event: change either the reference to duration_seconds to use
time_into_lesson_seconds or vice versa so both uses are identical; update the
event sending code that builds the lesson_abandoned PostHog properties (look for
the usage that references lesson_id, last_question_index and the mount-captured
start-time ref) to emit a single consistent property name (e.g.,
time_into_lesson_seconds) and ensure the ref-based duration calculation assigns
to that same key.

---

Outside diff comments:
In `@prompts/AGENTS.md`:
- Around line 86-87: The line "Use this structure unless there is a strong
reason to change it:" ends with a colon but has no structure; either complete it
by appending the intended structure/example (e.g., a bullet list or template
showing the required fields/format) or remove the colon and rephrase to a
complete sentence (e.g., "Use this structure unless there is a strong reason to
change it.") so the directive in prompts/AGENTS.md is no longer dangling.

---

Nitpick comments:
In `@app/onboarding.tsx`:
- Line 6: Consolidate image imports by adding mascotWelcome to the shared images
constant (e.g., add mascotWelcome:
require("../assets/images/mascot-welcome.png") in constants/images) and then
replace the local require in onboarding.tsx by importing mascotWelcome from the
images object like mascotLogo is used; update any references in onboarding.tsx
to use images.mascotWelcome (or the destructured mascotWelcome) so all image
assets are consistently loaded from the images constant.
- Line 40: Replace the hardcoded color hex in the Text element's className in
app/onboarding.tsx (the JSX Text with className "mt-[10px] font-poppins
text-[11px] leading-[16px] text-[`#626b85`]") with a design-token class (e.g.,
text-lingua-text-secondary) and add that token to the Tailwind theme colors in
your tailwind.config.js (map the token to the `#626b85` value) so the component
uses the new token consistently across the app.

In `@prompts/11-lesson-ui.md`:
- Line 5: Update the lesson data expansion rule in the "Allow users to
select/open any lesson" requirement so it no longer mandates adding "at least 5
more lessons"; instead change the instruction text to say "add only enough
lessons to support the required UI states" (or equivalent minimal expansion).
Locate the sentence in the prompt that currently requires "at least 5 more
lessons" and replace it with the smaller-scope phrasing so UI implementation can
create only the minimal number of placeholder lessons needed for
selection/opening and state coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a18e83a-7d0c-4229-a30e-42bfb32be34f

📥 Commits

Reviewing files that changed from the base of the PR and between 8b42ce7 and b9749d0.

📒 Files selected for processing (21)
  • app/index.tsx
  • app/onboarding.tsx
  • prompts/01-nativewind.md
  • prompts/02-design-theme.md
  • prompts/03-onboarding-ui.md
  • prompts/04-authentication-ui.md
  • prompts/05-clerk.md
  • prompts/06-content-system.md
  • prompts/07-language-ui.md
  • prompts/08-zustand.md
  • prompts/09-bottom-tab-nav.md
  • prompts/10-home-ui.md
  • prompts/11-lesson-ui.md
  • prompts/12-audio-lesson-ui.md
  • prompts/13-stream-integration.md
  • prompts/14-vision-agents.md
  • prompts/15-connection-to-ui.md
  • prompts/16-ai-teacher-improvements.md
  • prompts/17-live-captions.md
  • prompts/18-more-posthog.md
  • prompts/AGENTS.md

Comment thread app/onboarding.tsx
Comment on lines +30 to +31
<Text className="font-poppins-bold text-[14px] leading-[18px] text-lingua-text-primary">
lingua
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

App name doesn't match the prompt specification.

The code uses "lingua" but prompts/03-onboarding-ui.md explicitly specifies the app name should be "muolingo" (replacing "lingua").

📝 Proposed fix
-          <Text className="font-poppins-bold text-[14px] leading-[18px] text-lingua-text-primary">
-            lingua
+          <Text className="font-poppins-bold text-[14px] leading-[18px] text-lingua-text-primary">
+            muolingo
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Text className="font-poppins-bold text-[14px] leading-[18px] text-lingua-text-primary">
lingua
<Text className="font-poppins-bold text-[14px] leading-[18px] text-lingua-text-primary">
muolingo
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/onboarding.tsx` around lines 30 - 31, Replace the hardcoded app name
"lingua" in the onboarding UI with the required name "muolingo": update the Text
element (the JSX element rendering the app title in app/onboarding.tsx, i.e.,
the Text node with className "font-poppins-bold text-[14px] leading-[18px]
text-lingua-text-primary") so its displayed string is "muolingo" instead of
"lingua".

Comment thread app/onboarding.tsx

<View className="flex-1" />

<Link href="/" asChild>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

"Get Started" navigates to the wrong route.

The button links to the home route (/) but prompts/04-authentication-ui.md Line 5 explicitly states: "Update onboarding so pressing Get Started navigates to the Sign Up screen."

🔗 Proposed fix
-        <Link href="/" asChild>
+        <Link href="/sign-up" asChild>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link href="/" asChild>
<Link href="/sign-up" asChild>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/onboarding.tsx` at line 66, The "Get Started" Link in app/onboarding.tsx
currently navigates to "/" but should go to the Sign Up screen; update the Link
component's href prop (the Link usage that wraps the "Get Started" button) to
point to the Sign Up route (e.g., "/signup" or the app's signup path) so
clicking Get Started navigates to the Sign Up screen instead of home.

Comment thread prompts/05-clerk.md

Keep the existing UI and navigation flow intact. Implement email-based Sign Up, Sign In, social auth where supported, and verification code handling through Clerk.

After successful verification/authentication, navigate to the home route (/). If not authenticated, show onboarding route (/onboarding(. If authenticated, show home route (/).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix typo in route path.

Missing closing parenthesis: (/onboarding( should be (/onboarding).

🐛 Proposed fix
-After successful verification/authentication, navigate to the home route (/). If not authenticated, show onboarding route (/onboarding(. If authenticated, show home route (/). 
+After successful verification/authentication, navigate to the home route (/). If not authenticated, show onboarding route (/onboarding). If authenticated, show home route (/). 
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
After successful verification/authentication, navigate to the home route (/). If not authenticated, show onboarding route (/onboarding(. If authenticated, show home route (/).
After successful verification/authentication, navigate to the home route (/). If not authenticated, show onboarding route (/onboarding). If authenticated, show home route (/).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/05-clerk.md` at line 7, Fix the typo in the route text by replacing
the malformed route string "(/onboarding(" with the correct closing-parenthesis
form "(/onboarding)"; update the sentence that reads "If not authenticated, show
onboarding route (/onboarding(" so it reads "If not authenticated, show
onboarding route (/onboarding)" to ensure the route path is correctly closed.

Comment thread prompts/10-home-ui.md
@@ -0,0 +1,9 @@
Read AGENTS.md first and follow it strictly.

Implement the Home screen UI exactly as shown in the attached design with spacing structure and such neatly exactly done. Display the logged-in user information from Clerk and the selected language from Zustand + AsyncStorage.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify the implementation directive wording.

Line 3 is repetitive/ambiguous (exactly ... exactly done), which makes execution less deterministic. Suggest tightening it to one clear constraint sentence.

Proposed edit
-Implement the Home screen UI exactly as shown in the attached design with spacing structure and such neatly exactly done. Display the logged-in user information from Clerk and the selected language from Zustand + AsyncStorage.
+Implement the Home screen UI to match the attached design closely, including spacing and layout. Display logged-in user information from Clerk and the selected language from Zustand + AsyncStorage.
Based on learnings: "Keep the app easy to teach and explain by maintaining approachable code".
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Implement the Home screen UI exactly as shown in the attached design with spacing structure and such neatly exactly done. Display the logged-in user information from Clerk and the selected language from Zustand + AsyncStorage.
Implement the Home screen UI to match the attached design closely, including spacing and layout. Display logged-in user information from Clerk and the selected language from Zustand + AsyncStorage.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/10-home-ui.md` at line 3, The prompt text is ambiguous and repetitive
("exactly ... exactly done"); replace that clause with one concise constraint
sentence that specifies fidelity to the provided design for spacing and layout,
while keeping the two functional requirements (display logged-in user info from
Clerk and the selected language from Zustand + AsyncStorage). Update the prompt
in prompts/10-home-ui.md to remove duplicate "exactly" phrasing, state a single
clear constraint about following the attached design's spacing/layout, and
explicitly retain the requirements to show Clerk user info and the
Zustand+AsyncStorage language selection for implementers.

2. lesson_started — fires when the lesson screen mounts and the user begins the lesson.
Properties: { lesson_id: string, language: string, lesson_number: number }

4. lesson_abandoned — fires when the user exits a lesson before lesson_completed fires (back navigation, screen unmount before completion).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix event numbering typo (4. should be 3.).

The custom-events list skips from 2 to 4, which can confuse implementation/checklist tracking.

Suggested fix
-4. lesson_abandoned — fires when the user exits a lesson before lesson_completed fires (back navigation, screen unmount before completion).
+3. lesson_abandoned — fires when the user exits a lesson before lesson_completed fires (back navigation, screen unmount before completion).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/18-more-posthog.md` at line 19, Update the custom-events numbering so
the sequence is consecutive: change the "4. lesson_abandoned — fires when the
user exits a lesson before lesson_completed fires (back navigation, screen
unmount before completion)." entry number from 4 to 3 (the event identifier is
lesson_abandoned) so the list reads 1, 2, 3 rather than skipping to 4.

Comment on lines +20 to +25
Properties: { lesson_id: string, time_into_lesson_seconds: number, last_question_index: number }


Implementation rules:
- Track lesson start time with a ref captured on mount so duration_seconds is accurate.
- Do not modify any UI.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Align lesson_abandoned duration property naming across spec lines.

Line 20 defines time_into_lesson_seconds, but Line 24 references duration_seconds. This mismatch can fragment PostHog event schema and break downstream queries.

Suggested fix
-Properties: { lesson_id: string, time_into_lesson_seconds: number, last_question_index: number }
+Properties: { lesson_id: string, duration_seconds: number, last_question_index: number }

-Track lesson start time with a ref captured on mount so duration_seconds is accurate.
+Track lesson start time with a ref captured on mount so duration_seconds is accurate.
(Alternatively, keep `time_into_lesson_seconds` in both places—just make them identical.)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Properties: { lesson_id: string, time_into_lesson_seconds: number, last_question_index: number }
Implementation rules:
- Track lesson start time with a ref captured on mount so duration_seconds is accurate.
- Do not modify any UI.
Properties: { lesson_id: string, duration_seconds: number, last_question_index: number }
Implementation rules:
- Track lesson start time with a ref captured on mount so duration_seconds is accurate.
- Do not modify any UI.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prompts/18-more-posthog.md` around lines 20 - 25, The spec mismatches the
property name for the lesson-abandon event: change either the reference to
duration_seconds to use time_into_lesson_seconds or vice versa so both uses are
identical; update the event sending code that builds the lesson_abandoned
PostHog properties (look for the usage that references lesson_id,
last_question_index and the mount-captured start-time ref) to emit a single
consistent property name (e.g., time_into_lesson_seconds) and ensure the
ref-based duration calculation assigns to that same key.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation hasn't been added yet — currently at prompt03. Will apply the consistent naming (time_into_lesson_seconds) when the PostHog lesson_abandoned event is implemented in a later PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Retsomm, understood — thanks for the context! Since the fix is planned for a later PR, would you like me to open a GitHub issue to track the naming consistency (time_into_lesson_seconds vs duration_seconds in prompts/18-more-posthog.md) so it's not lost when you reach that implementation step?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please, that would be helpful!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@Retsomm, I've created a GitHub issue to track this — you can find it linked above once the script runs. It captures the time_into_lesson_seconds vs duration_seconds inconsistency with a reference back to this PR comment, so it'll be easy to pick up when you reach that implementation step. 🐇


🏁 Script executed:

#!/bin/bash
gh issue create \
  --repo Retsomm/react-native-lingua \
  --title "Fix lesson_abandoned event property name inconsistency: time_into_lesson_seconds vs duration_seconds" \
  --body "## Summary

In \`prompts/18-more-posthog.md\`, the \`lesson_abandoned\` event has a property name mismatch:

- **Line 20** defines the property as \`time_into_lesson_seconds\` in the event schema.
- **Line 24** references it as \`duration_seconds\` in the implementation rule about the mount-time ref.

This inconsistency should be resolved before the PostHog \`lesson_abandoned\` event is implemented (currently planned after prompt 03).

## Recommended fix

Use \`time_into_lesson_seconds\` consistently in both the event property definition and the implementation rule, so the emitted event and the ref-based duration calculation share the same key.

## References

- PR: https://github.com/Retsomm/react-native-lingua/pull/1
- Comment: https://github.com/Retsomm/react-native-lingua/pull/1#discussion_r3256438596

/cc `@Retsomm`" \
  --assignee Retsomm

Length of output: 56


@Retsomm, the issue has been created: #2 - Fix lesson_abandoned event property name inconsistency: time_into_lesson_seconds vs duration_seconds

It's assigned to you and links back to this PR comment for easy reference when you get to the PostHog implementation. 🐇 ✨

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant