Skip to content

feat(mobile): Phase 4 — compagnon 3 écrans (matin/soir/timer), désactivé par défaut - #363

Merged
DamienBattistella merged 7 commits into
mainfrom
claude/marketing-issue-review-0t0tdo
Jul 17, 2026
Merged

feat(mobile): Phase 4 — compagnon 3 écrans (matin/soir/timer), désactivé par défaut#363
DamienBattistella merged 7 commits into
mainfrom
claude/marketing-issue-review-0t0tdo

Conversation

@DamienBattistella

@DamienBattistella DamienBattistella commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

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é)

  • Notifications locales exactes (src/lib/notifications.ts) : triggers DAILY de l'OS matin/soir — le différenciateur vs le web push, déjà fait.
  • Partage de session (Better Auth), routines (avec timeOfDay), timer-animal, compagnons.

Livré ici

  • COMPANION_MODE (via app.json extra.companionMode) : quand vrai, App.tsx boote un CompanionTabs à 3 ongletsMatin / Soir / Timer — au lieu de la full-app.
  • Matin/Soir réutilisent RoutinesScreen avec un filtre timeOfDay additif (absent ⇒ comportement inchangé) ; Timer réutilise TimerScreen + compagnons. Chaque onglet est une stack autonome pour que les navigate() de RoutinesScreen ré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 typechecktsc --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.
  • Correctif inclus : expo-asset (~12.0.13, pin SDK 54) manquait comme peer dep de expo-audio — ajouté à package.json (aurait planté hors Expo Go). Seul défaut réel révélé par le type-check + doctor.

apps/mobile reste hors workspace pnpm racine / hors CI JS. La CI (web/api/db/validators) n'est pas impactée par ce PR mobile-only.

Reste à faire (hors sandbox : compte Expo + compte Google + appareil)

  1. expo run:android sur un appareil : opt-in notifs + rappels matin/soir à l'heure exacte, complétion de routine, timer + compagnon, partage de session.
  2. Build AAB (eas build -p android, workflow android-release.yml déjà en place) + fiche + soumission Play Store — étape humaine.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KR7VJaziMEPd87U1R717v8


Generated by Claude Code

claude and others added 7 commits July 16, 2026 16:45
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>
@DamienBattistella
DamienBattistella marked this pull request as ready for review July 17, 2026 09:03
@DamienBattistella
DamienBattistella merged commit 431cda0 into main Jul 17, 2026
3 checks passed
@DamienBattistella
DamienBattistella deleted the claude/marketing-issue-review-0t0tdo branch July 17, 2026 09:03
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.

3 participants