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

[Fleet] Activity flyout should keep scroll state on rerender #177029

Merged
merged 6 commits into from Feb 19, 2024

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Feb 15, 2024

Summary

Closes #154272

Prevent Agent activity flyout rerender on reloading action status every 30s.

To verify:

  • start local kibana, enroll agents
  • do a few actions: add tags, upgrade, etc.
  • open agent activity and scroll down, open Show errors accordion
  • open local kibana in another browser tab, and perform more actions
  • wait until /action_status calls are made in the background
  • verify that the Agent activity flyout doesn't jump, and scroll state and opened accordion state is preserved
  • verify that the new action is visible on the opened flyout
agent_activity_load.mov

Checklist

@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!)

@juliaElastic juliaElastic marked this pull request as ready for review February 15, 2024 15:24
@juliaElastic juliaElastic requested a review from a team as a code owner February 15, 2024 15:24
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Feb 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet self-requested a review February 15, 2024 15:28
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Code LGTM 🚀
I am not sure how complex will be a cypress test for that, Maybe this could best tested with a rerender in a unit test if it's easier no?

@juliaElastic
Copy link
Contributor Author

Code LGTM 🚀 I am not sure how complex will be a cypress test for that, Maybe this could best tested with a rerender in a unit test if it's easier no?

I'll take a look with a unit test first, maybe it can be done to mock an updated /action_status response.

@kpollich
Copy link
Member

We should be able to intercept the /action_status API in Cypress with some mock action results data and assert that the window scroll position doesn't change, or that the same elements are in view before + after the request.

@kibana-ci
Copy link
Collaborator

💚 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
fleet 1.2MB 1.2MB +253.0B

History

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

cc @juliaElastic

@juliaElastic juliaElastic merged commit dc94c1c into elastic:main Feb 19, 2024
20 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2024
…#177029)

## Summary

Closes elastic#154272

Prevent Agent activity flyout rerender on reloading action status every
30s.

To verify:
- start local kibana, enroll agents
- do a few actions: add tags, upgrade, etc.
- open agent activity and scroll down, open Show errors accordion
- open local kibana in another browser tab, and perform more actions
- wait until `/action_status` calls are made in the background
- verify that the Agent activity flyout doesn't jump, and scroll state
and opened accordion state is preserved
- verify that the new action is visible on the opened flyout

https://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c

### 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 dc94c1c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.13

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

Questions ?

Please refer to the Backport tool documentation

awahab07 pushed a commit to awahab07/kibana that referenced this pull request Feb 19, 2024
…#177029)

## Summary

Closes elastic#154272

Prevent Agent activity flyout rerender on reloading action status every
30s.

To verify:
- start local kibana, enroll agents
- do a few actions: add tags, upgrade, etc. 
- open agent activity and scroll down, open Show errors accordion
- open local kibana in another browser tab, and perform more actions
- wait until `/action_status` calls are made in the background
- verify that the Agent activity flyout doesn't jump, and scroll state
and opened accordion state is preserved
- verify that the new action is visible on the opened flyout 




https://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c




### 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 added a commit that referenced this pull request Feb 21, 2024
…177029) (#177173)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Fleet] Activity flyout should keep scroll state on rerender
(#177029)](#177029)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-02-19T11:34:14Z","message":"[Fleet]
Activity flyout should keep scroll state on rerender (#177029)\n\n##
Summary\r\n\r\nCloses
#154272 Agent
activity flyout rerender on reloading action status
every\r\n30s.\r\n\r\nTo verify:\r\n- start local kibana, enroll
agents\r\n- do a few actions: add tags, upgrade, etc. \r\n- open agent
activity and scroll down, open Show errors accordion\r\n- open local
kibana in another browser tab, and perform more actions\r\n- wait until
`/action_status` calls are made in the background\r\n- verify that the
Agent activity flyout doesn't jump, and scroll state\r\nand opened
accordion state is preserved\r\n- verify that the new action is visible
on the opened flyout
\r\n\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"dc94c1cde9c64d135e5e25e54b4daa93b901e9c9","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v8.13.0","v8.14.0"],"title":"[Fleet]
Activity flyout should keep scroll state on
rerender","number":177029,"url":"#177029
Activity flyout should keep scroll state on rerender (#177029)\n\n##
Summary\r\n\r\nCloses
#154272 Agent
activity flyout rerender on reloading action status
every\r\n30s.\r\n\r\nTo verify:\r\n- start local kibana, enroll
agents\r\n- do a few actions: add tags, upgrade, etc. \r\n- open agent
activity and scroll down, open Show errors accordion\r\n- open local
kibana in another browser tab, and perform more actions\r\n- wait until
`/action_status` calls are made in the background\r\n- verify that the
Agent activity flyout doesn't jump, and scroll state\r\nand opened
accordion state is preserved\r\n- verify that the new action is visible
on the opened flyout
\r\n\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"dc94c1cde9c64d135e5e25e54b4daa93b901e9c9"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#177029
Activity flyout should keep scroll state on rerender (#177029)\n\n##
Summary\r\n\r\nCloses
#154272 Agent
activity flyout rerender on reloading action status
every\r\n30s.\r\n\r\nTo verify:\r\n- start local kibana, enroll
agents\r\n- do a few actions: add tags, upgrade, etc. \r\n- open agent
activity and scroll down, open Show errors accordion\r\n- open local
kibana in another browser tab, and perform more actions\r\n- wait until
`/action_status` calls are made in the background\r\n- verify that the
Agent activity flyout doesn't jump, and scroll state\r\nand opened
accordion state is preserved\r\n- verify that the new action is visible
on the opened flyout
\r\n\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"dc94c1cde9c64d135e5e25e54b4daa93b901e9c9"}}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…#177029)

## Summary

Closes elastic#154272

Prevent Agent activity flyout rerender on reloading action status every
30s.

To verify:
- start local kibana, enroll agents
- do a few actions: add tags, upgrade, etc. 
- open agent activity and scroll down, open Show errors accordion
- open local kibana in another browser tab, and perform more actions
- wait until `/action_status` calls are made in the background
- verify that the Agent activity flyout doesn't jump, and scroll state
and opened accordion state is preserved
- verify that the new action is visible on the opened flyout 




https://github.com/elastic/kibana/assets/90178898/5312168b-2217-44f6-81ff-1b0306fb485c




### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v8.13.0 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Agent activity list jumps to the top when new data arrives (every 30s)
7 participants