Skip to content
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

[Observability AI Assistant] Use up / down arrows to select up to 5 previously used prompts #179696

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

CoenWarmer
Copy link
Contributor

Summary

This adds storing the last 5 used prompts in local storage for quick reuse.
Triggered by using the up or down arrow keys while the natural language prompt textarea editor has focus.

Screen.Recording.2024-03-29.at.15.46.30.mov

@CoenWarmer CoenWarmer requested a review from a team as a code owner March 29, 2024 14:47
@botelastic botelastic bot added the Team:obs-knowledge Observability Experience Knowledge team label Mar 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-knowledge-team (Team:obs-knowledge)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@CoenWarmer CoenWarmer assigned CoenWarmer and unassigned CoenWarmer Mar 29, 2024
@CoenWarmer CoenWarmer added the release_note:skip Skip the PR/issue when compiling release notes label Mar 29, 2024
Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addition!

Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things I've noticed:

  • I can't clear a previously used prompt, even though it looks like there is a clear button. Clearing it actually selects it.
  • WDYT about only enabling this when there is no input text? I can imagine people want to use the up/down arrows for other reasons once they've entered text. (e.g. to scroll back)

@boriskirov
Copy link
Contributor

boriskirov commented Apr 8, 2024

Two more cents here:

  1. Let's remove the search input, we can simplify this as much as possible.
  2. When you hit delete (cross), does the previous 6th prompt come up? If yes, then maybe it's okay to have that, but if not we can remove it and simplify.

@CoenWarmer
Copy link
Contributor Author

Two things I've noticed:

  • I can't clear a previously used prompt, even though it looks like there is a clear button. Clearing it actually selects it.
  • WDYT about only enabling this when there is no input text? I can imagine people want to use the up/down arrows for other reasons once they've entered text. (e.g. to scroll back)
  1. Yes
  2. Agreed

@CoenWarmer
Copy link
Contributor Author

Two more cents here:

  1. Let's remove the search input, we can simplify this as much as possible.
  2. When you hit delete (cross), does the previous 6th prompt come up? If yes, then maybe it's okay to have that, but if not we can remove it and simplify.
  1. I quite like it and would like to keep it.
  2. No. Only 5 are stored.

@CoenWarmer CoenWarmer requested a review from a team as a code owner April 8, 2024 13:25
@CoenWarmer CoenWarmer enabled auto-merge (squash) April 9, 2024 11:48
@CoenWarmer CoenWarmer requested a review from a team as a code owner May 14, 2024 07:14
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label May 14, 2024
content: selectedOption.label,
});
setSelectablePopoverOpen(false);
onFocus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't onFocus be called when the EuiInputPopover element moves focus back to the text area? I'm assuming it does do that, and if not, should we do that ourselves? Depending on what we do on focus in the consumer of this component, maybe that doesn't matter much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleClosePopover on line 89 also calls onFocus. I removed the onFocus here and the focus is correctly passed back to the text area.

@kibana-ci
Copy link
Collaborator

kibana-ci commented May 15, 2024

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observabilityAIAssistantApp 240 242 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityAIAssistantApp 149.3KB 151.0KB +1.7KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5407 +5407
total size - 8.8MB +8.8MB
Unknown metric groups

ESLint disabled line counts

id before after diff
observabilityAIAssistantApp 12 14 +2

Total ESLint disabled count

id before after diff
observabilityAIAssistantApp 12 14 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @CoenWarmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Team:obs-knowledge Observability Experience Knowledge team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants