Skip to content

[SigEvents] Redesign the Nightshift significant event flyout - #299456

Merged
achyutjhunjhunwala merged 4 commits into
elastic:mainfrom
achyutjhunjhunwala:nightshift/detection-event-flyout
Oct 22, 2026
Merged

achyutjhunjhunwala merged 4 commits into
elastic:mainfrom
achyutjhunjhunwala:nightshift/detection-event-flyout

Conversation

@achyutjhunjhunwala

@achyutjhunjhunwala achyutjhunjhunwala commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

closes https://github.com/elastic/nightshift-program/issues/1940

Match the redesigned significant event flyout while keeping the existing investigation, chat, and status actions.

  • Add Overview and Timeline tabs with severity, confidence, and status badges.
  • Show a linked investigation card and the five earliest detections in Overview.
  • Consolidate investigation, chat, and mark-inactive actions into one Actions menu.
  • Persist running investigations and terminal outcomes; show failed runs as Failed.
  • Wait for server-recorded completion so read errors and stale follow-up results cannot stop polling early.

How to test

  1. Open Nightshift → Detections → Events and open a significant event. Check the header badges and Overview sections.
  2. Open Timeline. Confirm detections run earliest first and the significant event appears last. Click a detection twice to open and close its child flyout. Click the event title to return to Overview.
  3. Open an event with an investigation. Click its investigation card and confirm the investigation opens. Check that events without an investigation omit the card.
  4. From Actions, run an investigation. Confirm the flyout and table show In progress immediately, retain that state after a reload, and show Completed when the run succeeds. Run a follow-up and confirm the previous result does not immediately complete the new round.
  5. Cause an investigation to fail. Confirm its card shows Failed. Start a follow-up and confirm the card returns to In progress.
  6. Simulate a temporary 5xx when reading a running investigation. Confirm it does not mark the event investigation Completed or stop event polling early.
  7. Check chat actions and Mark inactive. With read-only access or a paused engine, verify the available actions and disabled-state explanations.
  8. Expand an event with more than five detections. Open another event and confirm it starts on Overview with the first five detections visible.

Demo

Oct-21-2026 15-45-54

@achyutjhunjhunwala achyutjhunjhunwala self-assigned this Oct 21, 2026
@achyutjhunjhunwala achyutjhunjhunwala added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:nightshift-sre-agent Feature: Nightshift Context Engine Nightshift Context Engine is the memory layer every other engine draws on labels Oct 21, 2026
@achyutjhunjhunwala
achyutjhunjhunwala force-pushed the nightshift/detection-event-flyout branch from 2bc31a3 to a6fb62f Compare October 21, 2026 13:21
@achyutjhunjhunwala
achyutjhunjhunwala marked this pull request as ready for review October 21, 2026 13:56
@achyutjhunjhunwala
achyutjhunjhunwala requested a review from a team as a code owner October 21, 2026 13:56
Comment on lines +28 to +32
const cutoff = Date.now() - 65 * 60 * 1000;
return events.some(({ investigations }) =>
investigations?.some(
({ completed_at: completedAt, started_at: startedAt }) =>
completedAt == null && Date.parse(startedAt) > cutoff

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Severity: P3 (Low)

Reconcile timed-out investigations before permanently stopping their polling. The managed investigation workflow has a 60-minute timeout and explicitly does not execute its failure fallback on timeout or cancellation, so those runs emit neither terminal attachment. With the new persisted running entry, this cutoff leaves them permanently “In progress,” including after reload, rather than recording a terminal state.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this is the existing workflow timeout/cancellation lifecycle gap. As the managed workflow documents, those terminal paths do not run its failure fallback.

We documented the Significant Events impact, source links, terminal-handling requirements, and suggested regression coverage here:
https://github.com/elastic/nightshift-program/issues/1820#issuecomment-6319878416

This requires engine-backed terminal reconciliation, coordinated with retry/recovery, and is being tracked as separate lifecycle work. The related event-reader work is linked here:
https://github.com/elastic/nightshift-program/issues/1838#issuecomment-6319878431

The 65-minute cutoff only bounds polling; it does not record a terminal outcome.

Comment on lines +424 to +429
eventSearchClient: eventClient,
eventId: params.path.id,
investigation: {
workflow_execution_id: executionId,
started_at: new Date().toISOString(),
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Severity: P2 (Medium)

Keep queued follow-ups distinguishable from the run already executing. start() returns the same conversation ID for a follow-up, and the investigation workflow queues runs on that ID. If a user queues a follow-up while the first run is active, the first run's completion replaces this newly written running entry because attachInvestigationToEvent matches only workflow_execution_id. The event then appears completed and stops polling throughout the queued follow-up, since its later started event is not attached. Track the run/generation or otherwise preserve pending rounds when processing terminal callbacks.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this identifies the existing conversation/run identity gap in the shared investigation lifecycle. Follow-ups share a conversation ID, while terminal callbacks do not distinguish individual runs.

We reproduced the attachment-ordering cases and documented the findings, source links, proposed fix direction, and regression coverage here:
https://github.com/elastic/nightshift-program/issues/1838#issuecomment-6319878431

We are tracking run-aware queued-follow-up handling as separate lifecycle work under that issue, coordinated with terminal reconciliation in:
https://github.com/elastic/nightshift-program/issues/1820#issuecomment-6319878416

@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Oct 21, 2026
@infra-vault-gh-plugin-prod

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
nightshift 614.8KB 602.6KB -12.2KB
significantEventsApp 140.2KB 140.2KB -59.0B
total -12.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 5.4MB 5.4MB +4.0B
shared-packages 5.2MB 5.2MB +140.0B
total +144.0B
Unknown metric groups

shared chunks total size

id before after diff
all 7.5MB 7.5MB +1.0B

total optimizer output size

id before after diff
all 67.1MB 67.1MB -12.1KB

warm start memory

id before after diff
post forced gc heap baseline - 720956068 +720956068
post forced gc heap delta - -1827528 -1827528
post forced gc heap delta standard deviation - 2042941 +2042941
post forced gc heap target - 719128540 +719128540
tail heap delta - -8399756 -8399756
total +1431900265

workflow yaml validation

id before after diff
case_response.yaml (27 steps, 66 vars)/e2e/collectAllVariables 0 1 +1
case_response.yaml (27 steps, 66 vars)/e2e/performComputation 12 13 +1
case_response.yaml (27 steps, 66 vars)/e2e/total 16 17 +1
case_response.yaml (27 steps, 66 vars)/validateVariables (66 vars) 1 2 +1
infosec_demo.yaml (150 steps, 270 vars)/e2e/performComputation 48 53 +5
infosec_demo.yaml (150 steps, 270 vars)/e2e/total 113 137 +24
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateIfConditions 5 6 +1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateLiquidTemplate 5 6 +1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateVariables 38 51 +13
infosec_demo.yaml (150 steps, 270 vars)/validateIfConditions 4 6 +2
infosec_demo.yaml (150 steps, 270 vars)/validateVariables (270 vars) 36 48 +12
total +62

Test Failures

  • [job] [logs] Scout Lane #71 - serverless-observability_complete / alerting_v2 / local-serverless-observability_complete - Alerts page - read/write privileges - editor sees the mutating episode actions menu
  • [job] [logs] Scout Lane #71 - serverless-observability_complete / alerting_v2 / local-serverless-observability_complete - ComposeDiscoverFlyout — create and edit flows - edit flow (sad path): a rule with no resolvable time field triggers validation and blocks Next
  • [job] [logs] Scout Lane #7 - stateful-classic / default / local-stateful-classic - Document flyout v2 — alerts page entry - assignees: assigning the current user shows the avatar in the flyout header

History

cc @achyutjhunjhunwala

Comment on lines 229 to +230
const latestInvestigationInProgress =
availableInvestigation != null &&
availableInvestigation.completed_at == null &&
investigationStatus !== 'complete';
availableInvestigation != null && availableInvestigation.completed_at == null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if an investigation goes stale? Checking the hasInvestigationsToPoll function. Will latestInvestigationInProgress be in progress forever?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, without a terminal attachment it remains in progress; the 65-minute cutoff only stops polling. This is the existing timeout/cancellation reconciliation gap, documented here and being tackled as separate lifecycle work: https://github.com/elastic/nightshift-program/issues/1820#issuecomment-6319878416

<FlyoutTemplate.Footer>
<FlyoutTemplate.Footer.PrimaryActionMenu
label={ACTIONS_LABEL}
panels={actionMenuPanels}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this handle empty state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. When no actions are available, we pass panels=[]. FlyoutTemplate.Footer ignores the empty menu and hides the footer when no other actions remain. This exact case is covered by the existing test, which I reran successfully:

it('omits the footer when a menu with empty panels is the only action', () => {
renderTemplate(
<FlyoutTemplate onClose={noop} session="never" data-test-subj="emptyMenu">
<FlyoutTemplate.Body>
<span>content</span>
</FlyoutTemplate.Body>
<FlyoutTemplate.Footer>
<FlyoutTemplate.Footer.PrimaryActionMenu label="Take action" panels={[]} />
</FlyoutTemplate.Footer>
</FlyoutTemplate>
);
expect(screen.queryByTestId('emptyMenuFooter')).not.toBeInTheDocument();

@achyutjhunjhunwala
achyutjhunjhunwala added this pull request to the merge queue Oct 22, 2026
Merged via the queue into elastic:main with commit e34b930 Oct 22, 2026
24 checks passed
@achyutjhunjhunwala
achyutjhunjhunwala deleted the nightshift/detection-event-flyout branch October 22, 2026 11:05
erikcurrin-elastic pushed a commit to erikcurrin-elastic/kibana that referenced this pull request Oct 22, 2026
…#299456)

## Summary

closes elastic/nightshift-program#1940

Match the [redesigned significant event flyout
](https://symmetrical-adventure-2y9no3w.pages.github.io/main/#/alerts)while
keeping the existing investigation, chat, and status actions.

- Add Overview and Timeline tabs with severity, confidence, and status
badges.
- Show a linked investigation card and the five earliest detections in
Overview.
- Consolidate investigation, chat, and mark-inactive actions into one
Actions menu.
- Persist running investigations and terminal outcomes; show failed runs
as Failed.
- Wait for server-recorded completion so read errors and stale follow-up
results cannot stop polling early.

## How to test

1. Open Nightshift → Detections → Events and open a significant event.
Check the header badges and Overview sections.
2. Open Timeline. Confirm detections run earliest first and the
significant event appears last. Click a detection twice to open and
close its child flyout. Click the event title to return to Overview.
3. Open an event with an investigation. Click its investigation card and
confirm the investigation opens. Check that events without an
investigation omit the card.
4. From Actions, run an investigation. Confirm the flyout and table show
In progress immediately, retain that state after a reload, and show
Completed when the run succeeds. Run a follow-up and confirm the
previous result does not immediately complete the new round.
5. Cause an investigation to fail. Confirm its card shows Failed. Start
a follow-up and confirm the card returns to In progress.
6. Simulate a temporary 5xx when reading a running investigation.
Confirm it does not mark the event investigation Completed or stop event
polling early.
7. Check chat actions and Mark inactive. With read-only access or a
paused engine, verify the available actions and disabled-state
explanations.
8. Expand an event with more than five detections. Open another event
and confirm it starts on Overview with the first five detections
visible.

## Demo

<img width="1702" height="1318" alt="Oct-21-2026 15-45-54"
src="https://github.com/user-attachments/assets/1b97540b-275d-44e0-8a3f-073ad59ec429"
/>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 Feature: Nightshift Context Engine Nightshift Context Engine is the memory layer every other engine draws on release_note:skip Skip the PR/issue when compiling release notes Team:nightshift-sre-agent Team:One Workflow Team label for One Workflow (Workflow automation) v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants