Implement interactive learning session flows#150
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds Convex-backed learning-session content generation, answer submission, and analysis storage, plus a new session screen and related navigation. It also replaces the app’s theme tokens and updates shared UI primitives, shell navigation, auth flows, and multiple app screens to the new styling system. ChangesLearning Session Feature
Design-system Rollout
Sequence Diagram(s)sequenceDiagram
participant LearningPlanSessionsScreen
participant LearningSessionContentScreen
participant convex_learningSessionContent_ts as convex/learningSessionContent.ts
participant learningSessionContentItems
participant learningSessionAnswerAttempts
participant learningSessionAnalyses
LearningPlanSessionsScreen->>LearningSessionContentScreen: router.push("/learning-plans/{planId}/sessions/{sessionId}")
LearningSessionContentScreen->>convex_learningSessionContent_ts: ensureSessionContent(sessionId)
convex_learningSessionContent_ts->>learningSessionContentItems: insert generated items if missing
LearningSessionContentScreen->>convex_learningSessionContent_ts: getSessionContent(sessionId)
convex_learningSessionContent_ts->>learningSessionAnswerAttempts: read latest attempts
LearningSessionContentScreen->>convex_learningSessionContent_ts: submitAnswer(...)
convex_learningSessionContent_ts->>learningSessionAnswerAttempts: insert attempt
LearningSessionContentScreen->>convex_learningSessionContent_ts: finishSessionContent(sessionId)
convex_learningSessionContent_ts->>learningSessionAnalyses: upsert analysis
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@convex/learningSessionContent.test.ts`:
- Around line 86-88: The test suite in learningSessionContent.test.ts sets a
mocked clock with vi.setSystemTime in beforeEach, but never restores the real
timers, so the fake time can leak into later tests. Add a cleanup hook such as
afterEach or afterAll that calls vi.useRealTimers() to reset the timer state and
keep the suite isolated, using the existing beforeEach test setup as the place
to balance this behavior.
In `@convex/learningSessionContent.ts`:
- Around line 593-600: `finishSessionContent` is passing raw
`learningSessionAnswerAttempts` into `buildAnalysis`, which can double-count
retries and skew the analysis. Update this path to use the same latest-per-item
behavior as `getSessionContent` by reusing `getLatestAttempts` or deduping
attempts by `itemId` before calling `buildAnalysis`, so the `attemptedCount` and
strength/gap calculations are based only on the most recent attempt for each
item.
In `@src/app/`(app)/home.tsx:
- Around line 1203-1228: The sheet header in home.tsx is using a fixed
text-column width that can overflow beside CloseButton. Update the header layout
around the text block and CloseButton so the title/subtitle container flexes to
available space instead of using the hardcoded 311 * modalScale width, keeping
the close control visible and preventing clipping on narrow devices.
In `@src/app/entry/new.tsx`:
- Around line 152-156: The pill text in HomeworkPillField is using the same
muted style for both placeholders and actual values, so populated fields look
unset. Update the Text styling in the value/placeholder rendering path so real
values in HomeworkPillField stay high-contrast like the selected
subject/exam-type triggers, while placeholders remain muted. Use the existing
value/placeholder conditional around Text to apply different text colors based
on whether value is present.
🪄 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
Run ID: d97ac5d3-b6ea-47e7-a086-e1c8e68cb14d
⛔ Files ignored due to path filters (7)
convex/_generated/api.d.tsis excluded by!**/_generated/**docs/pr/issue-133/01-lernkarten-front.pngis excluded by!**/*.pngdocs/pr/issue-133/02-lernkarten-answer.pngis excluded by!**/*.pngdocs/pr/issue-133/03-voice-transcript-fallback.pngis excluded by!**/*.pngdocs/pr/issue-133/04-wissensanalyse.pngis excluded by!**/*.pngdocs/pr/issue-133/issue-133-voice-flow.mp4is excluded by!**/*.mp4pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (64)
README.mdapp.config.tsbiome.jsonccomponents.jsonconvex/learningPlanAi.tsconvex/learningSessionContent.test.tsconvex/learningSessionContent.tsconvex/schema.tsdocs/contexts/design-system/CONTEXT.mddocs/contexts/product/CONTEXT.mddocs/styling.mdpackage.jsonsrc/app/(app)/_layout.tsxsrc/app/(app)/home.tsxsrc/app/(app)/learning-plans.tsxsrc/app/(app)/plans.tsxsrc/app/(app)/settings.tsxsrc/app/(auth)/index.tsxsrc/app/(auth)/onboarding.tsxsrc/app/_layout.tsxsrc/app/entry/[id].tsxsrc/app/entry/new.tsxsrc/app/learning-plans/[planId]/analysis.tsxsrc/app/learning-plans/[planId]/generating.tsxsrc/app/learning-plans/[planId]/index.tsxsrc/app/learning-plans/[planId]/quiz/[questionIndex].tsxsrc/app/learning-plans/[planId]/review.tsxsrc/app/learning-plans/[planId]/sessions/[sessionId]/edit.tsxsrc/app/learning-plans/[planId]/sessions/[sessionId]/index.tsxsrc/app/learning-plans/new.tsxsrc/app/learning-times/edit.tsxsrc/app/learning-times/index.tsxsrc/app/notification-settings.tsxsrc/app/notifications.tsxsrc/app/profile.tsxsrc/components/AuthScreen.tsxsrc/components/Mascot.tsxsrc/components/bottom-nav.tsxsrc/components/notification-button.tsxsrc/components/screen-header.tsxsrc/components/ui/action-modal.tsxsrc/components/ui/button.tsxsrc/components/ui/close-button.tsxsrc/components/ui/date-time-picker-sheet.tsxsrc/components/ui/field.tsxsrc/components/ui/input.tsxsrc/components/ui/list-row.tsxsrc/components/ui/screen.tsxsrc/components/ui/section-header.tsxsrc/components/ui/select-sheet.tsxsrc/components/ui/surface.tsxsrc/components/ui/switch.android.tsxsrc/components/ui/text-field.tsxsrc/components/ui/text.tsxsrc/components/ui/textarea.tsxsrc/features/learning-plans/learning-plan-ui.tsxsrc/features/learning-plans/quiz-step.tsxsrc/features/learning-plans/types.tssrc/global.csssrc/lib/design-system.tssrc/lib/theme.tssrc/lib/utils.tstailwind.config.jstailwind.config.ts
💤 Files with no reviewable changes (2)
- src/app/(app)/_layout.tsx
- tailwind.config.js
# Conflicts: # src/app/learning-plans/[planId]/index.tsx
…e-133-learning-sessions # Conflicts: # src/app/learning-plans/[planId]/index.tsx
…e-133-learning-sessions
Summary
Closes #133.
This PR implements the issue #133 learning-session experience end to end: generated session content is persisted once per session, learners move through design-system-aligned
Theorie,Üben, andPraxisflows, voice answers use Nitro Speech on device, and Üben/Praxis produce a post-sessionWissensanalyse.Relevant context:
docs/pr/issue-133/so the screenshots/video stay attached to this branch.What changed
learningSessionContentItemslearningSessionAnswerAttemptslearningSessionAnalysesensureSessionContent,getSessionContent,submitAnswer, andfinishSessionContentmutations/queries with auth checks and owner validation.TheorieÜbenPraxis/learning-plans/[planId]/sessions/[sessionId].Theorie,Üben, andPraxis.Wissensanalysewith strengths, gaps, and recommendations.react-native-nitro-speechandreact-native-nitro-modulesfor on-device iOS speech recognition.Why Nitro Speech
The Confluence voice doc explicitly recommends
react-native-nitro-speechas the first option because it can use Apple's modern speech stack on iOS 26+, supports the legacy fallback path, and keeps raw audio out of JS. This PR follows that direction instead of the oldexpo-speech-recognitionapproach.One Expo-specific note: I did not keep a
newArchEnabledflag inapp.config.ts. Expo SDK 56 is already New Architecture-only, so the old flag is unnecessary.Screenshots
Video
Voice answer flow, simulator fallback, transcript entry, submit, and feedback:
https://github.com/Dayova/dayova-mvp/blob/codex/issue-133-learning-sessions/docs/pr/issue-133/issue-133-voice-flow.mp4
Verification
Automated checks run:
corepack pnpm exec tsc --noEmitcorepack pnpm run format:checkcorepack pnpm run lintcorepack pnpm exec vitest rungit diff --checkcorepack pnpm convex dev --onceEXPO_NO_TELEMETRY=1 corepack pnpm expo run:ios --device A8BB438B-B4B0-4EF8-85DE-A701AC8EFEE6coderabbit review --agent -t uncommitted -c AGENTS.mdManual simulator checks performed on iPhone 17 Pro / iOS 26.5:
Lernkarten.Wissensanalyse.Known verification note:
react-native-nitro-speechdirectly.Notes for reviewers
dayEntries.executionStatuswidening because the dev deployment already had that field in live documents.v24.17.0while the project engine requests>=22 <24; checks still passed.Summary by CodeRabbit
New Features
Bug Fixes
Documentation