[AI Infra] Choose which AI Assistant to show in the Elastic Header & Move the AI Assistant visibility setting to GenAI Settings page#233727
Conversation
… AI Assistant Management
…isibility-to-genai-settings-page
| useEffect(() => { | ||
| const openChatSubscription = aiAssistantManagementSelection.openChat$.subscribe((event) => { | ||
| if (event.assistant === 'observability') { | ||
| service.conversations.openNewConversation({ messages: [] }); | ||
| } | ||
| }); | ||
|
|
||
| return () => { | ||
| openChatSubscription.unsubscribe(); | ||
| }; | ||
| }, [aiAssistantManagementSelection.openChat$, service.conversations]); | ||
|
|
There was a problem hiding this comment.
Honestly, I don't think it's the right move to introduce this new subscription here. However, with this new selector, we need a way to instantly open the appropriate assistant window, and I couldn't think of a better solution to populate it with all the relevant configuration already in place. The trigger is exposed from ai_assistant_management plugin start contract.
I'm open to any ideas.
|
Pinging @elastic/appex-ai-infra (Team:AI Infra) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
Damn.. I'm so sorry for all the pings, something went wrong 😅 |
| triggerOpenChat: (event: { assistant: AIAssistantType }) => void; | ||
| } | ||
|
|
||
| export const AiAssistantHeaderButton: React.FC<AiAssistantHeaderButtonProps> = ({ |
There was a problem hiding this comment.
super duper nit: Suggestion to make this consistent with the rest with AIAssistant... (so upper cased I and instead of lower-cased)
| async function handleSave() { | ||
| try { | ||
| await saveAll(); | ||
| window.location.reload(); |
There was a problem hiding this comment.
When registering the settings in the server-side plugin, there is a "requires reload" property. Can we set that property to true for the respective setting and then check Inside of useSettingsContext() > saveAll() if a reload is needed?
| readonly: true, | ||
| readonlyMode: 'ui', |
There was a problem hiding this comment.
Is readonly: true needed if you use readonlyMode:'ui'?
There was a problem hiding this comment.
Yeah, it seems like we need both, otherwise it would show up in the Kibana Advanced Settings
|
|
||
| // TODO: This is duplicated code. It should be removed when the logo becomes available in EUI. | ||
|
|
||
| const AssistantLogo = (props: React.SVGProps<SVGSVGElement>) => ( |
There was a problem hiding this comment.
Assistant logo in shared component library: x-pack/platform/packages/shared/ai-assistant/icon/icon.tsx
There was a problem hiding this comment.
I needed to use the logo in src/platform... (OSS), so I couldn't import it from x-pack. Ideally, the shared logo should live in the OSS code probably, but I wanted to avoid relocating it and updating all current imports in this PR.
csr
left a comment
There was a problem hiding this comment.
src/platform/test/tsconfig.json LGTM 👍
|
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
The CI Stats report is too large to be displayed here, check out the CI build annotation for this information. History
cc @rbrtj |
…Move the `AI Assistant visibility` setting to `GenAI Settings` page (#233727) Resolves #235602 This PR: * Moves the `AI Assistant Visibility` UI setting to `GenAI Settings` page. It disables the setting in Serverless and ECH Solution views. <img width="1096" height="713" alt="image" src="https://github.com/user-attachments/assets/5e8c7dce-13e5-44b4-81a5-cf3936a7ba5f" /> * Introduces a new navigation header selector for non-solution pages (Analytics, Stack Management), allowing users to choose which version of the Assistant they want to see. Based on their selection, the UI setting is updated, and the relevant Assistant window opens instantly. https://github.com/user-attachments/assets/8cc2644f-45e7-4200-b92f-df96ef827847 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…Move the `AI Assistant visibility` setting to `GenAI Settings` page (elastic#233727) Resolves elastic#235602 This PR: * Moves the `AI Assistant Visibility` UI setting to `GenAI Settings` page. It disables the setting in Serverless and ECH Solution views. <img width="1096" height="713" alt="image" src="https://github.com/user-attachments/assets/5e8c7dce-13e5-44b4-81a5-cf3936a7ba5f" /> * Introduces a new navigation header selector for non-solution pages (Analytics, Stack Management), allowing users to choose which version of the Assistant they want to see. Based on their selection, the UI setting is updated, and the relevant Assistant window opens instantly. https://github.com/user-attachments/assets/8cc2644f-45e7-4200-b92f-df96ef827847 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…Move the `AI Assistant visibility` setting to `GenAI Settings` page (elastic#233727) Resolves elastic#235602 This PR: * Moves the `AI Assistant Visibility` UI setting to `GenAI Settings` page. It disables the setting in Serverless and ECH Solution views. <img width="1096" height="713" alt="image" src="https://github.com/user-attachments/assets/5e8c7dce-13e5-44b4-81a5-cf3936a7ba5f" /> * Introduces a new navigation header selector for non-solution pages (Analytics, Stack Management), allowing users to choose which version of the Assistant they want to see. Based on their selection, the UI setting is updated, and the relevant Assistant window opens instantly. https://github.com/user-attachments/assets/8cc2644f-45e7-4200-b92f-df96ef827847 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>


Resolves #235602
This PR:
AI Assistant VisibilityUI setting toGenAI Settingspage. It disables the setting in Serverless and ECH Solution views.Screen.Recording.2025-09-19.at.11.41.41.mov