Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Reduce dropdown options and improve tooltip texts in Rule Upgrade flyout #203222

Merged
merged 83 commits into from
Dec 14, 2024

Conversation

nikitaindik
Copy link
Contributor

@nikitaindik nikitaindik commented Dec 6, 2024

Partially addresses: #171520

Summary

This PR updates the tooltips for the ‘Diff view’ and ‘Final update’ sections in the prebuilt rule upgrade flyout. It also streamlines the version picker by removing redundant options, making the UI simpler and clearer for users.

Changes

  • Reduced the number of version picker items based on the diff outcome. Updated item names for better clarity.
  • Revised the tooltip text for the ‘Diff view’ section to better explain the available dropdown options. The tooltip now describes only the options in the dropdown to avoid overwhelming the user with unrelated information.
  • Updated the tooltip text for the ‘Final update’ section.

Screenshots

Scherm­afbeelding 2024-12-11 om 11 54 48 Scherm­afbeelding 2024-12-11 om 11 55 32 Scherm­afbeelding 2024-12-11 om 11 55 58

Work started on 06-Dec-2024.

@nikitaindik nikitaindik added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area backport:version Backport to applied version labels v8.18.0 labels Dec 6, 2024
@nikitaindik nikitaindik self-assigned this Dec 6, 2024
@nikitaindik nikitaindik added the ci:cloud-deploy Create or update a Cloud deployment label Dec 6, 2024
@nikitaindik nikitaindik marked this pull request as ready for review December 6, 2024 16:02
@nikitaindik nikitaindik requested a review from a team as a code owner December 6, 2024 16:02
@nikitaindik nikitaindik requested a review from maximpn December 6, 2024 16:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@nikitaindik nikitaindik added the ui-copy Review of UI copy with docs team is recommended label Dec 6, 2024
id="xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText"
defaultMessage="Choose field values used in the upgraded rule. "
id="xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.upgradeHelpText"
defaultMessage="The {title} lets you compare the values of a field across different versions of a rule: {versions} The differences are shown as JSON, highlighting additions, deletions, and modifications. Use this view to review and understand changes across versions."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @nastasha-solomon! 😊 Could you kindly review the UI copy in this file? Please see PR description for screenshots. Thanks so much for your help!

@nikitaindik nikitaindik marked this pull request as draft December 6, 2024 16:58
@nikitaindik
Copy link
Contributor Author

Transitioning back to Draft as it turned out we may need to make a few more adjustments to UI. Will ping everyone once it's resolved.

@nikitaindik nikitaindik changed the title [Security Solution] Improve tooltip texts and dropdown options in Rule Upgrade flyout [Security Solution] Reduce dropdown options and improve tooltip texts in Rule Upgrade flyout Dec 9, 2024
@nikitaindik nikitaindik marked this pull request as ready for review December 10, 2024 19:04
@nikitaindik nikitaindik removed the ui-copy Review of UI copy with docs team is recommended label Dec 11, 2024
Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@nikitaindik Thanks for radically simplifying Diff View comparison options 🙏

I've noticed My customizations option may confuse users and should be removed. I suggest to stick to 3 options My changes, Update from Elastic and My changes merged with Elastic's.

It looks like the implementation could be simplified by separating Diff options and an algorithm picking versions for comparison. We could stick to concrete versions but missing base version case requires using current version instead of base.

): Array<{ value: SelectedVersions; text: string; title: string }> => {
switch (fieldDiff.diff_outcome) {
case ThreeWayDiffOutcome.StockValueCanUpdate: {
const hasUserChangedResolvedValue = !isEqual(fieldDiff.merged_version, resolvedValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

Calculating hasUserChangedResolvedValue here has maintenance issues. The knowledge that merged_version is used in finalDiffableRule is encapsulated in useFieldUpgradeContext. For example merged_version is replaced with something else in the future so this line have to be changed as well.

It looks cleaner to expose a value from useFieldUpgradeContext(). For example it could be named hasResolvedValue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the refactoring change. Please take a look.

@@ -7,6 +7,7 @@

export enum FieldUpgradeStateEnum {
NoUpdate = 'NO_UPDATE',
SameUpdate = 'SAME_UPDATE',
Copy link
Contributor

Choose a reason for hiding this comment

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

The word Same may be confusing. Maybe use MATCHING_UPDATE instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed this with Maxim yesterday, decided to stick consistent naming, since we use "same" in ThreeWayDiffOutcome (ThreeWayDiffOutcome.CustomizedValueSameUpdate).

? FieldUpgradeStateEnum.NoConflict
: FieldUpgradeStateEnum.NoUpdate,
};
if (fieldDiff.has_update) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic becomes quite complex here. Do you think using fieldDiff.diff_outcome in switch instead of fieldDiff.conflict will make it more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tried refactoring it to use fieldDiff.diff_outcome in switch, but it actually became even more messy. Maybe we can take a look at it together?

@nikitaindik
Copy link
Contributor Author

@maximpn I've addressed the comments and pushed the changes. Please take a look.

@nikitaindik nikitaindik requested a review from maximpn December 13, 2024 13:26
Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@nikitaindik Implementation looks much more readable with the recent changes 🎉 Thanks for incorporating my suggestions 🙏

I tested the PR and left comments as suggestions which are trivial to address.

@nikitaindik
Copy link
Contributor Author

Thank you, @maximpn! I've addressed your latest feedback and will merge it now.

@nikitaindik nikitaindik enabled auto-merge (squash) December 14, 2024 10:14
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 14, 2024

💚 Build Succeeded

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 14.7MB 14.7MB +2.6KB

History

cc @nikitaindik

@nikitaindik nikitaindik merged commit 90e35a0 into elastic:main Dec 14, 2024
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12329556495

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 14, 2024
… in Rule Upgrade flyout (elastic#203222)

**Partially addresses: elastic#171520**

## Summary

This PR updates the tooltips for the ‘Diff view’ and ‘Final update’
sections in the prebuilt rule upgrade flyout. It also streamlines the
version picker by removing redundant options, making the UI simpler and
clearer for users.

## Changes
- Reduced the number of version picker items based on the diff outcome.
Updated item names for better clarity.
- Revised the tooltip text for the ‘Diff view’ section to better explain
the available dropdown options. The tooltip now describes only the
options in the dropdown to avoid overwhelming the user with unrelated
information.
-  Updated the tooltip text for the ‘Final update’ section.

## Screenshots
<img width="922" alt="Scherm­afbeelding 2024-12-11 om 11 54 48"
src="https://github.com/user-attachments/assets/124e76a1-99dc-48d8-be54-f6c8f2079451">

<img width="640" alt="Scherm­afbeelding 2024-12-11 om 11 55 32"
src="https://github.com/user-attachments/assets/45655dd2-6503-46b7-b28b-0df7bf0e6fa3">

<img width="433" alt="Scherm­afbeelding 2024-12-11 om 11 55 58"
src="https://github.com/user-attachments/assets/d845ff52-4678-4245-8bdd-b9957f0c1d13">

Work started on 06-Dec-2024.

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
(cherry picked from commit 90e35a0)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 14, 2024
… texts in Rule Upgrade flyout (#203222) (#204314)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Reduce dropdown options and improve tooltip texts
in Rule Upgrade flyout
(#203222)](#203222)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2024-12-14T11:40:45Z","message":"[Security
Solution] Reduce dropdown options and improve tooltip texts in Rule
Upgrade flyout (#203222)\n\n**Partially addresses: #171520**\r\n\r\n##
Summary\r\n\r\nThis PR updates the tooltips for the ‘Diff view’ and
‘Final update’\r\nsections in the prebuilt rule upgrade flyout. It also
streamlines the\r\nversion picker by removing redundant options, making
the UI simpler and\r\nclearer for users.\r\n\r\n## Changes\r\n- Reduced
the number of version picker items based on the diff outcome.\r\nUpdated
item names for better clarity.\r\n- Revised the tooltip text for the
‘Diff view’ section to better explain\r\nthe available dropdown options.
The tooltip now describes only the\r\noptions in the dropdown to avoid
overwhelming the user with unrelated\r\ninformation.\r\n- Updated the
tooltip text for the ‘Final update’ section.\r\n\r\n##
Screenshots\r\n<img width=\"922\" alt=\"Scherm­afbeelding 2024-12-11 om
11 54
48\"\r\nsrc=\"https://github.com/user-attachments/assets/124e76a1-99dc-48d8-be54-f6c8f2079451\">\r\n\r\n<img
width=\"640\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
32\"\r\nsrc=\"https://github.com/user-attachments/assets/45655dd2-6503-46b7-b28b-0df7bf0e6fa3\">\r\n\r\n<img
width=\"433\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
58\"\r\nsrc=\"https://github.com/user-attachments/assets/d845ff52-4678-4245-8bdd-b9957f0c1d13\">\r\n\r\n\r\nWork
started on 06-Dec-2024.\r\n\r\n---------\r\n\r\nCo-authored-by: Maxim
Palenov
<maxim.palenov@elastic.co>","sha":"90e35a04bc795aebdd62c11cd53e279b566582b8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","ci:cloud-deploy","backport:version","v8.18.0"],"title":"[Security
Solution] Reduce dropdown options and improve tooltip texts in Rule
Upgrade
flyout","number":203222,"url":"https://github.com/elastic/kibana/pull/203222","mergeCommit":{"message":"[Security
Solution] Reduce dropdown options and improve tooltip texts in Rule
Upgrade flyout (#203222)\n\n**Partially addresses: #171520**\r\n\r\n##
Summary\r\n\r\nThis PR updates the tooltips for the ‘Diff view’ and
‘Final update’\r\nsections in the prebuilt rule upgrade flyout. It also
streamlines the\r\nversion picker by removing redundant options, making
the UI simpler and\r\nclearer for users.\r\n\r\n## Changes\r\n- Reduced
the number of version picker items based on the diff outcome.\r\nUpdated
item names for better clarity.\r\n- Revised the tooltip text for the
‘Diff view’ section to better explain\r\nthe available dropdown options.
The tooltip now describes only the\r\noptions in the dropdown to avoid
overwhelming the user with unrelated\r\ninformation.\r\n- Updated the
tooltip text for the ‘Final update’ section.\r\n\r\n##
Screenshots\r\n<img width=\"922\" alt=\"Scherm­afbeelding 2024-12-11 om
11 54
48\"\r\nsrc=\"https://github.com/user-attachments/assets/124e76a1-99dc-48d8-be54-f6c8f2079451\">\r\n\r\n<img
width=\"640\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
32\"\r\nsrc=\"https://github.com/user-attachments/assets/45655dd2-6503-46b7-b28b-0df7bf0e6fa3\">\r\n\r\n<img
width=\"433\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
58\"\r\nsrc=\"https://github.com/user-attachments/assets/d845ff52-4678-4245-8bdd-b9957f0c1d13\">\r\n\r\n\r\nWork
started on 06-Dec-2024.\r\n\r\n---------\r\n\r\nCo-authored-by: Maxim
Palenov
<maxim.palenov@elastic.co>","sha":"90e35a04bc795aebdd62c11cd53e279b566582b8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203222","number":203222,"mergeCommit":{"message":"[Security
Solution] Reduce dropdown options and improve tooltip texts in Rule
Upgrade flyout (#203222)\n\n**Partially addresses: #171520**\r\n\r\n##
Summary\r\n\r\nThis PR updates the tooltips for the ‘Diff view’ and
‘Final update’\r\nsections in the prebuilt rule upgrade flyout. It also
streamlines the\r\nversion picker by removing redundant options, making
the UI simpler and\r\nclearer for users.\r\n\r\n## Changes\r\n- Reduced
the number of version picker items based on the diff outcome.\r\nUpdated
item names for better clarity.\r\n- Revised the tooltip text for the
‘Diff view’ section to better explain\r\nthe available dropdown options.
The tooltip now describes only the\r\noptions in the dropdown to avoid
overwhelming the user with unrelated\r\ninformation.\r\n- Updated the
tooltip text for the ‘Final update’ section.\r\n\r\n##
Screenshots\r\n<img width=\"922\" alt=\"Scherm­afbeelding 2024-12-11 om
11 54
48\"\r\nsrc=\"https://github.com/user-attachments/assets/124e76a1-99dc-48d8-be54-f6c8f2079451\">\r\n\r\n<img
width=\"640\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
32\"\r\nsrc=\"https://github.com/user-attachments/assets/45655dd2-6503-46b7-b28b-0df7bf0e6fa3\">\r\n\r\n<img
width=\"433\" alt=\"Scherm­afbeelding 2024-12-11 om 11 55
58\"\r\nsrc=\"https://github.com/user-attachments/assets/d845ff52-4678-4245-8bdd-b9957f0c1d13\">\r\n\r\n\r\nWork
started on 06-Dec-2024.\r\n\r\n---------\r\n\r\nCo-authored-by: Maxim
Palenov
<maxim.palenov@elastic.co>","sha":"90e35a04bc795aebdd62c11cd53e279b566582b8"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:cloud-deploy Create or update a Cloud deployment Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants