Skip to content

Commit ca1f0ee

Browse files
committed
Fix the EIS callout being cut off for large font sizes
1 parent a12482a commit ca1f0ee

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_flyout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export function ChatFlyout({
172172
'xpack.aiAssistant.chatFlyout.euiFlyoutResizable.aiAssistantLabel',
173173
{ defaultMessage: 'AI Assistant Chat Flyout' }
174174
)}
175+
data-test-subj="aiAssistantChatFlyout"
175176
className={flyoutClassName}
176177
closeButtonProps={{
177178
css: {

x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_header.tsx

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@ export function ChatHeader({
120120
false
121121
);
122122

123+
const [isFlyoutOpen, setIsFlyoutOpen] = useState(false);
124+
125+
useEffect(() => {
126+
// Check if the AI Assistant flyout is open
127+
const checkFlyoutContext = () => {
128+
const aiAssistantFlyout = document.querySelector('[data-test-subj="aiAssistantChatFlyout"]');
129+
if (aiAssistantFlyout) {
130+
setIsFlyoutOpen(true);
131+
} else {
132+
setIsFlyoutOpen(false);
133+
}
134+
};
135+
136+
checkFlyoutContext();
137+
138+
// Set up a mutation observer to detect when flyouts are added/removed
139+
const observer = new MutationObserver(checkFlyoutContext);
140+
observer.observe(document.body, { childList: true, subtree: true });
141+
142+
return () => observer.disconnect();
143+
}, []);
144+
123145
return (
124146
<EuiPanel
125147
borderRadius="none"
@@ -281,11 +303,10 @@ export function ChatHeader({
281303
) : null}
282304

283305
<EuiFlexItem grow={false}>
284-
{!!elasticManagedLlm && !tourCalloutDismissed ? (
285-
<ElasticLlmTourCallout
286-
zIndex={isConversationApp ? 999 : undefined}
287-
dismissTour={() => setTourCalloutDismissed(true)}
288-
>
306+
{!!elasticManagedLlm &&
307+
!tourCalloutDismissed &&
308+
!(isConversationApp && isFlyoutOpen) ? (
309+
<ElasticLlmTourCallout dismissTour={() => setTourCalloutDismissed(true)}>
289310
<ChatActionsMenu connectors={connectors} disabled={licenseInvalid} />
290311
</ElasticLlmTourCallout>
291312
) : (

0 commit comments

Comments
 (0)