mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
Extract the Coach chat surface (header actions, message thread, composer, provenance rails, settings, mobile trays) into a shared <CoachConversation> component so the drawer and a new full-page route render the exact same implementation — no forked chat logic. The drawer keeps only its <Sheet> chrome (close button + maximize control); the page supplies a minimize-back-to-drawer control. The maximize control in the drawer header navigates to /insights/coach and closes the drawer (aborting any in-flight stream); the page's minimize control routes back to /insights and reopens the drawer through the shared launch context. Both surfaces preserve incremental streaming, collapsible history + provenance, the single composer disclaimer, the auto-grow composer, refusal / budget handling, and the aiMode gating — the full page redirects to /insights when the operator flag is off or the user has opted out. Lift useResettableValue / nextResettableValue into their own module so the shared surface seeds its composer from the same controlled-prefill contract without importing the drawer shell. Register the new route in the coach feature-flag and per-user-disable gate-site invariants, and add the maximize / minimize labels across all six locales.