[SecuritySolution] [Bug] Hide timeline for priv mon onboarding#225442
[SecuritySolution] [Bug] Hide timeline for priv mon onboarding#225442machadoum merged 7 commits intoelastic:mainfrom
Conversation
605c153 to
9833feb
Compare
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-entity-analytics (Team:Entity Analytics) |
9833feb to
8650cf4
Compare
There was a problem hiding this comment.
Just my 2 cents but adding more logic to the already too complex useUrlState isn't a great idea... We're actually currently investigating an issue with this code (see this ticket), and recently some changes were made because things were not happening in the right order.
I'm just saying that adding even more logic to this is maybe risky?
Also I think we need to be careful when wanting to add url parameters. These will stay for a very long time, and when we want to remove them we still need to keep code for months or potentially years as we need to support previously customer saved or bookmarked urls.
To me it seems that adding a new url parameter just for one page isn't the right move. I'm not familiar with the privileged user monitoring page, but it does not look like it's a page that would be as commonly used as the rules page, the alerts page or discover for example?
Also, we already have a way to hide Timeline from a page, via the LinkItem. Couldn't this be leveraged here? To my knowledge, it is used on every page in Kibana.
|
Hey @PhilippeOberti, I understand your concerns. I already discussed this with Pablo before. Some context: They have this page in the
They can not use the I was not aware of the problems with the urlState, but I see this entry is not adding any action. Actually, we could accomplish the same thing without using useState, just using navigation, but
Agree, but this is not a search parameter or anything critical about the page behaviour, like we have on Alerts, Flyout.... It's just hiding something that does not make sense to show. Deprecating and ignoring this parameter would not cause a big issue. I think this approach is simple and just works, it solves the problem. It's not fancy, but practical and reusable. Another solution could be creating a new Redux action and a new state prop to force the timeline bar not to render. But that is more complex and would imply more changes. wdyt? |
Thanks for the explanation, I did not know that!
I don't like it, but I also do not have an alternative to suggest 😆
I'm not going to block this PR, but I'll let someone else in my team approve if that's ok with y'all 😄 |
|
@PhilippeOberti |
I know and I'm sorry. I cannot think of an alternative... I just wanted to raise my concerns that's it. If that's the best option we have, then let's merge it! |
|
I think one problem with
I think problem with this approach is that if a state is changed to I can think of one alternative which does not touch timeline at all. Can't we have 2 different routes:
@semd , @machadoum , do you think this is viable? |
|
Hacky but simpler: in EntityAnalyticsPrivilegedUserMonitoringPage |
|
Comparing this branch with main, this linkUpdater causes some more re-renders of the SecuritySideNav and related hooks, and given how fragile the current logic is to render ordering (see: this bug: #225650 , and happy to talk about others if you want), we should imo use the css approach with the useEffect above to not introduce any other unintended side effects. Hooks based architecture where everything is tied into the component lifecycle is brittle enough as is, using observables from a nested useEffect makes everything more brittle, and since this is just being added to fix a css bug, should be fixed as close to that as possible. |
This sounds quite surprising to me, because Sergi's changes shouldn't impact any rerender unless the links config is explicitly updated, which only happens on the Privileged User monitoring page. I ran some tests and was unable to reproduce the increase in rerenders. I tested the render method of 2 components when the security solution is fully loaded, and we navigate from a landing page to any of the following pages:
@kqualters-elastic, please let me know how you tested it. I want to investigate why it happens. |
|
@machadoum ya I would expect any navigation to a new route to be the same, what is different is when you are on the same route, and update the state.type that the effect depends upon via one of the reducer actions, doesn't matter how. |
|
@machadoum made this branch: https://github.com/kqualters-elastic/kibana/tree/use-effect-observable-fun added 2 buttons to the top, but just have an onClick prop that's a useCallback. 1 is the logic in the effect that calls the appLinks observable, 2 is the css based approach. This is a gif of the profiler when the updater ran, you can see that it was in fact caused by that, and then subsequently all sorts of potentially impactful things happen, history changes, state syncing hooks, etc. |
|
@kqualters-elastic I see. Indeed, the CSS is much quicker for hiding and showing the timeline. However, it also has some drawbacks, such as being an additional source of truth for hiding or displaying the timeline, which could make debugging more difficult when an error occurs. And be more brittle, since it depends on internal timeline CSS selectors, and in the unlikely scenario of an unexpected error, it could hide the timeline for all pages. I am okay with both solutions; each one has its pros and cons. I will leave the decision for the @elastic/security-threat-hunting-investigations team. Please let me know which one you prefer. |
|
Maybe we could utilize route state here? No extra url params, just in memory. @machadoum https://v5.reactrouter.com/web/api/Link/to-object |
@machadoum that applies to any solution where we are showing/hiding the timeline from a component instead of in the link definitions.
it's a single static top level attribute that all the tests rely on that's always rendered when timeline is, and changing the styles of the timeline is not going to create any side effects, works fine with class based emotion, whereas the observable approach triggers a whole cascading chain of updates, in components that are known to be very codependent on rendering order. In my opinion it's an easy choice, but it's up to you really. Is there an issue or screenshots with the original css issue? |
|
I will keep this PR open until the team responsible for the timeline makes a call. Since I am not responsible for maintaining the timeline and won't be on call for SDHs, I don't feel comfortable making the decision. |
|
I'm replying here to ensure my point is clear. I don't mind implementing the CSS approach if that is the recommendation from the investigation team.
I disagree with the statement, because if we hide the timeline using the same approach, it is already being used on other pages (like the config), the hook Only three places depend on
|
I tested this approach, and it doesn't work consistently. I haven't delved much into it, but it is probably due to the React rendering order. If the timeline is rendered after we switch its style property, it will overwrite the changes. Screen.Recording.2025-07-07.at.09.24.22.movPlease let me know how to proceed. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
cc @machadoum |
|
Starting backport for target branches: 9.1 https://github.com/elastic/kibana/actions/runs/16286635677 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…ic#225442) ## Summary Fix the bug that caused the timeline to overlap with the onboarding components on the privileged user monitoring page. Since the timeline is not required on an onboarding page, we decided to hide it. For now, I decided to implement the simplest change to fix the bug, which is adding a URL param (`hideTimeline`) exclusively for hiding the timeline. I also considered updating the existing `timeline` URL parameter, but that seems too complicated for a bug fix, especially since it would require updating the timeline Redux store, which already has a `show` property used for other purposes. If this use case becomes widely used, we can refactor it to be part of the timeline core implementation. ### 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) --------- Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co> (cherry picked from commit fbbef67)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…225442) (#228252) # Backport This will backport the following commits from `main` to `9.1`: - [[SecuritySolution] [Bug] Hide timeline for priv mon onboarding (#225442)](#225442) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Pablo Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T07:13:36Z","message":"[SecuritySolution] [Bug] Hide timeline for priv mon onboarding (#225442)\n\n## Summary\n\nFix the bug that caused the timeline to overlap with the onboarding\ncomponents on the privileged user monitoring page.\nSince the timeline is not required on an onboarding page, we decided to\nhide it.\n\nFor now, I decided to implement the simplest change to fix the bug,\nwhich is adding a URL param (`hideTimeline`) exclusively for hiding the\ntimeline. I also considered updating the existing `timeline` URL\nparameter, but that seems too complicated for a bug fix, especially\nsince it would require updating the timeline Redux store, which already\nhas a `show` property used for other purposes. If this use case becomes\nwidely used, we can refactor it to be part of the timeline core\nimplementation.\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\n---------\n\nCo-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>","sha":"fbbef6723787cf73321ce4e8cb48e26d70867b7f","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","backport missing","Team: SecuritySolution","Theme: entity_analytics","Feature:Entity Analytics","Team:Entity Analytics","backport:version","v9.1.0","v9.2.0"],"title":"[SecuritySolution] [Bug] Hide timeline for priv mon onboarding","number":225442,"url":"https://github.com/elastic/kibana/pull/225442","mergeCommit":{"message":"[SecuritySolution] [Bug] Hide timeline for priv mon onboarding (#225442)\n\n## Summary\n\nFix the bug that caused the timeline to overlap with the onboarding\ncomponents on the privileged user monitoring page.\nSince the timeline is not required on an onboarding page, we decided to\nhide it.\n\nFor now, I decided to implement the simplest change to fix the bug,\nwhich is adding a URL param (`hideTimeline`) exclusively for hiding the\ntimeline. I also considered updating the existing `timeline` URL\nparameter, but that seems too complicated for a bug fix, especially\nsince it would require updating the timeline Redux store, which already\nhas a `show` property used for other purposes. If this use case becomes\nwidely used, we can refactor it to be part of the timeline core\nimplementation.\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\n---------\n\nCo-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>","sha":"fbbef6723787cf73321ce4e8cb48e26d70867b7f"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225442","number":225442,"mergeCommit":{"message":"[SecuritySolution] [Bug] Hide timeline for priv mon onboarding (#225442)\n\n## Summary\n\nFix the bug that caused the timeline to overlap with the onboarding\ncomponents on the privileged user monitoring page.\nSince the timeline is not required on an onboarding page, we decided to\nhide it.\n\nFor now, I decided to implement the simplest change to fix the bug,\nwhich is adding a URL param (`hideTimeline`) exclusively for hiding the\ntimeline. I also considered updating the existing `timeline` URL\nparameter, but that seems too complicated for a bug fix, especially\nsince it would require updating the timeline Redux store, which already\nhas a `show` property used for other purposes. If this use case becomes\nwidely used, we can refactor it to be part of the timeline core\nimplementation.\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\n---------\n\nCo-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>","sha":"fbbef6723787cf73321ce4e8cb48e26d70867b7f"}}]}] BACKPORT--> Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
…ic#225442) ## Summary Fix the bug that caused the timeline to overlap with the onboarding components on the privileged user monitoring page. Since the timeline is not required on an onboarding page, we decided to hide it. For now, I decided to implement the simplest change to fix the bug, which is adding a URL param (`hideTimeline`) exclusively for hiding the timeline. I also considered updating the existing `timeline` URL parameter, but that seems too complicated for a bug fix, especially since it would require updating the timeline Redux store, which already has a `show` property used for other purposes. If this use case becomes widely used, we can refactor it to be part of the timeline core implementation. ### 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) --------- Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
…ic#225442) ## Summary Fix the bug that caused the timeline to overlap with the onboarding components on the privileged user monitoring page. Since the timeline is not required on an onboarding page, we decided to hide it. For now, I decided to implement the simplest change to fix the bug, which is adding a URL param (`hideTimeline`) exclusively for hiding the timeline. I also considered updating the existing `timeline` URL parameter, but that seems too complicated for a bug fix, especially since it would require updating the timeline Redux store, which already has a `show` property used for other purposes. If this use case becomes widely used, we can refactor it to be part of the timeline core implementation. ### 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) --------- Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>

Summary
Fix the bug that caused the timeline to overlap with the onboarding components on the privileged user monitoring page.
Since the timeline is not required on an onboarding page, we decided to hide it.
For now, I decided to implement the simplest change to fix the bug, which is adding a URL param (
hideTimeline) exclusively for hiding the timeline. I also considered updating the existingtimelineURL parameter, but that seems too complicated for a bug fix, especially since it would require updating the timeline Redux store, which already has ashowproperty used for other purposes. If this use case becomes widely used, we can refactor it to be part of the timeline core implementation.Checklist
release_note:*label is applied per the guidelines