Skip to content

Fix resumable learning-plan creation flow#242

Open
FleetAdmiralJakob wants to merge 12 commits into
mainfrom
codex/day-169-learning-plan-creation-resume
Open

Fix resumable learning-plan creation flow#242
FleetAdmiralJakob wants to merge 12 commits into
mainfrom
codex/day-169-learning-plan-creation-resume

Conversation

@FleetAdmiralJakob

@FleetAdmiralJakob FleetAdmiralJakob commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • include questionsReady plans in the overview and render them above created plans under In Erstellung
  • show Noch nicht erstellt and exact creation progress such as 1 von 5 Fragen beantwortet, without generated-plan metrics
  • resume at the first unanswered question, or restart generation when all five answers were saved before an interruption
  • restore saved answers when moving backward
  • unify header Back, Android system Back, and iOS edge-swipe behavior
  • require the shared design-system pause sheet on question 1
  • collapse the navigation stack when choosing Später fortsetzen, with a once-only exit guard

PR #300 / SDK 57

This branch is rebased on merged PR #300 and does not contain the earlier custom runtime-theme workaround. The shared SDK 57 theme architecture from #300 is the source of truth. The feature was reverified against that merged implementation in dark appearance on iOS and Android.

The branch is also rebased on PR #305's Node 24 toolchain baseline.

Validation

  • Node 24.17.0 / pnpm 10.25.0
  • pnpm test34 files / 156 tests passed
  • pnpm check — Biome, ESLint, and TypeScript passed
  • pnpm format:check — passed
  • pnpm check:unused — passed
  • git diff --check — passed
  • APP_VARIANT=development pnpm exec expo install --check — dependencies aligned
  • Expo Doctor — 20/20 checks passed
  • clean SDK 57 native iOS build — passed
  • SDK 57 native Android build — passed
  • Matt Pocock Standards review — 0 findings
  • Matt Pocock Spec review against DAY-169/DAY-170 — 0 findings
  • all inline GitHub review threads — resolved
  • CodeRabbit CLI completed one full pass with 2 issues; the unavailable-progress fallback was fixed, and the proposed unbounded Convex read was rejected in favor of the repository-required bounded exact reads. The final hosted incremental review completed successfully at this head with no new actionable threads; the CodeRabbit check is green.

Mobile evidence

Unfinished creation Pause confirmation
iOS dark iOS dark unfinished learning-plan creation card iOS dark pause confirmation
Android dark Android dark unfinished learning-plan creation card Android dark pause confirmation

Recording audit

  • iOS — Coverage: 42.50-second video; 42 full-timeline frames sampled at 1 fps (1-second interval); 3 contact sheet(s); no audio stream.
    • 00:08 question 2; 00:18 restored answer on question 1; 00:24 pause sheet; 00:34 unchanged 1-of-5 card
  • Android SDK 57 — Coverage: 16.76-second video; 34 full-timeline frames sampled at 2 fps (0.5-second interval); 3 contact sheet(s); no audio stream.
    • 00:11 question 2; 00:13 restored answer on question 1; 00:14 pause sheet; 00:16.5 unchanged 1-of-5 card

Sampling resolves the demonstrated transitions to 1-second granularity on iOS and 0.5-second granularity on Android; neither recording contains audio.

Generation interruption audit

The generation screen can be left or the app can close, while an already accepted Convex action may still finish server-side. If the request never starts or fails, the plan remains questionsReady; the 5-of-5 card now routes back to generation.

Durable generation state, leases, and idempotency remain intentionally separate in #243. Reminder notifications remain separate in #244.

Tracker

Closes #221
Closes #222

Summary by CodeRabbit

  • New Features
    • Learning plans now include an “In Erstellung” section with question progress and resume actions.
    • Resume navigation returns to the first unanswered question, or continues generation when all questions are done.
    • Plan creation can be paused and resumed later; back navigation and iOS swipe gestures are consistent across the creation flow.
  • Bug Fixes
    • Learning-plan overviews now reliably show unfinished progress using the latest saved answers and correct visibility.
    • Plan listing now displays only completed (accepted) learning plans where applicable.
  • Documentation / Chores
    • Updated terminology for the pre-plan/creation flow and added theme tooling checks/generation.

@linear-code

linear-code Bot commented Jul 15, 2026

Copy link
Copy Markdown

DAY-169

DAY-170

DAY-213

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Learning plan creation flow

Layer / File(s) Summary
Creation overview data
convex/learningPlans.ts, convex/learningPlans.test.ts
listOverview includes accepted and unfinished plans, calculates saved-answer progress, and tests ownership, stale answers, completion, and list coverage.
Creation overview state
src/features/learning-plans/creation-overview.ts, src/features/learning-plans/creation-overview.test.ts
Typed state derives creation labels and resume targets for questions, generation, loading, and accepted-plan states.
Grouped learning plan presentation
src/app/(app)/learning-plans.tsx, src/app/(app)/plans.tsx, docs/contexts/product/CONTEXT.md
Creation and accepted plans render in separate sections, creation cards route to the appropriate resume target, and product terminology documents the setup flow.
Pause-aware quiz navigation
src/features/learning-plans/creation-navigation.ts, src/features/learning-plans/creation-navigation.test.ts, src/app/learning-plans/[planId]/quiz/[questionIndex].tsx
Back actions support previous-question navigation, pause confirmation, continuation later, and iOS swipe handling.

iOS appearance observation

Layer / File(s) Summary
Key-window observation lifecycle
modules/dayova-system-appearance/ios/DayovaSystemAppearanceModule.swift, src/lib/ios-appearance-module.test.ts, modules/dayova-system-appearance/README.md, docs/contexts/mobile-app/adr/...
Appearance observation now retries on key-window changes, refreshes on activation, and centralizes observer cleanup and lifecycle handling.

Validation analytics

Layer / File(s) Summary
Fail-open validation capture
src/lib/analytics.ts, src/lib/analytics-policy.test.ts, docs/contexts/platform/CONTEXT.md
Validation events are captured before best-effort activity marking, which no longer blocks the capture flow.

Theme variable validation

Layer / File(s) Summary
Generated theme variable pipeline
scripts/generate-theme-variables.mjs, package.json, tests/package-scripts.test.ts, src/lib/theme-variables.ts, src/lib/theme-css.test.ts, docs/styling.md
Dark theme variables are generated from .dark:root, checked for staleness, and included in the aggregate project check.
Runtime theme variable wiring
src/app/_layout.tsx
NativeWind runtime variables are passed through the root view’s style prop.

Mobile dependency guidance

Layer / File(s) Summary
Expo dependency guidance
docs/contexts/mobile-app/CONTEXT.md
Documentation records that expo-constants remains a direct dependency for Expo Router native peer requirements.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant QuizScreen
  participant CreationNavigation
  participant ActionModal
  participant LearningPlansScreen
  User->>QuizScreen: press back or swipe right
  QuizScreen->>CreationNavigation: resolve back intent
  CreationNavigation-->>QuizScreen: previous question or pause confirmation
  QuizScreen->>ActionModal: display pause options
  User->>ActionModal: choose continue later
  ActionModal->>LearningPlansScreen: navigate to learning plans
Loading

Possibly related PRs

  • Dayova/dayova-mvp#87: Both changes modify validation analytics capture and activity-marking behavior in src/lib/analytics.ts.
  • Dayova/dayova-mvp#271: Both changes modify learning-plan screens and quiz routing components.

Suggested reviewers: gamius00

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes large unrelated changes in theme, analytics, docs, and creation-overview code beyond quiz back navigation. Remove the unrelated theme, analytics, and docs updates from this PR or split them into separate changesets.
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
Linked Issues check ✅ Passed The quiz screen now supports going back and shows the pause-confirmation flow, matching #221.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making learning-plan creation resumable with restored progress and back-navigation handling.
✨ 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 codex/day-169-learning-plan-creation-resume

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0019300de9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/(app)/learning-plans.tsx

@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: 1

🤖 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 `@src/app/learning-plans/`[planId]/quiz/[questionIndex].tsx:
- Around line 165-177: Update the backSwipeGesture definition to constrain
recognition with a left-edge hitSlop of 28 pixels. Remove the absolute left-edge
overlay View from the root layout, and wrap the root View returned by the screen
component with GestureDetector using backSwipeGesture; keep the existing non-iOS
disabled behavior unchanged.
🪄 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: e740518a-27fa-41af-9738-fd9c410ac2ee

📥 Commits

Reviewing files that changed from the base of the PR and between df43430 and 0019300.

⛔ Files ignored due to path filters (6)
  • docs/evidence/day-169/android-pause-confirmation.png is excluded by !**/*.png
  • docs/evidence/day-169/android-resume-flow.mp4 is excluded by !**/*.mp4
  • docs/evidence/day-169/android-unfinished-card.png is excluded by !**/*.png
  • docs/evidence/day-169/ios-pause-confirmation.png is excluded by !**/*.png
  • docs/evidence/day-169/ios-resume-flow.mp4 is excluded by !**/*.mp4
  • docs/evidence/day-169/ios-unfinished-card.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • convex/learningPlans.test.ts
  • convex/learningPlans.ts
  • docs/contexts/product/CONTEXT.md
  • src/app/(app)/learning-plans.tsx
  • src/app/(app)/plans.tsx
  • src/app/learning-plans/[planId]/quiz/[questionIndex].tsx
  • src/features/learning-plans/creation-navigation.test.ts
  • src/features/learning-plans/creation-navigation.ts
  • src/features/learning-plans/creation-overview.test.ts
  • src/features/learning-plans/creation-overview.ts

Comment thread src/app/learning-plans/[planId]/quiz/[questionIndex].tsx Outdated
@FleetAdmiralJakob

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Gamius00

Copy link
Copy Markdown
Member

Working in Darkmode?

@Gamius00 Gamius00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please clarify if its working in darkmode

Copy link
Copy Markdown
Collaborator Author

@Gamius00 Yes — and your question uncovered a real runtime-theme issue that is now fixed in c78cbf4.

The React theme context and native-only colors could switch to dark while semantic NativeWind variables remained on the light palette. The root theme provider now applies an explicit runtime light/dark variable scope, so the same semantic colors update consistently across the shared iOS/Android tree.

I verified the relevant flow hands-on in dark appearance on iOS:

  • unfinished creation remains under In Erstellung
  • Noch nicht erstellt stays explicit
  • exact progress remains readable (1 von 5 Fragen beantwortet)
  • resume opens question 2 and restores the saved answer on question 1
  • the pause confirmation renders correctly and Später fortsetzen returns once to Lernpläne

Evidence:

The runtime-scope fix lives in the shared theme provider used by both native platforms.

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@FleetAdmiralJakob
FleetAdmiralJakob force-pushed the codex/day-169-learning-plan-creation-resume branch from c78cbf4 to 005337c Compare July 20, 2026 18:05

Copy link
Copy Markdown
Collaborator Author

@Gamius00 Update after PR #300 merged: I rebased this branch onto #300 and removed the temporary feature-branch theme workaround mentioned in my earlier reply. Dark mode now comes entirely from #300’s shared SDK 57 theme architecture.

I reverified this exact flow in dark appearance on both platforms after the rebase: the In Erstellung card, Noch nicht erstellt, exact 1 von 5 Fragen beantwortet progress, restored answer, and the shared pause sheet all render correctly. The refreshed iOS/Android screenshots and Android SDK 57 recording are embedded in the PR description.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Gamius00

Copy link
Copy Markdown
Member

solve merge conflicts

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

Labels

None yet

Projects

None yet

2 participants