From 70fe5a55c2fd20eb04c4b511ca4ea1a5675dea2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 14 May 2026 13:31:12 +0200 Subject: [PATCH] refactor(coach): drop non-functional mic icon from composer The mic was rendered + disabled with a "voice arrives with iOS" tooltip, drawing taps that did nothing. Voice input remains scheduled for the iOS client (v1.5); the web composer no longer surfaces a placeholder. Frees the row for the Enter-to-send hint to breathe. --- .../__tests__/coach-input.test.tsx | 23 +++++------ .../insights/coach-panel/coach-input.tsx | 40 ++++--------------- 2 files changed, 17 insertions(+), 46 deletions(-) diff --git a/src/components/insights/coach-panel/__tests__/coach-input.test.tsx b/src/components/insights/coach-panel/__tests__/coach-input.test.tsx index 660d8f3d5..bc9beb678 100644 --- a/src/components/insights/coach-panel/__tests__/coach-input.test.tsx +++ b/src/components/insights/coach-panel/__tests__/coach-input.test.tsx @@ -11,16 +11,17 @@ function render(node: React.ReactNode, locale: "en" | "de" = "en") { } describe("", () => { - it("mounts the textarea, mic, and send button slots", () => { + it("mounts the textarea + send button slots (mic dropped in W5)", () => { // v1.4.22 B4 — the disclaimer moved to the sources rail; the // composer no longer renders its own paragraph below the input. + // v1.4.25 W5 — the non-functional mic icon was removed. const html = render( {}} onSubmit={() => {}} />, ); expect(html).toContain('data-slot="coach-input"'); expect(html).toContain('data-slot="coach-input-textarea"'); - expect(html).toContain('data-slot="coach-input-mic"'); expect(html).toContain('data-slot="coach-input-send"'); + expect(html).not.toContain('data-slot="coach-input-mic"'); expect(html).not.toContain('data-slot="coach-input-disclaimer"'); expect(html).not.toContain("Coach replies are generated"); }); @@ -41,20 +42,16 @@ describe("", () => { expect(html).toContain("Frag mich etwas zu deinen Daten"); }); - it("disables the mic button with the v1.5 tooltip text", () => { + it("no longer renders a mic button (W5 removed the placeholder)", () => { + // v1.4.25 W5 — the mic icon used to be rendered + disabled with a + // "voice arrives with iOS" tooltip. Marc flagged it as a click- + // trap: nothing happened on tap. The composer now drops the icon + // entirely; voice input remains a v1.5 iOS feature. const html = render( {}} onSubmit={() => {}} />, ); - // The button carries both the disabled attribute and the - // localised v1.5 voice tooltip on aria-label. Attribute order is - // not guaranteed across React versions, so we check for both - // independently inside the same tag. - const micTag = html.match(/]*data-slot="coach-input-mic"[^>]*>/); - expect(micTag).not.toBeNull(); - expect(micTag?.[0]).toContain("disabled"); - expect(micTag?.[0]).toContain( - 'aria-label="Voice input arrives with the iOS app in v1.5."', - ); + expect(html).not.toMatch(/data-slot="coach-input-mic"/); + expect(html).not.toContain("Voice input arrives with the iOS app"); }); it("disables the send button when the value is empty", () => { diff --git a/src/components/insights/coach-panel/coach-input.tsx b/src/components/insights/coach-panel/coach-input.tsx index 58791024f..016a9ca0a 100644 --- a/src/components/insights/coach-panel/coach-input.tsx +++ b/src/components/insights/coach-panel/coach-input.tsx @@ -1,23 +1,17 @@ "use client"; import { type FormEvent, type KeyboardEvent, useCallback } from "react"; -import { Loader2, Mic, Send } from "lucide-react"; +import { Loader2, Send } from "lucide-react"; import { Button } from "@/components/ui/button"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; import { useTranslations } from "@/lib/i18n/context"; /** * v1.4.20 phase B2b — Coach composer. * - * `