Skip to content

Implement interactive learning session flows#150

Merged
FleetAdmiralJakob merged 5 commits into
release-v-1.0.3from
codex/issue-133-learning-sessions
Jun 27, 2026
Merged

Implement interactive learning session flows#150
FleetAdmiralJakob merged 5 commits into
release-v-1.0.3from
codex/issue-133-learning-sessions

Conversation

@FleetAdmiralJakob

@FleetAdmiralJakob FleetAdmiralJakob commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

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, and Praxis flows, voice answers use Nitro Speech on device, and Üben/Praxis produce a post-session Wissensanalyse.

Relevant context:

What changed

  • Added Convex-backed session content persistence:
    • learningSessionContentItems
    • learningSessionAnswerAttempts
    • learningSessionAnalyses
  • Added ensureSessionContent, getSessionContent, submitAnswer, and finishSessionContent mutations/queries with auth checks and owner validation.
  • Added deterministic generated session items so content is created once per session and reused across navigation/retries.
  • Added mixed session item types:
    • learn cards for Theorie
    • multiple-choice, written, and voice tasks for Üben
    • timed mixed tasks for Praxis
  • Implemented the new session route at /learning-plans/[planId]/sessions/[sessionId].
  • Aligned user-facing phase language to Theorie, Üben, and Praxis.
  • Added post-session Wissensanalyse with strengths, gaps, and recommendations.
  • Integrated react-native-nitro-speech and react-native-nitro-modules for on-device iOS speech recognition.
  • Added iOS speech and microphone permission strings.
  • Added an iOS Simulator fallback for voice tasks because the iOS 26.5 simulator crashes inside CoreAudio when real capture starts; physical iPhones keep the Nitro Speech path, while simulator runs use editable transcript entry for safe verification.
  • Updated product context docs with the new learning-session language and voice-answer expectations.

Why Nitro Speech

The Confluence voice doc explicitly recommends react-native-nitro-speech as 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 old expo-speech-recognition approach.

One Expo-specific note: I did not keep a newArchEnabled flag in app.config.ts. Expo SDK 56 is already New Architecture-only, so the old flag is unnecessary.

Screenshots

Lernkarten front Lernkarten answer
Lernkarten front Lernkarten answer
Voice transcript fallback Wissensanalyse
Voice transcript fallback Wissensanalyse

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 --noEmit
  • corepack pnpm run format:check
  • corepack pnpm run lint
  • corepack pnpm exec vitest run
    • 19 test files passed
    • 75 tests passed
  • git diff --check
  • corepack pnpm convex dev --once
  • EXPO_NO_TELEMETRY=1 corepack pnpm expo run:ios --device A8BB438B-B4B0-4EF8-85DE-A701AC8EFEE6
    • native iOS build succeeded with 0 errors
  • coderabbit review --agent -t uncommitted -c AGENTS.md
    • CodeRabbit raised 0 issues

Manual simulator checks performed on iPhone 17 Pro / iOS 26.5:

  • Theory session opens as Lernkarten.
  • Lernkarte flips from question/front to answer/back.
  • Theory completion card renders correctly.
  • Üben session renders multiple-choice tasks.
  • Written answer tasks submit and show feedback.
  • Voice task renders the microphone/transcript UI.
  • Simulator voice fallback avoids the native CoreAudio crash and allows transcript entry.
  • Voice transcript submits through the normal answer attempt path and shows feedback.
  • Üben completion leads to Wissensanalyse.
  • Deep links reuse persisted generated content instead of regenerating session items.

Known verification note:

  • Actual microphone capture cannot be meaningfully completed inside the iOS simulator because the simulator aborts in CoreAudio after permissions are granted. This PR verifies the Nitro Speech permission path and guards simulator capture; real device capture uses react-native-nitro-speech directly.

Notes for reviewers

  • The media files are committed only to make this PR self-contained and reviewable.
  • The Convex schema intentionally includes an optional dayEntries.executionStatus widening because the dev deployment already had that field in live documents.
  • Local command output repeatedly warned that the current Node runtime is v24.17.0 while the project engine requests >=22 <24; checks still passed.

Summary by CodeRabbit

  • New Features

    • Added a new learning session experience with cards, answer input, voice responses, and session analysis.
    • Added microphone and speech-recognition permission prompts on iOS.
    • Introduced a new close button and improved navigation to notifications and session screens.
  • Bug Fixes

    • Updated learning plan labels and session phase wording for consistency.
    • Improved UI consistency across screens with the latest design tokens and styling.
  • Documentation

    • Added notes clarifying current dark mode status and styling guidance.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f596bb69-7eef-4b55-afb3-5d73c8e6f9b6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The 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.

Changes

Learning Session Feature

Layer / File(s) Summary
Session contracts
convex/schema.ts, src/features/learning-plans/types.ts, convex/learningPlanAi.ts, src/features/learning-plans/learning-plan-ui.tsx, docs/contexts/product/CONTEXT.md
Session phase validators, session content/analysis types, and rehearsal/praxis naming are updated together.
Convex session backend
convex/learningSessionContent.ts
Session content generation, answer submission, latest-attempt lookup, and analysis upsert logic are implemented behind ownership checks.
Session list and detail flow
app.config.ts, package.json, src/app/learning-plans/[planId]/index.tsx, src/app/learning-plans/[planId]/sessions/[sessionId]/index.tsx
The session list opens the detail route, the new detail screen submits answers and voice transcripts, and voice permissions and Nitro dependencies are added for the runtime flow.
Convex session tests
convex/learningSessionContent.test.ts
Vitest coverage checks session item generation reuse, answer rating, analysis creation, and analysis reuse.

Design-system Rollout

Layer / File(s) Summary
Theme tokens
src/global.css, src/lib/design-system.ts, src/lib/theme.ts, src/lib/utils.ts, docs/contexts/design-system/CONTEXT.md
Light theme variables, design-system tokens, the navigation theme, text merge settings, and the design-system context document are updated together.
Tailwind docs and config
README.md, docs/styling.md, biome.jsonc, components.json, tailwind.config.js, tailwind.config.ts
Tailwind config files, include settings, and styling docs move to the TypeScript config and semantic text-role terminology.
Shared primitives
src/components/ui/button.tsx, src/components/ui/close-button.tsx, src/components/ui/action-modal.tsx, src/components/ui/surface.tsx, src/components/ui/text.tsx, src/components/ui/screen.tsx, src/components/ui/list-row.tsx, src/components/ui/section-header.tsx, src/components/ui/field.tsx, src/components/ui/input.tsx, src/components/ui/textarea.tsx, src/components/ui/text-field.tsx, src/components/ui/select-sheet.tsx, src/components/ui/date-time-picker-sheet.tsx, src/components/ui/switch.android.tsx
Buttons, close controls, surfaces, text, rows, headers, screen wrappers, and shared selection primitives move to class-based theme styling.
Shell and navigation chrome
src/app/_layout.tsx, src/app/(app)/_layout.tsx, src/components/bottom-nav.tsx, src/components/notification-button.tsx, src/components/screen-header.tsx
The root layout, tab layout, bottom navigation, notification button, and screen header use the new theme and spacing tokens.
Auth and onboarding
src/app/(auth)/*, src/components/AuthScreen.tsx
Auth choice, onboarding, and verification screens update their layout, chips, inputs, and helper copy to the new palette and text tokens.
Home and overview screens
src/app/(app)/home.tsx, src/app/(app)/learning-plans.tsx, src/app/(app)/plans.tsx, src/app/(app)/settings.tsx
Home, learning-plans, plans, and settings screens switch to the shared background, spacing, and text tokens, and the plans notifications button routes to the notifications screen.
Entry, time, and notification screens
src/app/entry/*, src/app/learning-times/*, src/app/notification-settings.tsx, src/app/notifications.tsx, src/app/profile.tsx, src/components/Mascot.tsx
Entry, time, notification, profile, and mascot views update their colors, typography, loading states, and icon accents.
Learning-plan editor screens
src/app/learning-plans/new.tsx, src/app/learning-plans/[planId]/analysis.tsx, src/app/learning-plans/[planId]/generating.tsx, src/app/learning-plans/[planId]/review.tsx, src/app/learning-plans/[planId]/quiz/[questionIndex].tsx, src/app/learning-plans/[planId]/sessions/[sessionId]/edit.tsx, src/features/learning-plans/*
Learning-plan creation, analysis, review, quiz, and edit screens plus shared editor components move to the new palette and text scale.

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
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Dayova/dayova-mvp#127: Updates the same design-system primitives, theme tokens, and app screen styling surfaces touched throughout this PR.
  • Dayova/dayova-mvp#89: Changes convex/learningPlanAi.ts session normalization logic on the same learning-plan generation path.
  • Dayova/dayova-mvp#123: Modifies src/features/learning-plans/quiz-step.tsx, which is also restyled here.

Suggested labels

ready-for-agent

Suggested reviewers

  • Gamius00

Poem

🐰 I hopped through tokens, bright and neat,
and found new screens with softer heat.
The sessions learn, the voices sing,
with Praxis tucked in everything.
Hop hop — the UI blooms this spring!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also includes broad app-wide styling and theme refactors across unrelated screens, which go beyond the learncard/question feature. Split global design-system and styling cleanup into a separate PR, or restrict this PR to the learning-session feature files.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: implementing interactive learning session flows.
Linked Issues check ✅ Passed The PR adds persisted learncards/questions, session routing, answer submission, analysis, and voice support, matching issue #133.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-133-learning-sessions

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7926665 and 28a4b05.

⛔ Files ignored due to path filters (7)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
  • docs/pr/issue-133/01-lernkarten-front.png is excluded by !**/*.png
  • docs/pr/issue-133/02-lernkarten-answer.png is excluded by !**/*.png
  • docs/pr/issue-133/03-voice-transcript-fallback.png is excluded by !**/*.png
  • docs/pr/issue-133/04-wissensanalyse.png is excluded by !**/*.png
  • docs/pr/issue-133/issue-133-voice-flow.mp4 is excluded by !**/*.mp4
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (64)
  • README.md
  • app.config.ts
  • biome.jsonc
  • components.json
  • convex/learningPlanAi.ts
  • convex/learningSessionContent.test.ts
  • convex/learningSessionContent.ts
  • convex/schema.ts
  • docs/contexts/design-system/CONTEXT.md
  • docs/contexts/product/CONTEXT.md
  • docs/styling.md
  • package.json
  • src/app/(app)/_layout.tsx
  • src/app/(app)/home.tsx
  • src/app/(app)/learning-plans.tsx
  • src/app/(app)/plans.tsx
  • src/app/(app)/settings.tsx
  • src/app/(auth)/index.tsx
  • src/app/(auth)/onboarding.tsx
  • src/app/_layout.tsx
  • src/app/entry/[id].tsx
  • src/app/entry/new.tsx
  • src/app/learning-plans/[planId]/analysis.tsx
  • src/app/learning-plans/[planId]/generating.tsx
  • src/app/learning-plans/[planId]/index.tsx
  • src/app/learning-plans/[planId]/quiz/[questionIndex].tsx
  • src/app/learning-plans/[planId]/review.tsx
  • src/app/learning-plans/[planId]/sessions/[sessionId]/edit.tsx
  • src/app/learning-plans/[planId]/sessions/[sessionId]/index.tsx
  • src/app/learning-plans/new.tsx
  • src/app/learning-times/edit.tsx
  • src/app/learning-times/index.tsx
  • src/app/notification-settings.tsx
  • src/app/notifications.tsx
  • src/app/profile.tsx
  • src/components/AuthScreen.tsx
  • src/components/Mascot.tsx
  • src/components/bottom-nav.tsx
  • src/components/notification-button.tsx
  • src/components/screen-header.tsx
  • src/components/ui/action-modal.tsx
  • src/components/ui/button.tsx
  • src/components/ui/close-button.tsx
  • src/components/ui/date-time-picker-sheet.tsx
  • src/components/ui/field.tsx
  • src/components/ui/input.tsx
  • src/components/ui/list-row.tsx
  • src/components/ui/screen.tsx
  • src/components/ui/section-header.tsx
  • src/components/ui/select-sheet.tsx
  • src/components/ui/surface.tsx
  • src/components/ui/switch.android.tsx
  • src/components/ui/text-field.tsx
  • src/components/ui/text.tsx
  • src/components/ui/textarea.tsx
  • src/features/learning-plans/learning-plan-ui.tsx
  • src/features/learning-plans/quiz-step.tsx
  • src/features/learning-plans/types.ts
  • src/global.css
  • src/lib/design-system.ts
  • src/lib/theme.ts
  • src/lib/utils.ts
  • tailwind.config.js
  • tailwind.config.ts
💤 Files with no reviewable changes (2)
  • src/app/(app)/_layout.tsx
  • tailwind.config.js

Comment thread convex/learningSessionContent.test.ts
Comment thread convex/learningSessionContent.ts Outdated
Comment thread src/app/(app)/home.tsx
Comment thread src/app/entry/new.tsx
# Conflicts:
#	src/app/learning-plans/[planId]/index.tsx
@FleetAdmiralJakob
FleetAdmiralJakob changed the base branch from main to release-v-1.0.3 June 27, 2026 08:59
Jakob Rössner added 3 commits June 27, 2026 13:20
@FleetAdmiralJakob
FleetAdmiralJakob merged commit 21d056f into release-v-1.0.3 Jun 27, 2026
1 check passed
@FleetAdmiralJakob
FleetAdmiralJakob deleted the codex/issue-133-learning-sessions branch June 27, 2026 15:46
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.

Create Questions and Learncards

1 participant