diff --git a/public/index.scss b/public/index.scss index cbc51a49..54c04d13 100644 --- a/public/index.scss +++ b/public/index.scss @@ -120,9 +120,7 @@ } .llm-chat-bubble-panel.llm-chat-bubble-panel-input { - background: #159d8d; margin-left: auto; - color: #fcfeff; max-width: 85%; } .llm-chat-bubble-panel.llm-chat-bubble-panel-output { diff --git a/public/tabs/chat/chat_page_content.tsx b/public/tabs/chat/chat_page_content.tsx index 0b85f5f7..25bd426e 100644 --- a/public/tabs/chat/chat_page_content.tsx +++ b/public/tabs/chat/chat_page_content.tsx @@ -151,7 +151,7 @@ export const ChatPageContent: React.FC = React.memo((props {configSchema.chat.regenerateMessage && chatState.llmResponding && chatContext.conversationId && ( -
+
= (props) => { registry.setSuggestionsByInteractionId(interactionId, suggestedActions); return ( -
+
Available suggestions diff --git a/public/tabs/chat/messages/message_bubble.tsx b/public/tabs/chat/messages/message_bubble.tsx index 1118fbce..4ec576e3 100644 --- a/public/tabs/chat/messages/message_bubble.tsx +++ b/public/tabs/chat/messages/message_bubble.tsx @@ -4,17 +4,15 @@ */ import { - EuiAvatar, EuiFlexGroup, EuiFlexItem, - EuiLoadingContent, EuiLoadingSpinner, EuiPanel, EuiSpacer, - EuiIcon, + EuiText, } from '@elastic/eui'; import React from 'react'; -import { IconType } from '@elastic/eui/src/components/icon/icon'; +import { i18n } from '@osd/i18n'; import { MessageActions } from './message_action'; import { useCore } from '../../../contexts'; import { getConfigSchema, getLogoIcon } from '../../../services'; @@ -53,48 +51,36 @@ export const MessageBubble: React.FC = React.memo((props) => props.message.type === 'output' && props.message.contentType === 'markdown'; - const createAvatar = (iconType?: IconType) => { - if (iconType) { - return ( - - ); - } else { - return ; - } - }; - if ('loading' in props && props.loading) { return ( - - - {createAvatar(() => ( - - ))} - - - - - - - + + + + + + + + {i18n.translate('chat.loading.response', { + defaultMessage: 'Generating response...', + })} + + + + + ); } @@ -113,7 +99,7 @@ export const MessageBubble: React.FC = React.memo((props) => hasShadow={false} hasBorder={false} paddingSize="l" - color="plain" + color="primary" className="llm-chat-bubble-panel llm-chat-bubble-panel-input" > {props.children} @@ -126,66 +112,54 @@ export const MessageBubble: React.FC = React.memo((props) => const fullWidth = props.message.fullWidth; return ( - - - {props.message.contentType === 'error' ? createAvatar('alert') : createAvatar()} - - - - {props.children} - {props.showActionBar && ( - <> - - props.onRegenerate?.(props.interaction?.interaction_id || '')} - interaction={props.interaction} - message={props.message as IOutput} - showFeedback={showFeedback} - showTraceIcon={configSchema.chat.trace && !!props.message.interactionId} - traceTip="How was this generated?" - traceInteractionId={props.message.interactionId || ''} - onViewTrace={() => { - const message = props.message as IOutput; - const viewTraceAction: ISuggestedAction = { - actionType: 'view_trace', - metadata: { - interactionId: message.interactionId || '', - }, - message: 'How was this generated?', - }; - executeAction(viewTraceAction, message); - }} - shouldActionBarVisibleOnHover={props.shouldActionBarVisibleOnHover} - isFullWidth={fullWidth} - httpSetup={core.services.http} - dataSourceService={core.services.dataSource} - usageCollection={core.services.setupDeps.usageCollection} - metricAppName="chat" - /> - - )} - - - + {props.children} + {props.showActionBar && ( + <> + + props.onRegenerate?.(props.interaction?.interaction_id || '')} + interaction={props.interaction} + message={props.message as IOutput} + showFeedback={showFeedback} + showTraceIcon={configSchema.chat.trace && !!props.message.interactionId} + traceTip="How was this generated?" + traceInteractionId={props.message.interactionId || ''} + onViewTrace={() => { + const message = props.message as IOutput; + const viewTraceAction: ISuggestedAction = { + actionType: 'view_trace', + metadata: { + interactionId: message.interactionId || '', + }, + message: 'How was this generated?', + }; + executeAction(viewTraceAction, message); + }} + shouldActionBarVisibleOnHover={props.shouldActionBarVisibleOnHover} + isFullWidth={fullWidth} + httpSetup={core.services.http} + dataSourceService={core.services.dataSource} + usageCollection={core.services.setupDeps.usageCollection} + metricAppName="chat" + /> + + )} + ); } return null;