Skip to content

[Security Solution] render graph in new tools flyout in Security Solution and Discover#268471

Closed
DennisKo wants to merge 9 commits into
elastic:mainfrom
DennisKo:denniskorsch/graph-tools-flyout
Closed

[Security Solution] render graph in new tools flyout in Security Solution and Discover#268471
DennisKo wants to merge 9 commits into
elastic:mainfrom
DennisKo:denniskorsch/graph-tools-flyout

Conversation

@DennisKo
Copy link
Copy Markdown
Contributor

@DennisKo DennisKo commented May 8, 2026

Summary

#251806
#266160

This is a big PR. I've looked into splitting it but it just gets unnecessarily complex IMO. We have 3 big main files: graph_preview_container.tsx, use_graph_preview.ts and graph_visualization.tsx which make up almost the whole complexity. I think its reviewable :)

Code changes

The PR focuses on the graph component, which is an item opened from the GraphPreview component, under the Visualizations section in the alert flyout. Current graph is opened in the expanded section of our flyout, but in the new EUI flyout system we will be opening it as a tools flyout.

Here are the main changes introduced here:

  • create a new Graph component (flyout_v2/graph/) that is rendered as a tools flyout via overlays.openSystemFlyout
  • create a new flyout_v2 GraphPreviewContainer that wraps the existing shared graph preview, derives event/timestamp/actor/target params from a DataTableRecord, and triggers the tools flyout via an onShowGraph callback
  • replace the legacy context-based useGraphPreview with a hit-based version (flyout_v2/document/hooks/use_graph_preview.ts) that derives all graph parameters from a DataTableRecord instead of useDocumentDetailsContext
  • wire the Graph preview + tools flyout into VisualizationsSection, alongside Session view and Analyzer
  • add EntityStoreEuidApiProvider to the shared flyoutProviders stack so EUID-derived actor/target source fields resolve inside system flyout overlays (Security Solution and Discover)

The shared graph preview/visualization components and the useGraphPreview hook have been consolidated into flyout_v2/ (under flyout_v2/document/ and flyout_v2/graph/). The legacy expandable-flyout code paths (flyout/document_details/right/components/visualizations_section.tsx and flyout/document_details/left/components/graph_visualization.tsx) now import these consolidated modules from flyout_v2/, so the old flyout continues to render the graph the same way when the feature flag is off. useNavigateToGraphVisualization remains in place to drive the legacy expandable section.

Screen.Recording.2026-05-09.at.00.10.23.mov

UI changes

The UI of the current alert/event flyouts (using the expandable flyout framework) in Security Solution should remain unchanged after this PR (when the feature flag is off).

When the feature flag is on, the new flyout shows the graph preview under Visualizations, and clicking the expand control opens the new Graph tools flyout with the full graph investigation view.

The UI of the current document flyout in Discover should remain unchanged after this PR (when the experimental profile is off). With the enhanced security document profile enabled, the Graph preview and tools flyout render under the OneDiscover bridge as well.

How to test

To see the new flyout in Security Solution, add this to your kibana.dev.yml file:

xpack.securitySolution.enableExperimental: [ 'newFlyoutSystemEnabled' ]

To see the new flyout in Discover, add this to your kibana.dev.yml file:

discover.experimental.enabledProfiles: [ 'enhanced-security-document-profile' ]

What to look for when testing

  • verify that the Visualizations section on the Security Solution side has not changed in the expandable flyout (newFlyoutSystemEnabled feature flag off)
  • verify that the Graph preview shows up in the new flyout under Visualizations (newFlyoutSystemEnabled feature flag on) when the document has graph data and the entity store v2 is running
  • verify that clicking the expand control on the Graph preview opens the Graph tools flyout
  • verify that the Graph preview and tools flyout show up in Discover for alert documents with the enhanced security document profile enabled

Closes #251806

Checklist

@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

@DennisKo
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@DennisKo
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

DennisKo and others added 9 commits May 12, 2026 15:48
…tion and Discover

Add a Graph tools flyout to the Flyout v2 system, mirroring the analyzer
migration. The Graph preview surfaces under Visualizations and opens a
dedicated tools flyout with the full graph view; both work in Security
Solution and in Discover via the OneDiscover bridge.
Drop the unnecessary `as string` cast on EVENT_KIND, remove the
trivial iconType useMemo and unused renderingId in the graph preview
container, and port the EUID-coverage scenarios from the deleted
legacy use_graph_preview test (missing actor/target/event-ids/
timestamp/action, multi-field aggregation, user/host/service/generic
EUID source fields).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- git mv use_should_show_graph + use_is_entity_store_v2_available
  from flyout/shared/hooks/ to flyout_v2/graph/hooks/ (removes the
  reverse v2->legacy dep from use_graph_preview).
- fold entity-mode into the v2 graph_preview_container via a
  discriminated union; entity_details now consumes the v2 container
  directly. Delete the legacy shim and its tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@DennisKo DennisKo force-pushed the denniskorsch/graph-tools-flyout branch from 6e58c56 to db8474c Compare May 12, 2026 13:53
@DennisKo DennisKo closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security Solution][OneDiscover][Tools flyout] graph

1 participant