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] Fixes mis-alignment in the labels of Filter controls on Alerts Page. #192094

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

logeekal
Copy link
Contributor

@logeekal logeekal commented Sep 4, 2024

Summary

As stated in #192092 , the labels of filter controls were mis-aligned. This was due to recent changes in controls plugin were conflicting with our custom styling. This PR removes the custom styling.

Before

grafik

Issues with Error state

It looks like recent PR #190636 on 03-Sept made the controls compact but the error state was left out. This PR fixes that. I would request @elastic/kibana-presentation team to review it once.

grafik

After

Below video shows fixes in success, loading and error states. @elastic/response-ops team, Could you please check in other areas as well where these filters are used. Thanks.

filter_controls_labels_fix.mp4

@logeekal logeekal added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.16.0 labels Sep 4, 2024
@logeekal logeekal requested review from a team as code owners September 4, 2024 14:27
@@ -12,7 +12,7 @@ import styled from '@emotion/styled';
import { TEST_IDS } from './constants';

const FilterGroupLoadingButton = styled(EuiButton)`
height: 34px;
height: 38px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this is needed either. Instead, try setting a size="s" on line 20. This will set a small button size which seems to match the height of the input controls once they load.

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 @ryankeairns .. Great observation. Fixed here : 8e88547

@logeekal logeekal requested a review from a team September 5, 2024 08:29
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Sep 5, 2024
Copy link
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

changes LGTM! thank you for the quick fixes!

@craig-abbott
Copy link

We noticed there was some funky padding happening with a hidden SVG on the same component. Just to confirm, will this PR fix that left side padding issue too? It looks like it does in the screenshot but just wanted to make sure before raising another bug.

Thanks!

image

.euiFormControlLayout.euiFormControlLayout--group.controlFrame__formControlLayout {
height: 34px;
& .euiFormLabel.controlFrame__formControlLayoutLabel {
padding: 8px !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @craig-abbott,

Yes looks like the extra padding appeared after recent changes from presentation team combined with this custom padding we already had here. Now it is fixed since i have removed our custom styles.

Copy link
Contributor Author

@logeekal logeekal Sep 5, 2024

Choose a reason for hiding this comment

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

However, the padding on the either side of label is still different. But I think it is how @elastic/kibana-presentation wants it to be, since I am using default design of the label. If this needs to be changed, i will prefer to have a new issue raised.

grafik

Copy link
Contributor

@Heenawter Heenawter Sep 5, 2024

Choose a reason for hiding this comment

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

The reason for this padding is that we need to "simulate" left padding to accommodate toggling the drag button when switching between edit mode and view mode (see #184533).

We are currently using a small empty EuiIcon to do this - but now that we have switched to compressed styling, this button is too big. EuiIcon doesn't have an xs option, so we might be forced to just do an empty div with an enforced width of 8px instead (to match the right padding that is now 8px from switching to compressed styling instead of the previous 16px) - what do you think @cqliu1 @rshen91?

Here's what that would look like:

Sep-05-2024 09-59-50

Either way, @logeekal is correct that this is coming from our side and the fix shouldn't be done by ya'll :)

Choose a reason for hiding this comment

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

We expect the padding on left and right to be the same, as it is on:
Analytics > Dashboards > [Elastic Security] Detection rule monitoring.

It looks like there, the buttons still using the empty icon there to push the text over, but the padding on the <label> element matches the 12px width.

Whereas in Security > Alerts the icon is 12px but the padding on the right is 8px.

Screenshots for reference:
image
image
image

Choose a reason for hiding this comment

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

Apologies @Heenawter it took me so long to gather the screenshots I missed your comment from 12 minutes ago where you explained the problem, and now I look like it just mansplained it back to you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great to see collaboration here. Thanks both of you.

@craig-abbott , Could you please re-review the PR and let me know if you have any more comments.

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@logeekal logeekal enabled auto-merge (squash) September 6, 2024 17:59
@logeekal
Copy link
Contributor Author

logeekal commented Sep 7, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 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
controls 560.7KB 560.7KB +24.0B
securitySolution 19.7MB 19.7MB -1.5KB
triggersActionsUi 1.6MB 1.6MB -1.4KB
total -2.8KB

Page load bundle

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

id before after diff
embeddable 71.3KB 71.4KB +88.0B

History

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

@logeekal logeekal merged commit a602eed into main Sep 9, 2024
21 checks passed
@logeekal logeekal deleted the fix/filter_controls_label_alignment branch September 9, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] Label of Filter Controls on Alerts page are not aligned.
7 participants