diff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx index da3bf75cf0..54b35ea9da 100644 --- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx +++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx @@ -508,6 +508,20 @@ describe('AIChat', () => { expect(screen.queryByTitle('Collapse Pulse Assistant')).not.toBeInTheDocument(); expect(screen.getByLabelText('Close Pulse Assistant')).toBeInTheDocument(); }); + + it('keeps the phone close button outside the scrollable assistant header actions', () => { + setViewportWidth(375); + renderChat(); + + const closeButton = screen.getByRole('button', { name: 'Close Pulse Assistant' }); + const headerActions = screen.getByTestId('assistant-header-actions'); + + expect(closeButton).toHaveClass('order-2'); + expect(headerActions).toHaveClass('order-3'); + expect(headerActions).toHaveClass('w-full'); + expect(headerActions).toHaveClass('overflow-x-auto'); + expect(headerActions).not.toContainElement(closeButton); + }); }); // ── Close button ───────────────────────────────────────────────────── diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsx index b4ee124eee..6181517f9e 100644 --- a/frontend-modern/src/components/AI/Chat/index.tsx +++ b/frontend-modern/src/components/AI/Chat/index.tsx @@ -9,6 +9,7 @@ import { createEffect, } from 'solid-js'; import { unwrap } from 'solid-js/store'; +import XIcon from 'lucide-solid/icons/x'; import { AIAPI } from '@/api/ai'; import { AIChatAPI, type ChatSession, type ChatSessionHandoffSummary } from '@/api/aiChat'; import { notificationStore } from '@/stores/notifications'; @@ -1133,7 +1134,7 @@ export const AIChat: Component = (props) => { type="button" class="fixed inset-0 z-40 bg-slate-950/45 backdrop-blur-[1px]" onClick={props.onClose} - aria-label="Close Pulse Assistant" + aria-label="Close Pulse Assistant backdrop" />
@@ -1161,14 +1162,19 @@ export const AIChat: Component = (props) => { {/* Header - wraps on mobile */} -
-

{AI_CHAT_DRAWER_TITLE}

+
+

+ {AI_CHAT_DRAWER_TITLE} +

-
+
{/* New chat */}
- - {/* Close button (Always visible as fallback) */} -
+ + {/* Close button (Always visible as fallback) */} +