From f88780a06c8e1f4a125d528c845895b47419f9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 17 May 2026 14:27:00 +0200 Subject: [PATCH] fix(coach): gate SuggestedPrompts chips on the global Coach flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every chip in is a Coach affordance — clicking one seeds the Coach drawer's composer with the localised prompt and opens the drawer. The strip rendered unconditionally until now, so a deployment with the operator's global Coach flag off still painted five inert chips below the hero band. Read flags.coach inside the component and short-circuit when the flag is off. The HeroStrip caller already wraps the mount in the same guard (W5 commit prior); this is defence-in-depth so a future caller that mounts outside the hero band can never leak a Coach surface. --- src/components/insights/suggested-prompts.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/insights/suggested-prompts.tsx b/src/components/insights/suggested-prompts.tsx index cc05eeb9f..c29a8597a 100644 --- a/src/components/insights/suggested-prompts.tsx +++ b/src/components/insights/suggested-prompts.tsx @@ -2,6 +2,7 @@ import { Quote } from "lucide-react"; import { useTranslations } from "@/lib/i18n/context"; +import { useFeatureFlags } from "@/hooks/use-feature-flags"; import { cn } from "@/lib/utils"; /** @@ -47,6 +48,15 @@ export function SuggestedPrompts({ className, }: SuggestedPromptsProps) { const { t } = useTranslations(); + // v1.4.37 W5 — every chip is a Coach affordance: clicking one seeds + // the Coach drawer's composer and opens it. When the operator turns + // the global Coach flag off the strip must vanish along with the + // hero action button and the drawer mount. The HeroStrip caller + // already guards on `flags.coach`; the in-component gate is + // defence-in-depth so a future caller that mounts + // outside the hero band can never leak a Coach surface. + const flags = useFeatureFlags(); + if (!flags.coach) return null; const items = prompts ?? DEFAULT_PROMPT_KEYS.map((key) => t(`insights.suggestedPrompts.${key}`));