Skip to content

[Automatic Migrations] Clear migration completion toast notification on navigation#239058

Merged
kqualters-elastic merged 15 commits intoelastic:mainfrom
kqualters-elastic:migrations-clear-toast
Oct 31, 2025
Merged

[Automatic Migrations] Clear migration completion toast notification on navigation#239058
kqualters-elastic merged 15 commits intoelastic:mainfrom
kqualters-elastic:migrations-clear-toast

Conversation

@kqualters-elastic
Copy link
Copy Markdown
Contributor

@kqualters-elastic kqualters-elastic commented Oct 15, 2025

Summary

issue: #237466

This pr changes the way migration service classes call toasts so that they can be dismissed as well when a user navigates to the migration table upon completion.

clear_toast.mov

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@kqualters-elastic kqualters-elastic requested a review from a team as a code owner October 15, 2025 05:56
@kqualters-elastic kqualters-elastic added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team backport:version Backport to applied version labels v9.2.0 labels Oct 15, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

@e40pud
Copy link
Copy Markdown
Contributor

e40pud commented Oct 15, 2025

I'm curious how these type of toasts are handled

Screenshot 2025-10-15 at 10 19 39

Those usually are closed when user clicks the "See the full error" action button.

If we proceed with your approach, I would prefer to put toast management logic (save, remove etc.) inside the common SiemMigrationsServiceBase class where we call the function to show it. This way we do not change much in other places and will just need to return toast itself and pass some onDismissToast callback.

Also, I noticed that these changes do not handle the situation when user clicks the toast dismiss/close button (X) and when the toast goes away because of the toastLifeTimeMs. The ToastInput has onClose handler which I believe we will need to use to cleanup toasts.

@logeekal
Copy link
Copy Markdown
Contributor

I don't like that toast identity is only communicated after it has been raised but for raising we need the ID of the toast so that we can remove it later. But we cannot do anything about the core design of the toasts plugin. On the top of that managing toasts feels like an overkill for this.

If we have manage toasts, we should rather create a separate state in useAppToast or a new ToastManager.

Also, I think current approach intermingles siem_migrations with toasts a little too much. What do you think about below approach. I moved the capability of raising and removing toast to notifications.ts. I think this preserves separation of concerns. It seems to be working well also. I have raised a small PR with suggested changes : kqualters-elastic#9.

See if makes sense and if it passed your tests.

Screen.Recording.2025-10-15.at.12.30.40.mov

@kqualters-elastic
Copy link
Copy Markdown
Contributor Author

I don't like that toast identity is only communicated after it has been raised but for raising we need the ID of the toast so that we can remove it later. But we cannot do anything about the core design of the toasts plugin. On the top of that managing toasts feels like an overkill for this.

If we have manage toasts, we should rather create a separate state in useAppToast or a new ToastManager.

Also, I think current approach intermingles siem_migrations with toasts a little too much. What do you think about below approach. I moved the capability of raising and removing toast to notifications.ts. I think this preserves separation of concerns. It seems to be working well also. I have raised a small PR with suggested changes : kqualters-elastic#9.

See if makes sense and if it passed your tests.

Screen.Recording.2025-10-15.at.12.30.40.mov

This is much better, will go with this.

@kqualters-elastic kqualters-elastic enabled auto-merge (squash) October 16, 2025 02:22
Copy link
Copy Markdown
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

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

Desk Tested. Working great. Thanks 🚀 .

@kqualters-elastic kqualters-elastic merged commit b622962 into elastic:main Oct 31, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2

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

@elasticmachine
Copy link
Copy Markdown
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
securitySolution 11.0MB 11.0MB +144.0B

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 31, 2025
…on navigation (elastic#239058)

## Summary

issue: elastic#237466

This pr changes the way migration service classes call toasts so that
they can be dismissed as well when a user navigates to the migration
table upon completion.

https://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237

### 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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
(cherry picked from commit b622962)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 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

kibanamachine added a commit that referenced this pull request Oct 31, 2025
…ation on navigation (#239058) (#241397)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Automatic Migrations] Clear migration completion toast notification
on navigation (#239058)](#239058)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Kevin
Qualters","email":"56408403+kqualters-elastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-31T02:58:41Z","message":"[Automatic
Migrations] Clear migration completion toast notification on navigation
(#239058)\n\n## Summary\n\nissue:
https://github.com/elastic/kibana/issues/237466\n\nThis pr changes the
way migration service classes call toasts so that\nthey can be dismissed
as well when a user navigates to the migration\ntable upon
completion.\n\n\nhttps://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237\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\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Jatin Kathuria
<jatin.kathuria@elastic.co>","sha":"b622962eb1ac479a503ab279f836f2d8029b4cbf","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:version","v9.2.0","v9.3.0"],"title":"[Automatic
Migrations] Clear migration completion toast notification on
navigation","number":239058,"url":"https://github.com/elastic/kibana/pull/239058","mergeCommit":{"message":"[Automatic
Migrations] Clear migration completion toast notification on navigation
(#239058)\n\n## Summary\n\nissue:
https://github.com/elastic/kibana/issues/237466\n\nThis pr changes the
way migration service classes call toasts so that\nthey can be dismissed
as well when a user navigates to the migration\ntable upon
completion.\n\n\nhttps://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237\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\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Jatin Kathuria
<jatin.kathuria@elastic.co>","sha":"b622962eb1ac479a503ab279f836f2d8029b4cbf"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239058","number":239058,"mergeCommit":{"message":"[Automatic
Migrations] Clear migration completion toast notification on navigation
(#239058)\n\n## Summary\n\nissue:
https://github.com/elastic/kibana/issues/237466\n\nThis pr changes the
way migration service classes call toasts so that\nthey can be dismissed
as well when a user navigates to the migration\ntable upon
completion.\n\n\nhttps://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237\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\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Jatin Kathuria
<jatin.kathuria@elastic.co>","sha":"b622962eb1ac479a503ab279f836f2d8029b4cbf"}}]}]
BACKPORT-->

Co-authored-by: Kevin Qualters <56408403+kqualters-elastic@users.noreply.github.com>
Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
ana-davydova pushed a commit to ana-davydova/kibana that referenced this pull request Nov 3, 2025
…on navigation (elastic#239058)

## Summary

issue: elastic#237466

This pr changes the way migration service classes call toasts so that
they can be dismissed as well when a user navigates to the migration
table upon completion.


https://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237



### 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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
albertoblaz pushed a commit to albertoblaz/kibana that referenced this pull request Nov 4, 2025
…on navigation (elastic#239058)

## Summary

issue: elastic#237466

This pr changes the way migration service classes call toasts so that
they can be dismissed as well when a user navigates to the migration
table upon completion.


https://github.com/user-attachments/assets/dd47e9b4-6c8e-4749-8ae7-4a71b5b4e237



### 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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
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:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v9.2.0 v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants