From fb4037ed9681461e9e44fe4f8f4e54d18929fdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 4 Jun 2026 15:26:40 +0200 Subject: [PATCH] fix(coach): tidy the message thread type scale, bubble width and empty state Lift the disclaimer and feedback-thanks lines off the off-scale 10px size onto the standard extra-small step. Unify the user and assistant row gap, and budget the avatar column out of the bubble's 80% cap so a bubble plus its avatar never overflow a comfortable width on a narrow phone. Announce the empty-thread hero as a polite live region so screen readers read the hint when the thread first mounts. --- .../coach-panel/__tests__/message-thread.test.tsx | 12 ++++++++++++ .../insights/coach-panel/message-thread.tsx | 15 ++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/components/insights/coach-panel/__tests__/message-thread.test.tsx b/src/components/insights/coach-panel/__tests__/message-thread.test.tsx index 5f064674e..f975defab 100644 --- a/src/components/insights/coach-panel/__tests__/message-thread.test.tsx +++ b/src/components/insights/coach-panel/__tests__/message-thread.test.tsx @@ -103,6 +103,18 @@ describe("", () => { ); }); + it("announces the empty-thread hero as a polite live region", () => { + // v1.11.3 D5 — the bespoke empty-state hero stays (gradient avatar), + // but it must carry `role="status"` + `aria-live="polite"` so screen + // readers announce the hint when the thread first mounts. + const html = render(); + const threadTag = html.match( + /]*data-slot="coach-message-thread"[^>]*>/, + ); + expect(threadTag?.[0]).toContain('role="status"'); + expect(threadTag?.[0]).toContain('aria-live="polite"'); + }); + it("renders user + assistant bubbles for a persisted conversation", () => { const html = render(); expect(html).toContain('data-slot="coach-bubble-user"'); diff --git a/src/components/insights/coach-panel/message-thread.tsx b/src/components/insights/coach-panel/message-thread.tsx index 684ee151f..1affe9681 100644 --- a/src/components/insights/coach-panel/message-thread.tsx +++ b/src/components/insights/coach-panel/message-thread.tsx @@ -236,6 +236,8 @@ export function MessageThread({ return (
{t("insights.coach.composerDisclaimer")}

@@ -371,12 +373,15 @@ function ChatBubble({ return (
@@ -438,7 +443,7 @@ function ChatBubble({ )}
-
+
{t("insights.coach.feedbackThanks")}