feat(ai): mobile UI for Tutor + Librarian agents (AI-Agent-2/3)#400
Merged
Conversation
Expo/RN parity for the two agent UIs. Tutor "Smart session" (Vocabulary tab -> /tutor): plan view (rationale + per-item why + nudge), study via existing FlashCard from the enriched plan (no vocab re-fetch), HITL re-plan -> summary. Librarian "Ask the librarian" (Search tab -> /librarian): reasoning + ranked recs; library -> /book/[slug], open_library -> marked suggestion, no nav. Ports web hardening: mounted/abort guard, same-session feedback retry, MAX_ROUNDS=8 cap, clamped LLM text, unknown-exerciseType fallback. agents.ts (types + authFetch API + pure helpers), useTutorSession/useLibrarian hooks, TutorPlanView + librarian/* components. Strings via shared t(); colors via useTheme(); haptics/TTS wired. No new network processor. tsc clean; 52 mobile vitest green (14 new). QA: 0 blockers (book route + external no-nav both confirmed). On-device verification owed. Co-Authored-By: Claude Opus 4.8 <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.
Mobile (Expo/RN) parity for the two agent UIs shipped on web (frontend port → adversarial QA). Brings both shipped agents to full web+mobile parity.
What
/tutor: plan view (rationale + per-item exercise badge / difficulty /why+ reading nudge) → study via the existing mobileFlashCardrendered straight from the enriched plan item (no vocab re-fetch) → HITL feedback re-plan → summary./librarian: NL query → reasoning + ranked cards.libraryrecs tap through to/book/[slug];open_libraryrecs are dashed "Suggestion — not in your library yet" cards with no navigation;usedExternalnote.AbortController, same-session feedback retry,MAX_ROUNDS=8cap, clamped LLM text, unknown-exerciseTypefallback.agents.ts(DTO types +authFetchAPI + pure helpers),useTutorSession/useLibrarianhooks,TutorPlanView+librarian/*components, screensapp/tutor.tsx+app/librarian.tsx. Strings via sharedt()(keys →packages/shared/src/i18n/en.json); colors viauseTheme()(dark mode); haptics/TTS wired.QA (adversarial) — 0 blockers / 0 should-fixes
The two web→mobile regression risks confirmed correct: the library card routes to the existing
/book/[slug]with null-slug guard; external recs are plain non-navigable Views. State-machine fidelity (abort/retry/round-cap), theming, i18n keys (46 referenced, 0 missing), and the auth gate all verified.Verify
npx tsc --noEmitclean · 52 mobile vitest green (14 new pure-helper tests). No new network processor (first-party/me/tutor/*+/me/librarian; Play Data Safety unaffected).On-device verification owed (Expo Go limits)
Nav to book + back-stack, Android keyboard-avoid on the librarian input, haptics/TTS on hardware, dark mode on both screens.
Deferred
SSE streaming, external-book ingest, admin replay, tablet layout.
🤖 Generated with Claude Code