Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR replaces placeholder tabs with a full lesson experience: generated starter lessons and expanded unit references, new lesson image assets, a reusable LessonCard, an AudioTeacherSession, a Learn screen with Lessons/Practice tabs, a Lesson Detail screen, and AI Teacher wiring selecting per-language lessons. ChangesLesson Learning Experience
Sequence Diagram(s)sequenceDiagram
participant User
participant LearnScreen
participant useLanguageStore
participant LessonCard
User->>LearnScreen: View Learn tab
LearnScreen->>useLanguageStore: Read selectedLanguageId
useLanguageStore-->>LearnScreen: Language ID
LearnScreen->>LearnScreen: Compute unitLessons and lesson status
LearnScreen->>LessonCard: Render with status/image
User->>LessonCard: Tap lesson
LessonCard->>User: Navigate to lesson detail
sequenceDiagram
participant Router
participant LessonDetailScreen
participant lessons
participant units
Router->>LessonDetailScreen: Route to lesson/:id
LessonDetailScreen->>lessons: Look up lesson by ID
lessons-->>LessonDetailScreen: Lesson object
LessonDetailScreen->>units: Look up unit by ID
units-->>LessonDetailScreen: Unit object
LessonDetailScreen->>LessonDetailScreen: Render hero/goals/phrases/vocab
sequenceDiagram
participant User
participant AiTeacherScreen
participant useLanguageStore
participant getTeacherLesson
participant lessons
participant AudioTeacherSession
User->>AiTeacherScreen: View AI Teacher tab
AiTeacherScreen->>useLanguageStore: Read selectedLanguageId
useLanguageStore-->>AiTeacherScreen: Language ID
AiTeacherScreen->>getTeacherLesson: Find lesson for language
getTeacherLesson->>lessons: Filter by language and mode
lessons-->>getTeacherLesson: Matching lesson
getTeacherLesson-->>AiTeacherScreen: Selected lesson
AiTeacherScreen->>AudioTeacherSession: Pass lesson and activeTabLabel
AudioTeacherSession-->>User: Render lesson content
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
components/audio-teacher-session.tsx (1)
33-37: ⚡ Quick winAvoid dynamic NativeWind class composition for metric colors.
Use inline/style values for this runtime color selection instead of interpolated class strings.
Suggested refactor
const feedbackMetrics = [ - { label: "Speaking", value: "Excellent", valueClassName: "text-[`#19D229`]" }, - { label: "Pronunciation", value: "Great", valueClassName: "text-[`#2085FF`]" }, - { label: "Grammar", value: "Good", valueClassName: "text-[`#5034FF`]" }, + { label: "Speaking", value: "Excellent", valueColor: "`#19D229`" }, + { label: "Pronunciation", value: "Great", valueColor: "`#2085FF`" }, + { label: "Grammar", value: "Good", valueColor: "`#5034FF`" }, ]; ... -<Text className={`font-poppins-semibold text-[18px] leading-[25px] ${metric.valueClassName}`}> +<Text + className="font-poppins-semibold text-[18px] leading-[25px]" + style={{ color: metric.valueColor }} +> {metric.value} </Text>As per coding guidelines, "Use StyleSheet or inline styles instead of NativeWind classes for ... dynamic styles".
Also applies to: 189-191
🤖 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 `@components/audio-teacher-session.tsx` around lines 33 - 37, The dynamic NativeWind class strings in feedbackMetrics (the array defined as feedbackMetrics with objects containing valueClassName) must be replaced with explicit inline style color values (e.g., add a color property or style object like { color: "`#19D229`" }) and the component rendering those metrics must use that style (instead of interpolating class names) to set the metric text color; do the same refactor for the other occurrence that composes classes (the rendering around the elements referenced at the other metric usage) so all runtime color selection uses inline/style values or StyleSheet entries rather than interpolated NativeWind class strings.
🤖 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/`(tabs)/learn.tsx:
- Around line 142-155: unitLessons items with status "not-started" are visually
locked but still navigate because the onPress always calls router.push; update
the rendering logic in the unitLessons.map so LessonCard does not navigate when
getLessonStatus(index) === "not-started" — either pass a disabled/locked prop to
LessonCard (e.g., locked or disabled) and let LessonCard ignore taps, or wrap
the onPress so it only calls router.push({ pathname: "/lesson/[lessonId]",
params: { lessonId: lesson.id } }) when getLessonStatus(index) !==
"not-started"; refer to unitLessons.map, LessonCard, getLessonStatus, and the
onPress/router.push call to locate and change the behavior.
In `@components/audio-teacher-session.tsx`:
- Around line 129-135: The HeaderAction icon buttons (e.g., HeaderAction
iconName="videocam" and HeaderAction iconName="notifications-outline" in
components/audio-teacher-session.tsx, and the similar HeaderAction instances
around lines 231-243) are rendered as tappable but lack onPress handlers; either
wire them to the correct action handlers (e.g., openCamera/launchVideoCall and
openNotifications/showNotifications) by passing an onPress prop to HeaderAction,
or explicitly render them non-interactive/disabled (pass a disabled prop or
replace with a non-touchable View/Text and update accessibility props) so they
don’t appear tappable. Ensure accessibilityLabel and testID are set when adding
handlers.
In `@constants/images.ts`:
- Around line 39-41: Replace the hardcoded remote string assigned to
lessonArt.cafe in constants/images.ts with a require/import of a local asset and
reference that imported symbol in the centralized images object; specifically,
add an import or require for the local cafe image at the top of
constants/images.ts (e.g., import or const cafeImage = require(...)), then
change lessonArt.cafe to use that cafeImage instead of the remote uri so all
consumers import images via the centralized images object.
In `@data/lessons.ts`:
- Around line 669-705: The createLanguageStarterSet function currently accepts
rows: string[][] and uses hard-coded numeric indices (row[0]..row[13]); change
rows to a typed shape (either a named tuple type like type LessonRow =
[title:string, description:string, term1:string, translation1:string,
pronunciation1:string, example1:string, term2:string, translation2:string,
pronunciation2:string, example2:string, phrase:string, phraseTranslation:string,
phrasePronunciation:string, phraseContext:string] or an interface/object) and
update createLanguageStarterSet to accept rows: LessonRow[] and destructure each
row into named variables (e.g., const [title, description, term1, translation1,
...] = row) before calling createStarterLesson; update usages/call sites to
produce the typed tuple/object so compile-time checks catch malformed rows and
replace all row[0]..row[13] references with the new names in
createLanguageStarterSet and any related helpers such as createStarterLesson
invocation.
---
Nitpick comments:
In `@components/audio-teacher-session.tsx`:
- Around line 33-37: The dynamic NativeWind class strings in feedbackMetrics
(the array defined as feedbackMetrics with objects containing valueClassName)
must be replaced with explicit inline style color values (e.g., add a color
property or style object like { color: "`#19D229`" }) and the component rendering
those metrics must use that style (instead of interpolating class names) to set
the metric text color; do the same refactor for the other occurrence that
composes classes (the rendering around the elements referenced at the other
metric usage) so all runtime color selection uses inline/style values or
StyleSheet entries rather than interpolated NativeWind class strings.
🪄 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: 93364474-9547-42ac-9703-872045c29496
⛔ Files ignored due to path filters (4)
assets/images/ai-teacher-fox-sweater-source.pngis excluded by!**/*.pngassets/images/ai-teacher-fox-sweater.pngis excluded by!**/*.pngassets/images/lesson-cafe-scene.pngis excluded by!**/*.pngassets/images/lesson-home-background.pngis excluded by!**/*.png
📒 Files selected for processing (8)
app/(tabs)/ai-teacher.tsxapp/(tabs)/learn.tsxapp/lesson/[lessonId].tsxcomponents/audio-teacher-session.tsxcomponents/lesson-card.tsxconstants/images.tsdata/lessons.tsdata/units.ts
Summary by CodeRabbit
New Features
Chores