Skip to content

[Lens][Suggestion API] Improve suggestion API to listen to preferred chart sub types#242902

Merged
dej611 merged 9 commits intoelastic:mainfrom
dej611:fix/241199
Nov 17, 2025
Merged

[Lens][Suggestion API] Improve suggestion API to listen to preferred chart sub types#242902
dej611 merged 9 commits intoelastic:mainfrom
dej611:fix/241199

Conversation

@dej611
Copy link
Copy Markdown
Contributor

@dej611 dej611 commented Nov 13, 2025

Summary

Fixes #241199

This PR addressed an issue with the switching logic when asking the suggestion api to generate a chart type.
Added unit tests to check new behaviour.
Tested locally with the Agent Builder:

Screenshot 2025-11-13 at 11 52 49 Screenshot 2025-11-13 at 11 52 11 Screenshot 2025-11-13 at 11 51 58 Screenshot 2025-11-13 at 14 30 00

Checklist

@dej611 dej611 requested a review from a team as a code owner November 13, 2025 13:30
@dej611 dej611 added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:version Backport to applied version labels v9.3.0 v9.2.2 labels Nov 13, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@dej611 dej611 requested a review from a team as a code owner November 14, 2025 13:51
@dej611 dej611 enabled auto-merge (squash) November 14, 2025 17:46
@dej611 dej611 merged commit f7d4891 into elastic:main Nov 17, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2

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

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/lens-common 1337 1339 +2
lens 598 600 +2
total +4

Async chunks

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

id before after diff
lens 1.6MB 1.6MB +210.0B
Unknown metric groups

API count

id before after diff
@kbn/lens-common 1480 1482 +2
lens 701 703 +2
total +4

History

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 242902

Questions ?

Please refer to the Backport tool documentation

@spong
Copy link
Copy Markdown
Member

spong commented Nov 18, 2025

Hey there @dej611, we're looking to backport #240921 (comment) to 9.2.x and noticed this backport has failed to merge.

Are you still intending for this to be backported to 9.2.x?

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Nov 18, 2025

I thought it would be compatible to backport, but I see there are merging conflicts which are not easy to solve.
I'll close the backport for now and provide an ad hoc backport PR

@dej611 dej611 removed the v9.2.2 label Nov 18, 2025
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 19, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

8 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
…chart sub types (elastic#242902)

## Summary

Fixes elastic#241199

This PR addressed an issue with the switching logic when asking the
suggestion api to generate a chart type.
Added unit tests to check new behaviour.
Tested locally with the Agent Builder:

<img width="670" height="370" alt="Screenshot 2025-11-13 at 11 52 49"
src="https://github.com/user-attachments/assets/4e8b2947-84cc-48a8-8787-b465f145be8a"
/>
<img width="645" height="365" alt="Screenshot 2025-11-13 at 11 52 11"
src="https://github.com/user-attachments/assets/7c08c80c-42f4-48ad-9a66-467bd6199d65"
/>
<img width="643" height="336" alt="Screenshot 2025-11-13 at 11 51 58"
src="https://github.com/user-attachments/assets/ed5905ef-343f-4792-8609-7c282454a707"
/>
<img width="653" height="352" alt="Screenshot 2025-11-13 at 14 30 00"
src="https://github.com/user-attachments/assets/9e7935e0-96b4-4bcc-9f70-b2484175da3b"
/>


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 242902 locally
cc: @dej611

@markov00
Copy link
Copy Markdown
Contributor

markov00 commented Dec 3, 2025

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

markov00 pushed a commit to markov00/kibana that referenced this pull request Dec 3, 2025
…chart sub types (elastic#242902)

## Summary

Fixes elastic#241199

This PR addressed an issue with the switching logic when asking the
suggestion api to generate a chart type.
Added unit tests to check new behaviour.
Tested locally with the Agent Builder:

<img width="670" height="370" alt="Screenshot 2025-11-13 at 11 52 49"
src="https://github.com/user-attachments/assets/4e8b2947-84cc-48a8-8787-b465f145be8a"
/>
<img width="645" height="365" alt="Screenshot 2025-11-13 at 11 52 11"
src="https://github.com/user-attachments/assets/7c08c80c-42f4-48ad-9a66-467bd6199d65"
/>
<img width="643" height="336" alt="Screenshot 2025-11-13 at 11 51 58"
src="https://github.com/user-attachments/assets/ed5905ef-343f-4792-8609-7c282454a707"
/>
<img width="653" height="352" alt="Screenshot 2025-11-13 at 14 30 00"
src="https://github.com/user-attachments/assets/9e7935e0-96b4-4bcc-9f70-b2484175da3b"
/>

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit f7d4891)

# Conflicts:
#	src/platform/packages/shared/kbn-lens-common/visualizations/types.ts
#	x-pack/platform/plugins/shared/lens/public/lens_suggestions_api/helpers.test.ts
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

12 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

markov00 added a commit that referenced this pull request Dec 19, 2025
…erred chart sub types (#242902) (#245029)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Lens][Suggestion API] Improve suggestion API to listen to preferred
chart sub types
(#242902)](#242902)

<!--- Backport version: 10.2.0 -->

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

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-11-17T11:47:36Z","message":"[Lens][Suggestion
API] Improve suggestion API to listen to preferred chart sub types
(#242902)\n\n## Summary\n\nFixes #241199\n\nThis PR addressed an issue
with the switching logic when asking the\nsuggestion api to generate a
chart type.\nAdded unit tests to check new behaviour.\nTested locally
with the Agent Builder:\n\n<img width=\"670\" height=\"370\"
alt=\"Screenshot 2025-11-13 at 11 52
49\"\nsrc=\"https://github.com/user-attachments/assets/4e8b2947-84cc-48a8-8787-b465f145be8a\"\n/>\n<img
width=\"645\" height=\"365\" alt=\"Screenshot 2025-11-13 at 11 52
11\"\nsrc=\"https://github.com/user-attachments/assets/7c08c80c-42f4-48ad-9a66-467bd6199d65\"\n/>\n<img
width=\"643\" height=\"336\" alt=\"Screenshot 2025-11-13 at 11 51
58\"\nsrc=\"https://github.com/user-attachments/assets/ed5905ef-343f-4792-8609-7c282454a707\"\n/>\n<img
width=\"653\" height=\"352\" alt=\"Screenshot 2025-11-13 at 14 30
00\"\nsrc=\"https://github.com/user-attachments/assets/9e7935e0-96b4-4bcc-9f70-b2484175da3b\"\n/>\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"f7d4891d8f56b7a457c1467b6d9395941d09fcb2","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","backport
missing","backport:version","v9.3.0"],"title":"[Lens][Suggestion API]
Improve suggestion API to listen to preferred chart sub
types","number":242902,"url":"https://github.com/elastic/kibana/pull/242902","mergeCommit":{"message":"[Lens][Suggestion
API] Improve suggestion API to listen to preferred chart sub types
(#242902)\n\n## Summary\n\nFixes #241199\n\nThis PR addressed an issue
with the switching logic when asking the\nsuggestion api to generate a
chart type.\nAdded unit tests to check new behaviour.\nTested locally
with the Agent Builder:\n\n<img width=\"670\" height=\"370\"
alt=\"Screenshot 2025-11-13 at 11 52
49\"\nsrc=\"https://github.com/user-attachments/assets/4e8b2947-84cc-48a8-8787-b465f145be8a\"\n/>\n<img
width=\"645\" height=\"365\" alt=\"Screenshot 2025-11-13 at 11 52
11\"\nsrc=\"https://github.com/user-attachments/assets/7c08c80c-42f4-48ad-9a66-467bd6199d65\"\n/>\n<img
width=\"643\" height=\"336\" alt=\"Screenshot 2025-11-13 at 11 51
58\"\nsrc=\"https://github.com/user-attachments/assets/ed5905ef-343f-4792-8609-7c282454a707\"\n/>\n<img
width=\"653\" height=\"352\" alt=\"Screenshot 2025-11-13 at 14 30
00\"\nsrc=\"https://github.com/user-attachments/assets/9e7935e0-96b4-4bcc-9f70-b2484175da3b\"\n/>\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"f7d4891d8f56b7a457c1467b6d9395941d09fcb2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/242902","number":242902,"mergeCommit":{"message":"[Lens][Suggestion
API] Improve suggestion API to listen to preferred chart sub types
(#242902)\n\n## Summary\n\nFixes #241199\n\nThis PR addressed an issue
with the switching logic when asking the\nsuggestion api to generate a
chart type.\nAdded unit tests to check new behaviour.\nTested locally
with the Agent Builder:\n\n<img width=\"670\" height=\"370\"
alt=\"Screenshot 2025-11-13 at 11 52
49\"\nsrc=\"https://github.com/user-attachments/assets/4e8b2947-84cc-48a8-8787-b465f145be8a\"\n/>\n<img
width=\"645\" height=\"365\" alt=\"Screenshot 2025-11-13 at 11 52
11\"\nsrc=\"https://github.com/user-attachments/assets/7c08c80c-42f4-48ad-9a66-467bd6199d65\"\n/>\n<img
width=\"643\" height=\"336\" alt=\"Screenshot 2025-11-13 at 11 51
58\"\nsrc=\"https://github.com/user-attachments/assets/ed5905ef-343f-4792-8609-7c282454a707\"\n/>\n<img
width=\"653\" height=\"352\" alt=\"Screenshot 2025-11-13 at 14 30
00\"\nsrc=\"https://github.com/user-attachments/assets/9e7935e0-96b4-4bcc-9f70-b2484175da3b\"\n/>\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"f7d4891d8f56b7a457c1467b6d9395941d09fcb2"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
@kibanamachine kibanamachine added v9.2.3 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Dec 19, 2025
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 Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v9.2.3 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Visualizations] Lens suggestion returns "treemap" instead of Pie

6 participants