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

[Obs AI Assistant] Fix editing prompt from contextual insights #206673

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

viduni94
Copy link
Contributor

@viduni94 viduni94 commented Jan 14, 2025

Closes #201642

Summary

Problem

  1. Before a conversation is generated from contextual insights (before Help me understand this alert is clicked), if the user clicks on Edit Prompt, the prompt to edit is not loaded. An empty input box is loaded.
  2. When a new prompt is typed in the empty input box and submitted, it throws an error (because the way the new prompt is assigned to the conversation errors out)
  3. After clicking on "Help me understand this alert", if the user clicks on Edit Prompt, a large string is loaded with contextual information, as the prompt to edit. This is not user-friendly.

(All of the above can be seen in the screen recording before the changes - attached below)

Solution

  1. Wait for the messages to be generated and then load the correct initial prompt to edit.
  2. When re-assigning the new prompt to the messages, make sure to parse it and then assign correctly so that editing the prompt is user friendly.

Screen recordings:

Before the changes (with errors):

Screen.Recording.2025-01-14.at.2.23.54.PM.mov

After the changes:

Screen.Recording.2025-01-16.at.9.57.00.AM.mov

Checklist

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@viduni94 viduni94 self-assigned this Jan 14, 2025
@viduni94 viduni94 requested review from a team as code owners January 14, 2025 19:32
@botelastic botelastic bot added Team:Obs AI Assistant Observability AI Assistant Team:obs-ux-management Observability Management User Experience Team labels Jan 14, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@viduni94 viduni94 force-pushed the editing-prompt-contextual-insights branch from 0505c81 to 32f2299 Compare January 14, 2025 19:32
viduni94 added a commit to viduni94/kibana that referenced this pull request Jan 15, 2025
@viduni94 viduni94 requested a review from a team as a code owner January 15, 2025 16:12
@viduni94 viduni94 force-pushed the editing-prompt-contextual-insights branch from 889ab05 to a44fc6a Compare January 15, 2025 16:14
viduni94 added a commit to viduni94/kibana that referenced this pull request Jan 15, 2025
Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

kibana manifest LGTM

viduni94 added a commit to viduni94/kibana that referenced this pull request Jan 16, 2025
viduni94 added a commit to viduni94/kibana that referenced this pull request Jan 16, 2025
@viduni94 viduni94 force-pushed the editing-prompt-contextual-insights branch from 7303a9b to 828946d Compare January 16, 2025 14:53
@viduni94 viduni94 removed the request for review from a team January 16, 2025 14:56
@viduni94 viduni94 removed the request for review from dominiqueclarke January 16, 2025 14:56
@elastic elastic deleted a comment from elasticmachine Jan 16, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
observabilityAIAssistant 19.8KB 20.2KB +375.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
observabilityAIAssistant 5 6 +1

Total ESLint disabled count

id before after diff
observabilityAIAssistant 7 8 +1

History

cc @viduni94

@viduni94 viduni94 merged commit 10a2215 into elastic:main Jan 16, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12813711445

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 16, 2025
…ic#206673)

Closes elastic#201642

## Summary

### Problem
1. Before a conversation is generated from contextual insights (before
`Help me understand this alert` is clicked), if the user clicks on `Edit
Prompt`, the prompt to edit is not loaded. An empty input box is loaded.
2. When a new prompt is typed in the empty input box and submitted, it
throws an error (because the way the new prompt is assigned to the
conversation errors out)
3. After clicking on "Help me understand this alert", if the user clicks
on `Edit Prompt`, a large string is loaded with contextual information,
as the prompt to edit. This is not user-friendly.

(All of the above can be seen in the screen recording before the changes
- attached below)

### Solution
1. Wait for the messages to be generated and then load the correct
initial prompt to edit.
2. When re-assigning the new prompt to the messages, make sure to parse
it and then assign correctly so that editing the prompt is user
friendly.

### 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)

(cherry picked from commit 10a2215)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 16, 2025
…206673) (#206982)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Obs AI Assistant] Fix editing prompt from contextual insights
(#206673)](#206673)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Viduni
Wickramarachchi","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-16T16:52:44Z","message":"[Obs
AI Assistant] Fix editing prompt from contextual insights
(#206673)\n\nCloses
https://github.com/elastic/kibana/issues/201642\r\n\r\n##
Summary\r\n\r\n### Problem\r\n1. Before a conversation is generated from
contextual insights (before\r\n`Help me understand this alert` is
clicked), if the user clicks on `Edit\r\nPrompt`, the prompt to edit is
not loaded. An empty input box is loaded.\r\n2. When a new prompt is
typed in the empty input box and submitted, it\r\nthrows an error
(because the way the new prompt is assigned to the\r\nconversation
errors out)\r\n3. After clicking on \"Help me understand this alert\",
if the user clicks\r\non `Edit Prompt`, a large string is loaded with
contextual information,\r\nas the prompt to edit. This is not
user-friendly.\r\n\r\n(All of the above can be seen in the screen
recording before the changes\r\n- attached below)\r\n\r\n###
Solution\r\n1. Wait for the messages to be generated and then load the
correct\r\ninitial prompt to edit.\r\n2. When re-assigning the new
prompt to the messages, make sure to parse\r\nit and then assign
correctly so that editing the prompt is user\r\nfriendly.\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10a221553a1b0b4d66afd5b887e4115e3412d9d3","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Obs
AI
Assistant","Team:obs-ux-management","backport:version","v8.18.0"],"title":"[Obs
AI Assistant] Fix editing prompt from contextual
insights","number":206673,"url":"https://github.com/elastic/kibana/pull/206673","mergeCommit":{"message":"[Obs
AI Assistant] Fix editing prompt from contextual insights
(#206673)\n\nCloses
https://github.com/elastic/kibana/issues/201642\r\n\r\n##
Summary\r\n\r\n### Problem\r\n1. Before a conversation is generated from
contextual insights (before\r\n`Help me understand this alert` is
clicked), if the user clicks on `Edit\r\nPrompt`, the prompt to edit is
not loaded. An empty input box is loaded.\r\n2. When a new prompt is
typed in the empty input box and submitted, it\r\nthrows an error
(because the way the new prompt is assigned to the\r\nconversation
errors out)\r\n3. After clicking on \"Help me understand this alert\",
if the user clicks\r\non `Edit Prompt`, a large string is loaded with
contextual information,\r\nas the prompt to edit. This is not
user-friendly.\r\n\r\n(All of the above can be seen in the screen
recording before the changes\r\n- attached below)\r\n\r\n###
Solution\r\n1. Wait for the messages to be generated and then load the
correct\r\ninitial prompt to edit.\r\n2. When re-assigning the new
prompt to the messages, make sure to parse\r\nit and then assign
correctly so that editing the prompt is user\r\nfriendly.\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10a221553a1b0b4d66afd5b887e4115e3412d9d3"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/206673","number":206673,"mergeCommit":{"message":"[Obs
AI Assistant] Fix editing prompt from contextual insights
(#206673)\n\nCloses
https://github.com/elastic/kibana/issues/201642\r\n\r\n##
Summary\r\n\r\n### Problem\r\n1. Before a conversation is generated from
contextual insights (before\r\n`Help me understand this alert` is
clicked), if the user clicks on `Edit\r\nPrompt`, the prompt to edit is
not loaded. An empty input box is loaded.\r\n2. When a new prompt is
typed in the empty input box and submitted, it\r\nthrows an error
(because the way the new prompt is assigned to the\r\nconversation
errors out)\r\n3. After clicking on \"Help me understand this alert\",
if the user clicks\r\non `Edit Prompt`, a large string is loaded with
contextual information,\r\nas the prompt to edit. This is not
user-friendly.\r\n\r\n(All of the above can be seen in the screen
recording before the changes\r\n- attached below)\r\n\r\n###
Solution\r\n1. Wait for the messages to be generated and then load the
correct\r\ninitial prompt to edit.\r\n2. When re-assigning the new
prompt to the messages, make sure to parse\r\nit and then assign
correctly so that editing the prompt is user\r\nfriendly.\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10a221553a1b0b4d66afd5b887e4115e3412d9d3"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Viduni Wickramarachchi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:fix Team:Obs AI Assistant Observability AI Assistant Team:obs-ux-management Observability Management User Experience Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] Editing the prompt from contextual insights is not user friendly
6 participants