feat(medications,coach): the take-now prompt joins the schedule grammar and the coach opens in place

An open take-window renders as the right-aligned value of the next-
intake row — same label/value columns as every other card line —
instead of a standalone line above the slot; the escalation tiers
(late, very late, taken-early) keep the top line. The coach launcher
opens the side drawer on the page you are on instead of navigating to
the chat page, and grows to the standard FAB size.
This commit is contained in:
Marc-André Bombeck committed 2026-06-12 20:27:59 +02:00
1 parent 8b0fbfb522
commit 4493eb2cac
3 files changed
+51 -12

No files matched your search

+7 -5
View File
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { usePathname, useRouter } from "next/navigation";
import { usePathname } from "next/navigation";
import { useQuery } from "@tanstack/react-query";
import { Sparkles } from "lucide-react";
@@ -58,7 +58,6 @@ export function isNudgeUnread(
export function LayoutCoachFab() {
const { t } = useTranslations();
const router = useRouter();
const pathname = usePathname();
const launch = useCoachLaunch();
const flags = useFeatureFlags();
@@ -137,7 +136,10 @@ export function LayoutCoachFab() {
// Best effort — see above.
}
}
router.push("/insights/coach");
// v1.16.11 — open the side drawer in place (the launch context the
// layout mount consumes) instead of navigating to the chat page;
// the conversation arrives without losing the page underneath.
launch?.askCoach();
};
return (
@@ -157,7 +159,7 @@ export function LayoutCoachFab() {
// not `lg:` — keeps the FAB from floating mid-air 768-1023px).
// The right inset mirrors the desktop bottom inset so the
// corner gap is even.
"fixed right-6 z-40 size-12 rounded-full shadow-lg",
"fixed right-6 z-40 size-14 rounded-full shadow-lg",
"bottom-[calc(env(safe-area-inset-bottom,0px)+5rem)] md:bottom-6",
// Dark glyph on the purple/pink gradient — white sat at
// ≈2.3:1 against the gradient midpoint; the background token
@@ -185,7 +187,7 @@ export function LayoutCoachFab() {
"[body:has([data-testid=onboarding-tour])_&]:invisible",
)}
>
<Sparkles className="size-5" aria-hidden="true" />
<Sparkles className="size-6" aria-hidden="true" />
{unread ? (
<span
data-slot="coach-fab-unread"