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

[CTI] updates Alert Summary UI #107081

Merged
merged 13 commits into from
Aug 3, 2021
Merged

[CTI] updates Alert Summary UI #107081

merged 13 commits into from
Aug 3, 2021

Conversation

ecezalp
Copy link
Contributor

@ecezalp ecezalp commented Jul 28, 2021

Summary

  • updates indentation of field values on the Summary tab
  • places ActionCell component at the end of CTI values

indicator match rule with multiple imphash hits
Screen Shot 2021-07-28 at 3 35 16 PM

custom query rule with small browser window
Screen Shot 2021-07-28 at 3 35 50 PM

small browser window (hidden icons)
Screen Shot 2021-07-28 at 4 01 53 PM

Checklist

Delete any items that are not applicable to this PR.

@ecezalp ecezalp requested a review from a team as a code owner July 28, 2021 19:59
@ecezalp ecezalp marked this pull request as draft July 28, 2021 20:00
@ecezalp ecezalp self-assigned this Jul 28, 2021
@ecezalp ecezalp added auto-backport Deprecated - use backport:version if exact versions are needed Team: CTI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.15.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Jul 28, 2021
@ecezalp
Copy link
Contributor Author

ecezalp commented Jul 28, 2021

@elasticmachine merge upstream

@@ -81,11 +86,20 @@ const EnrichmentDescription: React.FC<ThreatSummaryItem['description']> = ({
</RightMargin>
</>
)}
<ActionCell
data={(data ?? { field: fieldName }) as EventFieldsData}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simply build an appropriate EventFieldsData from the existing parameters and what we know about these fields? I suspect that we don't need to pass data through all these layers like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am seeking @angorayc's guidance on how to approach this piece as I haven't been able to find an implementation that utilizes EventFieldsData type (with no casting)

Copy link
Contributor

@rylnd rylnd Jul 28, 2021

Choose a reason for hiding this comment

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

It might be simplest to "flatten" ActionCell's props to just what it needs; it looks like only a few properties from EventFieldsData are used in there (field, type, value, isObjectArray, and format), and some of those may be optional .

@ecezalp ecezalp requested a review from angorayc July 29, 2021 12:18
@monina-n
Copy link

@ecezalp some design feedback for the actions in the summary tab. Please let us know what you think!

In order to to avoid the awkward wrapping of the action cell when a field values wraps to two or more lines, design is proposing this new behavior:

  1. Action cell will always appear to the very right of the value
  2. We'll have a pre-defined break point on the right where lines will wrap so there will always be space on the right for the action cell's full width

This way, the action cell is clearly associated with the hovered over value and has a consistnet behavior on how it appears.

hover.gif.mov

Screen Shot 2021-07-28 at 3 33 19 PM

cc: @yiyangliu9286

@ecezalp ecezalp marked this pull request as ready for review July 29, 2021 19:41
@elasticmachine
Copy link
Contributor

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

@ecezalp
Copy link
Contributor Author

ecezalp commented Jul 29, 2021

@monina-n @yiyangliu9286 please find the new screenshots where the icons are always in a single line

Screen Shot 2021-07-29 at 2 24 27 PM

Screen Shot 2021-07-29 at 2 24 09 PM

Screen Shot 2021-07-29 at 2 23 55 PM

@ecezalp ecezalp changed the title updates Alert Summary UI [CTI] updates Alert Summary UI Jul 29, 2021
@ecezalp ecezalp requested a review from rylnd August 3, 2021 13:24
@ecezalp
Copy link
Contributor Author

ecezalp commented Aug 3, 2021

@elasticmachine merge upstream

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Approving! Layout looks good, behavior seems good. A few points to address before merging:

  • There's some dead code; just a few lines that could be cleaned up
  • I had nits/questions about some hardcoded widths/heights
  • Having to thread through a parallel, redundant set of data for these action fields isn't great
    • Not a requirement here, but a better approach might be to pass e.g. a buildActions function prop to ThreatSummaryView or some other kind of control inversion

One other UX concern: the interaction on hover isn't nice: you have to hover the blank area to the right of a field's value to see the actions available; hovering anywhere else has no effect. This is bad enough that I would consider it a bug.

@@ -6,15 +6,19 @@
*/

import styled from 'styled-components';
import React from 'react';
import { get } from 'lodash/fp';
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a reason for preferring the FP version of this function?

Copy link
Contributor Author

@ecezalp ecezalp Aug 3, 2021

Choose a reason for hiding this comment

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

no reason - updated to lodash

@@ -50,22 +56,23 @@ const EnrichmentTitle: React.FC<ThreatSummaryItem['title']> = ({ title, type })
const EnrichmentDescription: React.FC<ThreatSummaryItem['description']> = ({
timelineId,
eventId,
fieldName,
Copy link
Contributor

Choose a reason for hiding this comment

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

We're still generating this value in buildThreatSummaryItems, but it's now unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the catch! removed fieldName from ThreatSummaryItem type

@@ -213,7 +219,7 @@ export const getSummaryColumns = (
field: 'title',
truncateText: false,
render: getTitle,
width: '33%',
width: '220px',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there significance to this value? Was this specified by design, or is this intended to be more dynamic than fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no particular significance, it is to ensure that the indentation is fixed. Previously this value was 160px for both AlertSummary and ThreatSummary items. Recently it was changed to 33% for AlertSummary only. To ensure the consistency between AlertSummary and ThreatSummary values, a change needed to be made. Viewing the designs, I thought that a fixed 220px was good to go. We can get confirmation from @yiyangliu9286 for this one.

Choose a reason for hiding this comment

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

For the design changes in 7.15, we made the "value" field indent 8px from each section header since we have added the section header in 7.15, so which setting that allows the "value" field to be indented at the right position will work here.

@@ -40,6 +40,7 @@ export const AdditionalContent = styled.div`
AdditionalContent.displayName = 'AdditionalContent';

const StyledHoverActionsContainer = styled.div<{ $showTopN: boolean; $showOwnFocus: boolean }>`
min-width: 138px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto on questioning the magic number here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was to ensure that the Icon Row never wraps as per Monina's request here

@@ -196,9 +198,13 @@ export const onEventDetailsTabKeyPressed = ({
}
};

const StyledH5 = styled.h5`
line-height: 1.7rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the intention here to give more spacing between table rows? If so, should this be applied to StyledEuiInMemoryTable so that all rows are at least a min height?

Copy link
Contributor Author

@ecezalp ecezalp Aug 3, 2021

Choose a reason for hiding this comment

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

yeah so this is a good question - previously the table in Alert Summary tab and the table in Threat Intel tab had the same line height, and at a certain point they went out of sync. I looked through the changes and I was unable to identify how this change took place (didn't see any CSS associated with the change, and the tables are the same, with the same compressed prop that makes the rows closer to each other) - it could be that the ActionCell component is enlarging the row height in the Alert Summary tab now that I think about it. I added this explicit line height to ensure that all rows have the same line height.

@ecezalp
Copy link
Contributor Author

ecezalp commented Aug 3, 2021

  • There's some dead code; just a few lines that could be cleaned up

removed, thanks for noticing!

  • I had nits/questions about some hardcoded widths/heights

looped in Yiyang for the column one to get the desired indentation percentage / value, answered the other two questions with no code changes, please let me know if further changes would be desired

  • Having to thread through a parallel, redundant set of data for these action fields isn't great
    • Not a requirement here, but a better approach might be to pass e.g. a buildActions function prop to ThreatSummaryView or some other kind of control inversion

leaving this for now, will come back at the end of sprint if there is any spare time remaining

One other UX concern: the interaction on hover isn't nice: you have to hover the blank area to the right of a field's value to see the actions available; hovering anywhere else has no effect. This is bad enough that I would consider it a bug.

@monina-n @yiyangliu9286 can provide more insight on this one, I am happy to implement any other changes as desired

@ecezalp ecezalp enabled auto-merge (squash) August 3, 2021 19:34
@kibanamachine
Copy link
Contributor

💚 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 6.4MB 6.4MB +1.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ecezalp

@ecezalp ecezalp merged commit c6a7062 into elastic:master Aug 3, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 3, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Aug 4, 2021
streamich pushed a commit to vadimkibana/kibana that referenced this pull request Aug 8, 2021
@monina-n
Copy link

monina-n commented Aug 9, 2021

hey @ecezalp! sorry for the late response. in terms of a response to:

One other UX concern: the interaction on hover isn't nice: you have to hover the blank area to the right of a field's value to see the actions available; hovering anywhere else has no effect. This is bad enough that I would consider it a bug.

I couldn't tell from the screenshots, but the user should be able to hover over the field itself to reveal the hover action menu, not just over the space where the hover action menu is itself. I think if it appears when a user hovers on both areas (above the value and above where the action menu appears), that should work

@ecezalp
Copy link
Contributor Author

ecezalp commented Aug 10, 2021

hey @ecezalp! sorry for the late response. in terms of a response to:

One other UX concern: the interaction on hover isn't nice: you have to hover the blank area to the right of a field's value to see the actions available; hovering anywhere else has no effect. This is bad enough that I would consider it a bug.

I couldn't tell from the screenshots, but the user should be able to hover over the field itself to reveal the hover action menu, not just over the space where the hover action menu is itself. I think if it appears when a user hovers on both areas (above the value and above where the action menu appears), that should work

according to our slack conversation, @angorayc will be taking care of this feature as a part of her UX changes. Thanks for bringing it up!

@angorayc
Copy link
Contributor

wip #108192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team: CTI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants