feat(mobile): Phase 4 — compagnon 3 écrans (matin/soir/timer), désactivé par défaut - #363
Merged
Merged
Conversation
The dormant apps/mobile port still carried the seven long-tail features removed from the product in Phase 1 (#352) — three of them (Forces, Parcours de soins, Réussites) imported now-deleted validators/endpoints and would fail to build. Removed all seven to match the recentred product: - Deleted screens + hooks: Strengths, CarePathway, Achievements, Activity, Decodeur, Scripts, Burnout (8 screens + 6 hooks). - App.tsx: dropped their imports + PlusStack.Screen registrations. - navigation/types.ts: dropped their route params + prop types. - PlusMenuScreen: dropped their menu rows + now-unused icon imports. Verified by grep sweep: no remaining imports of deleted validators (Strength/CarePathwayProgress/AdminDocument), deleted hooks, removed screens, or deleted endpoints; types.ts braces balanced. apps/mobile is outside the pnpm workspace / CI and its node_modules aren't installed here, so its own `tsc` could not be run in this environment — verification is static. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
… default Implements the Phase 4 native companion the strategy calls for, reusing the port's already-built pieces (exact local notifications, session sharing, routines, timer, companions). - COMPANION_MODE flag (app.json extra.companionMode) — when true, App boots a 3-tab CompanionTabs (Matin / Soir / Timer) instead of the full port. Default: full port (the companion stays gated until the beta signal — the strategy's "build trap" guard). - Matin/Soir reuse RoutinesScreen with a new additive `timeOfDay` route filter (absent ⇒ unchanged behavior); Timer reuses TimerScreen + companions. Each tab is a self-contained stack so RoutinesScreen's navigate() targets resolve. - docs/phase4-companion.md: what's already built, how to enable, and the device-build + Play Store steps that require the Android toolchain + a Google Play account. VERIFICATION LIMIT: apps/mobile is outside the pnpm workspace/CI and its deps aren't installed here, so this is REVIEW-VERIFIED ONLY (imports resolve, braces/ parens balance, reuses existing screens) — NOT compiled. Run `pnpm --dir apps/mobile install && pnpm typecheck` then `expo run:android` on a device to validate. Store submission is a human step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
The last in-repo Phase 4 deliverable ("Fiche Play Store optimisée" from the
strategy): ready-to-paste FR listing (short/full description, ASO keywords for
"routine enfant TDAH" / "rappel routine matin enfant"), the graphics/compliance
checklist, and the medical-guardrail wording.
Everything in-repo for Phase 4 is now in place (companion code, app.json,
eas.json, notification permissions, handoff + listing docs). The remaining
steps — EAS Build, device test, Play submission — require an Expo account, a
device, and a Google Play account, all external to the repo by the adopted
architecture (docs/android-app.md).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
Installed apps/mobile deps in isolation (--ignore-workspace) and ran the real type-check: tsc --noEmit passes with 0 errors, so the Phase 4 companion compiles rather than being verified by static review only. expo-doctor surfaced one genuine defect: expo-audio requires the peer dependency expo-asset, which was missing and would crash the app outside Expo Go. Added expo-asset ~12.0.13 (SDK 54 pin). 16/18 doctor checks pass; the 2 remaining are proxy-blocked remote fetches, not project defects. Updated docs/phase4-companion.md to reflect that install + type-check are done in-repo; only device build (EAS) and Play Store submission remain, which need an Expo/Google account + a device. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
Generated by pnpm install --ignore-workspace in apps/mobile (excluded from the root workspace). Pinning the resolved tree — including the new expo-asset ~12.0.13 — keeps EAS Android builds reproducible instead of resolving fresh each time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
… route taps The companion's decisive feature — exact morning/evening local notifications — never fired: the reconciliation effect lived on HomeScreen, which the 3-tab companion never mounts. And a notification tap targeted AccueilTab/SymptomesTab, absent from CompanionTabParamList, so nothing happened. - Lift reminder reconciliation into useReminderSync(), mounted at the authed root (App.tsx) so it runs for BOTH the full port and the companion. Idempotent; same opt-ins/times. Removed the now-duplicate effect from HomeScreen. - Add companionLinking: reuses the notification data URLs (home/checkin) but routes the morning reminder to the Matin tab and the evening reminder to the Soir tab. - Document both in docs/phase4-companion.md. pnpm typecheck (apps/mobile) → 0 errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two companion usability gaps: - Routines were filtered by strict timeOfDay ===, so `noon`, `bedtime` and `anytime` routines were invisible in the 3-tab companion. Replace with a slot mapping (lib/companion-slots.ts): Matin = morning/noon/ anytime, Soir = evening/bedtime/anytime — nothing is ever hidden. - The companion has no Settings screen, so there was no way to opt into the local reminders. Add CompanionReminderToggle at the top of the Matin/Soir routine screen: one switch per half-day that flips the phone opt-in, reconciles the OS schedule, and prompts for permission. pnpm typecheck (apps/mobile) → 0 errors. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Contexte
Implémente le compagnon Android natif (Phase 4) de
docs/product-strategy.md, en réutilisant ce que le port Expo contient déjà. Désactivé par défaut — la full-app reste servie ; le compagnon reste gaté jusqu'au signal de la bêta (le « build trap » que la stratégie évite).Déjà construit dans le port (réutilisé)
src/lib/notifications.ts) : triggersDAILYde l'OS matin/soir — le différenciateur vs le web push, déjà fait.timeOfDay), timer-animal, compagnons.Livré ici
COMPANION_MODE(viaapp.jsonextra.companionMode) : quand vrai,App.tsxboote unCompanionTabsà 3 onglets — Matin / Soir / Timer — au lieu de la full-app.RoutinesScreenavec un filtretimeOfDayadditif (absent ⇒ comportement inchangé) ; Timer réutiliseTimerScreen+ compagnons. Chaque onglet est une stack autonome pour que lesnavigate()deRoutinesScreenrésolvent.docs/phase4-companion.md: ce qui existe, comment activer, et les étapes restantes (build appareil + Play Store).Le reste (journal, symptômes, rapport, abonnement) reste sur le web. App 100 % gratuite, zéro achat in-app.
✅ Vérification (mise à jour) : le code compile
Contrairement à la version initiale de ce PR, les deps mobiles ont été installées et le type-check exécuté dans l'environnement :
cd apps/mobile && pnpm install --ignore-workspace && pnpm typecheck→tsc --noEmit: 0 erreur. Le compagnon compile réellement (plus « revue statique uniquement »).expo-doctor: 16/18 OK ; les 2 restants sont des fetches distants bloqués par le proxy (schéma config Expo + RN Directory), pas des défauts.expo-asset(~12.0.13, pin SDK 54) manquait comme peer dep deexpo-audio— ajouté àpackage.json(aurait planté hors Expo Go). Seul défaut réel révélé par le type-check + doctor.Reste à faire (hors sandbox : compte Expo + compte Google + appareil)
expo run:androidsur un appareil : opt-in notifs + rappels matin/soir à l'heure exacte, complétion de routine, timer + compagnon, partage de session.eas build -p android, workflowandroid-release.ymldéjà en place) + fiche + soumission Play Store — étape humaine.🤖 Generated with Claude Code
https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8
Generated by Claude Code