forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AI Assistant] Prevent Ai Assistant nav control load for any page (el…
…astic#192066) ## 📓 Summary Closes elastic#191601 The AI Assistant nav control is currently loaded only for Observability pages. However, during its registration step in the `observabilityAIAssistantApp`, the whole async chunk leaked into any page even when unnecessary since the control was not shown. The cause was a visibility condition applied too late in the react rendering process. Lifting the control condition higher in the tree prevents the whole chunk from being loaded for any page, but only for those enabled in observability. This refactor const of a total **~93%** reduction in the impact of the AI Assistant code for pages that won't need it. Also, even if the bundle file was not excessively big, this refactor brings a nice **~33%** on the initial `observabilityAiAssistantApp.plugin.js` bundle file. | **AIAssistantApp impact on Kibana** | |--------| | **Before** <img width="2276" alt="Screenshot 2024-09-04 at 11 25 40" src="https://github.com/user-attachments/assets/0f728c82-c667-4489-9d04-18e9c1ce158e"> | | **After** <img width="2272" alt="Screenshot 2024-09-04 at 11 29 11" src="https://github.com/user-attachments/assets/513e6eab-10bd-4919-9a33-16eb3983fa27"> | **Demo** 🎥 https://github.com/user-attachments/assets/5faa4c77-52c5-40e8-8d39-78952504fede --------- Co-authored-by: Marco Antonio Ghiani <[email protected]> Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
8be089b
commit 5b4f4af
Showing
5 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters