Skip to content

[Security Solution] insights overview flyout v2#268538

Open
DennisKo wants to merge 9 commits intoelastic:mainfrom
DennisKo:flyout-v2/entities-overview-render
Open

[Security Solution] insights overview flyout v2#268538
DennisKo wants to merge 9 commits intoelastic:mainfrom
DennisKo:flyout-v2/entities-overview-render

Conversation

@DennisKo
Copy link
Copy Markdown
Contributor

@DennisKo DennisKo commented May 8, 2026

Summary

#251817

First of two PRs. This one adds the entities overview to the Flyout v2 Insights section as a render-only change — every click handler is just text for now. The follow-up PR wires those handlers to the entity-details, alerts, misconfigurations and vulnerabilities tools flyouts.

Code changes

  • git mv the EntitiesOverview, HostEntityOverview, and UserEntityOverview components from flyout/document_details/right/components/ into flyout_v2/document/components/.
  • Decouple the components from useDocumentDetailsContext: inputs are passed through props (hit: DataTableRecord, scopeId, renderCellActions, optional onShow* callbacks). dataAsNestedObject is fetched internally via useEventDetails when not supplied so the legacy expandable flyout keeps avoiding the duplicate fetch.
  • Render EntitiesOverview inside the Flyout v2 InsightsSection as text (no links).
  • Update the legacy expandable flyout's right InsightsSection and the HOST_PREVIEW_BANNER / USER_PREVIEW_BANNER consumers ({host,user}_details.tsx, link_utils.ts, related test files) to import from the new location.
  • Move the related test_ids constants from document_details/right/components/test_ids.ts to flyout_v2/document/components/test_ids.ts.
Screen.Recording.2026-05-08.at.22.12.12.mov

UI changes

  • Legacy expandable flyout (flag off): Insights → Entities renders identically to main. Clicking the section title still opens the left-panel Entities tab; clicking host/user names still opens the legacy preview panel.
  • Flyout v2 (flag on): the Insights section now contains the entities sub-panel showing host/user data, alert counts, misconfigurations and vulnerabilities chips. Every click on this sub-panel is just text A follow-up PR will wire them.
  • Discover: same render-only behavior as Flyout v2.

How to test

Add to kibana.dev.yml:

xpack.securitySolution.enableExperimental: [ 'newFlyoutSystemEnabled' ]

What to look for when testing

  • Insights → Entities section in the legacy expandable flyout renders identically to main and all legacy click behaviors still work (flag off).
  • New flyout Insights section renders the entities sub-panel; clicking the section title, host name, user name, alerts chip, misconfig chip, and vulnerability chip does nothing (no console errors, no overlay opens).
  • Discover shows the entities sub-panel; clicks are inert.

Move and refactor `entities_overview`, `host_entity_overview`, and
`user_entity_overview` from `flyout/document_details/right/components/`
to `flyout_v2/document/components/`. Decouple from
`useDocumentDetailsContext`; accept `hit: DataTableRecord`, `scopeId`,
`renderCellActions`, and optional `onShow*` callbacks via props so the
components can be reused by Discover via the
`enhanced-security-document-profile` profile.

Render `EntitiesOverview` inside the flyout v2 `InsightsSection` with
no-op `onShow*` callbacks for now — a follow-up will wire the entity
details / alerts / misconfigurations / vulnerabilities tools flyouts.

Update the legacy expandable flyout's right `InsightsSection` and
`{host,user}_details.tsx` to import from the new location; the legacy
UX is unchanged when the `newFlyoutSystemEnabled` flag is off.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DennisKo and others added 2 commits May 8, 2026 21:45
Flyout v2 has no destination for the entity / alerts / misconfigurations /
vulnerabilities navigation, so the v2 InsightsSection passed `noop` callbacks
which still produced clickable EuiLinks. Drop those callbacks entirely and
render the entity name and finding counts as plain text when no handler is
provided.

- Make `openDetailsPanel` optional on AlertCountInsight, MisconfigurationsInsight,
  and VulnerabilitiesInsight; render plain count text when omitted.
- In v2 user/host entity overviews, render the name as plain text instead of a
  PreviewLink fallback when no `onShowDetails` is provided, and stop wiring
  navigateTo*Details for the chip insights.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DennisKo DennisKo changed the title [Security Solution] render entities overview in new document flyout [Security Solution] render insights overview in new document flyout May 8, 2026
@DennisKo DennisKo changed the title [Security Solution] render insights overview in new document flyout [Security Solution] render insights overview flyout v2 May 8, 2026
@DennisKo DennisKo changed the title [Security Solution] render insights overview flyout v2 [Security Solution] insights overview flyout v2 May 8, 2026
@DennisKo DennisKo marked this pull request as ready for review May 9, 2026 00:12
@DennisKo DennisKo requested a review from a team as a code owner May 9, 2026 00:12
@DennisKo DennisKo added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Threat Hunting Security Solution Threat Hunting Team labels May 9, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

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

@DennisKo DennisKo added the v9.5.0 label May 9, 2026
DennisKo and others added 4 commits May 9, 2026 03:00
Drop the prop-drilled onShow{User,Host}Details/Alerts/Misconfigurations/
Vulnerabilities callbacks on EntitiesOverview and the inner host/user
overviews. Sub-overviews now own their own preview navigation via
PreviewLink and useNavigateTo{Host,User}Details, gated by a single
enableEntityLinks boolean. The legacy expandable flyout opts in;
Flyout v2 and Discover leave it off so entities render as plain text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move data-test-subj from the wrapping EuiFlexItem onto PreviewLink /
  inner EuiText so .click() on the test target reaches the EuiLink
  onClick (was preventing openPreviewPanel from firing).
- Add the missing `false` default to useUiSetting(FF_ENABLE_ENTITY_STORE_V2)
  in user_entity_overview to match the host pattern.
- Drop the blanket @kbn/kibana-react-plugin/public useUiSetting=false mock
  in user_entity_overview.test; since common/lib/kibana switched from
  automock to requireActual it was hijacking useDateFormat and producing
  raw ISO timestamps instead of the configured display format.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EntitiesOverview is now the single entity-store fetcher for both host
and user. Add a legacy host.name fallback symmetric to user, and drop
the redundant self-fetch from HostEntityOverview so it follows the
prop-only pattern UserEntityOverview already uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DennisKo
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

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 12.0MB 12.1MB +2.0KB

History

@DennisKo DennisKo added the reviewer:coderabbit PR review with CodeRabbit label May 11, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 8ff1e0b2-04fa-4427-a72c-9049c19ce7e4

📥 Commits

Reviewing files that changed from the base of the PR and between 8ef3b44 and b9c43b2.

📒 Files selected for processing (28)
  • x-pack/platform/plugins/private/translations/translations/de-DE.json
  • x-pack/platform/plugins/private/translations/translations/fr-FR.json
  • x-pack/platform/plugins/private/translations/translations/ja-JP.json
  • x-pack/platform/plugins/private/translations/translations/zh-CN.json
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout/shared/utils/link_utils.ts
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/entities_overview.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/entities_overview.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/highlighted_fields_cell.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/host_entity_overview.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/host_entity_overview.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/insights_section.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/insights_section.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/test_ids.ts
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/user_entity_overview.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/flyout_v2/document/components/user_entity_overview.tsx
💤 Files with no reviewable changes (6)
  • x-pack/platform/plugins/private/translations/translations/de-DE.json
  • x-pack/platform/plugins/private/translations/translations/ja-JP.json
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx
  • x-pack/platform/plugins/private/translations/translations/zh-CN.json
  • x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts
  • x-pack/platform/plugins/private/translations/translations/fr-FR.json

📝 Walkthrough

Walkthrough

This PR migrates the Entities overview rendering from the legacy right-panel flyout to flyout_v2 with enhanced configurability. Translation keys for obsolete host/entities/user preview titles are removed across all locales. Shared insight components (AlertCountInsight, MisconfigurationsInsight, VulnerabilitiesInsight) have openDetailsPanel made optional. HostEntityOverview and UserEntityOverview are refactored with new optional props for scopeId, cell-action rendering, and entity linking control. A new EntitiesOverview component is created in flyout_v2 to orchestrate host/user resolution and conditionally render sub-panels. The legacy right-panel EntitiesOverview is removed and all imports updated. Both right-panel and v2 InsightsSections are wired to use the new component with proper data flow. Comprehensive tests validate the new behaviors including default plain-text rendering, conditional linking, and entity-store v2 integration.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting OneDiscover release_note:skip Skip the PR/issue when compiling release notes reviewer:coderabbit PR review with CodeRabbit Team:Threat Hunting Security Solution Threat Hunting Team v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants