[Security Solution][Attacks/Alerts][Attacks page][Table section] Remember last selected attack details tab (Summary or Alerts) (#247519)#247988
Conversation
…mber last selected attack details tab (Summary or Alerts) (elastic#247519)
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
PhilippeOberti
left a comment
There was a problem hiding this comment.
Something is not working as I was expected with this implementation. If you look at the video below (recorded with audio) when we do not have anything saved in local storage, we basically default to the summary tab, which means that when expanding the generic group, the Alerts tab (which is the only one available) isn't selected.
Then also this happens when doing some changes to a non generic tab then coming back to the generic tab...
Screen.Recording.2026-01-08.at.3.49.53.PM.mov
While this is not at all a big deal, there is a way to make this work perfectly. I don't think we should set the default to be ATTACK_SUMMARY_TAB all the time. Instead we should set the default value depending on what tabs are rendered. This could be done via a useEffect or maybe better, by following the implementation we do for the alert and attack flyouts. For these, we use a useTabs hooks (respectively this one for alert flyout and that one fpr attack flyout). I think it's an option worth looking into?
|
@PhilippeOberti this PR needs to wait for a discussed changes where we will get rid of tabs for the generic group - Once, we have that done this PR will be simplified to always work with both tabs and there won't be corner cases of some tabs absent. I will mark this PR as draft for now to prioritize reviewing of another one. |
…e-selected-tab # Conflicts: # x-pack/solutions/security/plugins/security_solution/public/detections/components/attacks/table/attack_details/attack_details_container.tsx
PhilippeOberti
left a comment
There was a problem hiding this comment.
Desk tested and code LGTM now that's it's simplified. Thanks for adding this functionality!
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @e40pud |
…mber last selected attack details tab (Summary or Alerts) (elastic#247519) (elastic#247988) ## Summary Closes elastic#247519 The `AttackDetailsContainer` component has been updated to persist the selected tab state in local storage using the `useLocalStorage` hook. This replaces the previous local state implementation. **NOTES**: * Tabs default to `"Attack summary"` tab * If there is no `"Attack summary"` tab for a group (e.g. default `"-"` group), then we fallback to the first existing tab ## Feature Flag > [!NOTE] > The feature is hidden behind the feature flag (in `kibana.dev.yml`): ``` feature_flags.overrides: securitySolution.attacksAlertsAlignment: true ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* commit 'c4304e27736c62f17af20d145770b2ae9d3fae30': (418 commits) skip failing suite (elastic#89079) [ES|QL] Update grammars (elastic#248600) skip failing test suite (elastic#248579) [ES|QL] Update function metadata (elastic#248601) skip failing test suite (elastic#248554) Fix flaky test runner serverless flag for Search solution (elastic#248559) [Security Solution][Attacks/Alerts][Attacks page][Table section] Remember last selected attack details tab (Summary or Alerts) (elastic#247519) (elastic#247988) Fix ES health check poller (elastic#248496) Fix collector schema ownership (elastic#241292) [api-docs] 2026-01-10 Daily api_docs build (elastic#248574) Update dependency cssstyle to v5.3.5 (main) (elastic#237637) Update dependency @octokit/rest to v22.0.1 (main) (elastic#243102) skip failing test suite (elastic#248504) skip failing test suite (elastic#247685) Remove broken ecommerce_dashboard journeys (elastic#248162) [Obs AI] Hide AI Insight component when there are no connectors (elastic#248542) skip failing suite (elastic#248433) [Security Solution][Attacks/Alerts][Attacks page][Table section] Hide tabs for generic attack groups (elastic#248444) [Agent Builder] [AI Infra] Adds product documentation tool and task evals (elastic#248370) [Controls Anywhere] Keep controls focused when creating + editing other panels (elastic#248021) ...
Summary
Closes #247519
The
AttackDetailsContainercomponent has been updated to persist the selected tab state in local storage using theuseLocalStoragehook. This replaces the previous local state implementation.NOTES:
"Attack summary"tab"Attack summary"tab for a group (e.g. default"-"group), then we fallback to the first existing tabFeature Flag
Note
The feature is hidden behind the feature flag (in
kibana.dev.yml):