Skip to content

[Security Solution] fix: react to deleting notes in timelines table#249777

Merged
kelvtanv merged 10 commits intoelastic:mainfrom
kelvtanv:refactor-note-preview-state
Jan 23, 2026
Merged

[Security Solution] fix: react to deleting notes in timelines table#249777
kelvtanv merged 10 commits intoelastic:mainfrom
kelvtanv:refactor-note-preview-state

Conversation

@kelvtanv
Copy link
Copy Markdown
Contributor

@kelvtanv kelvtanv commented Jan 20, 2026

Summary

See #245363

Notes being deleted via the timelines table does not automatically update on the UI because the timeline states that include the notes are not being updated properly. Refactor the notes preview delete button in the timelines table to use the redux state as we do in the notes management page/popup.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@kelvtanv kelvtanv marked this pull request as ready for review January 20, 2026 21:15
@kelvtanv kelvtanv requested a review from a team as a code owner January 20, 2026 21:15
@kelvtanv kelvtanv requested a review from Copilot January 20, 2026 21:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where deleting notes from the timelines table doesn't automatically update the UI. The solution refactors the delete functionality to use Redux state management (as already implemented in the notes management page) instead of maintaining separate local state in the timeline components.

Changes:

  • Removed timeline-specific note deletion state management (confirmingNoteId) in favor of the centralized notes Redux state
  • Integrated the shared DeleteConfirmModal component into the timelines table
  • Updated the delete button to dispatch Redux actions instead of managing local modal state

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
x-pack/solutions/security/plugins/security_solution/public/timelines/store/reducer.ts Removed setConfirmingNoteId action handler from timeline reducer
x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts Removed confirmingNoteId property from TimelineModel interface
x-pack/solutions/security/plugins/security_solution/public/timelines/store/actions.ts Removed setConfirmingNoteId action creator
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/translations.ts Added TIMELINE_TABLE_CAPTION translation for accessibility
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.tsx Integrated DeleteConfirmModal and added table caption for accessibility
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx Added test coverage for delete confirmation modal rendering
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx Refactored delete button to use Redux actions and removed local modal state management
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx Updated test to verify Redux action dispatch instead of mutation calls
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.tsx Added effect to clean up expanded notes when notes are deleted from Redux state
x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_confirm_modal.tsx Added optional callbacks and test selector for reusability across different contexts

Copy link
Copy Markdown
Contributor

@kqualters-elastic kqualters-elastic left a comment

Choose a reason for hiding this comment

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

desk tested this, works well. LGTM 👍

Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

Desk tested and code LGTM. I left a small comment though: I think you can simplify all the test files by removing the ThemeProvider.

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner January 21, 2026 18:41
Copy link
Copy Markdown
Contributor

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

packages/kbn-babel-preset/styled_components_files.js LGTM

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 21, 2026

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #69 / Package policies Package Policy - update Input Packages should install index templates when upgrading from input package to integration package
  • [job] [logs] Investigations - Security Solution Cypress Tests #6 / Timeline notes tab renders notes UI and basic content and delete it renders notes UI and basic content and delete it

History

@PhilippeOberti
Copy link
Copy Markdown
Contributor

@kelvtanv you have a failing Cypress test (this guy). Looking at the screenshot, I think it could be a wrong data-test-subj (potentially this one?)

You can find the info to run Cypress locally here (let me know if you need any help on this).

@PhilippeOberti PhilippeOberti added release_note:fix backport:skip This PR does not require backporting v9.4.0 labels Jan 21, 2026
@kelvtanv
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kelvtanv kelvtanv changed the title fix: react to deleting notes in timelines table [Security Solution] fix: react to deleting notes in timelines table Jan 23, 2026
@kelvtanv kelvtanv merged commit 94529ac into elastic:main Jan 23, 2026
14 of 15 checks passed
@kelvtanv kelvtanv added fixed Team:Threat Hunting Security Solution Threat Hunting Team labels Jan 29, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@kelvtanv kelvtanv added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Jan 29, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

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 fixed release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants