Skip to content

Commit

Permalink
[Obs AI Assistant] Remove the navigate-to-conversation button when th…
Browse files Browse the repository at this point in the history
…ere are initial messages but no conversationId (#202243)

Closes #198379

## Summary

### Problem
When a conversation is started from contextual insights,
`initialMessages` are set and displayed on the `ChatFlyout`. However,
when the user clicks on "Navigate to conversations` from the Chat flyout
header, a new conversation opens in the `ai_assistant_app`. This is
because, even though there are initial messages set, there is no
conversation ID until the user interacts with the AI Assistant for the
conversation started from contextual insights.

In order to navigate to a conversation (to the `ai_assistant_app`), a
conversationID is required, if not a new conversation opens up.

This behaviour seems a little inconsistent, because the expectation is
to have the initial messages displayed on the AI Assistant app too.

### Solution
Since we do not have a way to persist these initial messages from
contextual insights when navigating to the conversations view
(`ai_assistant_app`), the navigate to conversations button is removed.
If the user interacts with this conversation, since the conversation
will be persisted with a conversationId, "navigate to conversations"
will be available.

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
viduni94 authored Nov 29, 2024
1 parent f3bc700 commit 52fa276
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x-pack/packages/kbn-ai-assistant/src/chat/chat_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ export function ChatBody({
saveTitle(newTitle);
}}
onToggleFlyoutPositionMode={onToggleFlyoutPositionMode}
navigateToConversation={navigateToConversation}
navigateToConversation={
initialMessages?.length && !initialConversationId ? undefined : navigateToConversation
}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down

0 comments on commit 52fa276

Please sign in to comment.