-
Notifications
You must be signed in to change notification settings - Fork 8.5k
add loading state install/uninstall product doc #229579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add loading state install/uninstall product doc #229579
Conversation
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
| * @param inferenceId - The ID of the inference for which to get the product documentation status. | ||
| * @returns An object containing the status of the product documentation, loading state, and methods to install and uninstall the product documentation. | ||
| */ | ||
| export type ProductDocStatus = InstallationStatus | 'uninstalling'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend InstallationStatus status:
type InstallationStatus = 'installed' | 'uninstalled' | 'installing' | 'error';There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not extend the InstallationStatus itself, instead of creating a new type? I think "uninstalling" would make sense to be a status option with the InstallationStatus enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @kbn/product-doc-base-plugin doesn't include uninstalling as a status; we can add similar logic as the installing status, saving the state in the saved_object.
reference:
Line 41 in f43256f
| async getInstallationStatus({ |
I don't know if it's worth doing.
cc: @pgayvallet @qn895
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make sense to add and update the SO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I think it's fine to add uninstalling to state of the saved_object and original type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added on this commit: 5536f1e
| if (isInstalling) { | ||
| return 'installing'; | ||
| } | ||
| if (isUninstalling) { | ||
| return 'uninstalling'; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When /internal/product_doc_base/install or /internal/product_doc_base/uninstall requests are loading, return installing or uninstalling respectively; otherwise, the /internal/product_doc_base/status response.
...vability_ai_assistant_management/public/routes/components/settings_tab/product_doc_entry.tsx
Outdated
Show resolved
Hide resolved
|
Hey @arturoliduena , I checked out the PR. The loading indicator looks good, but there seems to be a glitch with the states. When the install/uninstall process is finished, the state goes back to how it was before for a few seconds, before syncing to the new state. For example, it you're uninstalling, after the uninstall process is done, the button will appear that says "Uninstall", and after a few seconds it syncs to say "Install" instead. I've taken some screen recordings to show. Screen.Recording.2025-07-28.at.12.37.10.movScreen.Recording.2025-07-28.at.12.44.10.mov |
@eleonoramicozzi, great catch, I have fixed it, adding |
...rm/plugins/private/observability_ai_assistant_management/public/hooks/use_get_product_doc.ts
Outdated
Show resolved
Hide resolved
|
Hi Arturo, the code looks good to me. I did some testing: the install flow looks good to me, but while testing the uninstall flow, I noticed that after the uninstall is finished, we still show the "Installed" text with a loading button next to it, and then it switches to the "Install" button like it should. Is there any way we can fix that to just show the loading state after uninstall? I am adding a screen recording. Screen.Recording.2025-07-31.at.13.10.19.mov |
ab88a76 to
e30b7d4
Compare
3f6d907 to
0bd75bf
Compare
thanks, @eleonoramicozzi, I added a fix on this commit 1cb21a0, could you test it again? |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
|
qn895
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and AI Infra changes LGTM
@arturoliduena, I've tested it and the behaviour is as expected now, thank you! Approved :) |
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16753972133 |
Closes [elastic#229460](elastic#229460) ## Summary When a user clicks the "Install" or "Uninstall" button for product documentation, add visual feedback in the UI (a spinner) to indicate that an action is in progress. ### Steps to Reproduce Navigate Observability AI Assistant settings page see that Elastic documentation is not yet installed. Click the Install button. Observe that the button shows no loading state. (Similarly, for an installed package, click Uninstall and observe the same lack of feedback). Expected Behavior After clicking "Install" or "Uninstall", the button should immediately enter a loading state. https://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf https://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f https://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) (cherry picked from commit 8e9fabe) # Conflicts: # x-pack/platform/plugins/private/observability_ai_assistant_management/public/hooks/use_get_product_doc.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Closes [elastic#229460](elastic#229460) ## Summary When a user clicks the "Install" or "Uninstall" button for product documentation, add visual feedback in the UI (a spinner) to indicate that an action is in progress. ### Steps to Reproduce Navigate Observability AI Assistant settings page see that Elastic documentation is not yet installed. Click the Install button. Observe that the button shows no loading state. (Similarly, for an installed package, click Uninstall and observe the same lack of feedback). Expected Behavior After clicking "Install" or "Uninstall", the button should immediately enter a loading state. https://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf https://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f https://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) (cherry picked from commit 8e9fabe) # Conflicts: # x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_product_doc.ts # x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_product_doc.ts
) # Backport This will backport the following commits from `main` to `9.1`: - [add loading state install/uninstall product doc (#229579)](#229579) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Arturo Lidueña","email":"arturo.liduena@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T15:06:20Z","message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs AI Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"add loading state install/uninstall product doc","number":229579,"url":"https://github.com/elastic/kibana/pull/229579","mergeCommit":{"message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229579","number":229579,"mergeCommit":{"message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404"}}]}] BACKPORT-->
…0619) # Backport This will backport the following commits from `main` to `8.19`: - [add loading state install/uninstall product doc (#229579)](#229579) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Arturo Lidueña","email":"arturo.liduena@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T15:06:20Z","message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs AI Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"add loading state install/uninstall product doc","number":229579,"url":"https://github.com/elastic/kibana/pull/229579","mergeCommit":{"message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229579","number":229579,"mergeCommit":{"message":"add loading state install/uninstall product doc (#229579)\n\nCloses [#229460](https://github.com/elastic/kibana/issues/229460)\n## Summary\n\nWhen a user clicks the \"Install\" or \"Uninstall\" button for product\ndocumentation, add visual feedback in the UI (a spinner) to indicate\nthat an action is in progress.\n\n### Steps to Reproduce\nNavigate Observability AI Assistant settings page\n\nsee that Elastic documentation is not yet installed.\n\nClick the Install button.\n\nObserve that the button shows no loading state.\n\n(Similarly, for an installed package, click Uninstall and observe the\nsame lack of feedback).\n\nExpected Behavior\nAfter clicking \"Install\" or \"Uninstall\", the button should immediately\nenter a loading state.\n\n\nhttps://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf\n\n\n\nhttps://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f\n\n\n\nhttps://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)","sha":"8e9fabeabf702c552f65edd0dadba20598416404"}}]}] BACKPORT-->
Closes [elastic#229460](elastic#229460) ## Summary When a user clicks the "Install" or "Uninstall" button for product documentation, add visual feedback in the UI (a spinner) to indicate that an action is in progress. ### Steps to Reproduce Navigate Observability AI Assistant settings page see that Elastic documentation is not yet installed. Click the Install button. Observe that the button shows no loading state. (Similarly, for an installed package, click Uninstall and observe the same lack of feedback). Expected Behavior After clicking "Install" or "Uninstall", the button should immediately enter a loading state. https://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf https://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f https://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
Closes [elastic#229460](elastic#229460) ## Summary When a user clicks the "Install" or "Uninstall" button for product documentation, add visual feedback in the UI (a spinner) to indicate that an action is in progress. ### Steps to Reproduce Navigate Observability AI Assistant settings page see that Elastic documentation is not yet installed. Click the Install button. Observe that the button shows no loading state. (Similarly, for an installed package, click Uninstall and observe the same lack of feedback). Expected Behavior After clicking "Install" or "Uninstall", the button should immediately enter a loading state. https://github.com/user-attachments/assets/9e9f8fef-bf18-4a6a-96af-c514dae4ffdf https://github.com/user-attachments/assets/1c36d617-0def-4a6d-af04-bb9ef52c624f https://github.com/user-attachments/assets/8053cf33-cc69-4d1d-8779-23a361266576 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
Closes #229460
Summary
When a user clicks the "Install" or "Uninstall" button for product documentation, add visual feedback in the UI (a spinner) to indicate that an action is in progress.
Steps to Reproduce
Navigate Observability AI Assistant settings page
see that Elastic documentation is not yet installed.
Click the Install button.
Observe that the button shows no loading state.
(Similarly, for an installed package, click Uninstall and observe the same lack of feedback).
Expected Behavior
After clicking "Install" or "Uninstall", the button should immediately enter a loading state.
Screen.Recording.2025-08-05.at.16.21.12.mov
Screen.Recording.2025-08-05.at.16.22.08.mov
Screen.Recording.2025-08-05.at.16.23.07.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.