feat(student): mobile-first lesson experience — AI chat takeover, keyboard-safe layout, UX polish#386
Merged
Merged
Conversation
- Course progress line at the top of lesson pages (tenant-themed, a11y-labeled) - Reading scroll progress under the lesson header (usehooks-ts) - Route-change progress bar via next-nprogress-bar wired to var(--primary) - Loading skeletons for course detail and lesson routes - Optimistic mark-complete with revert on error - Course-100% celebration: full-width confetti + localized toast - Arrow-key prev/next lesson navigation (@tanstack/react-hotkeys, respects sequential lock and input focus) - beforeunload guard on exam taker when answers are unsubmitted - Fix pre-existing lint errors in touched files (no-explicit-any, unescaped entity, handleSubmit declaration order) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
On mobile the lesson AI chat was a fixed-height scroll box embedded in the page scroll (nested-scroll trap), the keyboard hid the input (iOS vh bug), and the lesson shell used h-screen so the footer nav fell behind Safari's toolbar. - Chat on <sm is now a launcher card that opens a full-screen takeover (Khanmigo/Duolingo Max pattern): visualViewport-tracked height with 100dvh fallback, safe-area insets, Escape to close, dialog semantics, single mounted instance so chat state survives open/close - New AskTutorChip under lesson content: one tap opens the chat and auto-sends a localized "I don't understand" prompt - Textarea 16px on mobile (prevents iOS focus zoom) - overscroll containment on lesson + chat scroll areas (no scroll chaining or accidental pull-to-refresh) - h-screen -> h-dvh on lesson shell; footer nav gets safe-area padding and 40px+ touch targets - viewport export: interactive-widget=resizes-content + viewport-fit=cover - new lessonAIChat.mobile/contextual i18n keys (en/es) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Compile lesson MDX on the server (new serialize-lesson.ts, used by the
student lesson page and teacher preview): no in-browser MDX compiler,
no loading skeleton, no layout shift
- Reading-progress line switches to a neutral color so it can't be
confused with the primary course-progress line above the header
- Comments flow with the page instead of a nested max-h scroll box
(same scroll-trap the chat had)
- Localize hardcoded strings: lesson empty/error states, certificate
banner + toasts, completion failure toasts (en/es)
- Replace native confirm() with AlertDialog for chat restart
- Quieter completion banner: solid emerald, no blur-glow pulse
(celebration stays with the confetti), respects reduced motion
- Flatten the AI task section (task text is a plain block; the chat is
the only card)
- Sidebar: drop strike-through on completed lessons (check already
communicates it); locked-lesson CTA gets a verb ("Go to: …");
video frame ring uses border token (visible in light mode)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Pushed
Kept as-is by design: AI task stays at the end of the lesson (it validates that the student read the content). |
Replaces the native confirm() in lesson comments with the themed AlertDialog (destructive action), matching the chat-restart dialog. New deleteDialog i18n keys (en/es). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves layout.tsx import conflict (keep StoredPreset + new seo imports) and regenerates package-lock.json in sync with package.json (CI npm ci was failing on a missing webpack tree). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
npm 10 (bundled with Node 20) rejects the npm-11-generated lockfile
("Missing ... from lock file") and lint-staged@17 requires Node >=22.
Matches local dev (Node 24 / npm 11).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Local installs use legacy-peer-deps (user-level npmrc), so the lockfile omits peer-dependency trees (webpack et al). CI's default npm then fails npm ci with "Missing ... from lock file". A project .npmrc makes every environment resolve the same way. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the student lesson page actually usable on mobile. Two commits:
1. Lesson progress line + UX polish pack — thin course-progress line, reading-progress indicator, lesson scroll area, route progress bar, loading skeletons.
2. Mobile-first lesson AI chat + keyboard-safe layout — fixes the three core mobile problems: the AI chat was a fixed-height scroll box embedded inside the page scroll (nested-scroll trap), the on-screen keyboard hid the chat input (iOS
vhbug), andh-screenpushed the footer nav behind Safari's toolbar.Mobile chat: launcher → full-screen takeover
Researched how Khanmigo (mobile web), Duolingo Max, and Brilliant surface AI tutors on mobile — none embed a chat mid-page; they use contextual triggers that open a dedicated chat surface. Below
smthe chat now lives behind a launcher card ("Start/Continue with the AI Tutor", message count, green completed state) and opens as a full-screen overlay:visualViewport(iOS keyboard) with100dvhfallback — input always stays above the keyboardrole="dialog"+aria-modaloverscroll-contain— chat scroll never chains into the lesson behind itsm+) unchangedContextual tutor entry (Duolingo "Explain my answer" pattern)
New
AskTutorChipunder lesson content: one tap opens the chat (full-screen on mobile, scrolled into view on desktop) and auto-sends a localized "I don't understand this lesson" prompt. Hidden once the lesson is completed.Layout fixes
h-screen→h-dvhon the lesson shell (footer nav visible with Safari's URL bar)env(safe-area-inset-bottom)padding + 40px minimum touch targetsoverscroll-y-contain(no accidental pull-to-refresh)viewportexport:interactive-widget=resizes-content(Android keyboard resizes layout) +viewport-fit=cover(enables safe-area env vars)anys in the chat with typedUIMessage/ tool-invocation shapesi18n
New
lessonAIChat.mobile.*andlessonAIChat.contextual.*keys (en/es, plural-aware).Test plan
npm run buildgreen (compile + typecheck)🤖 Generated with Claude Code