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

Upgrade EUI to v88.2.0 #165790

Merged
merged 26 commits into from
Sep 12, 2023
Merged

Upgrade EUI to v88.2.0 #165790

merged 26 commits into from
Sep 12, 2023

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Sep 5, 2023

Major changes in this PR:

Removal of .euiAccordionForm classNames

EUI is moving away from providing global classNames styles for components - where possible, we want to provide props as opposed to styles. As part of our ongoing Emotion conversion, we have removed the following EuiAccordion-specific classes:

  • .euiAccordionForm (replaced with borders="horizontal")
  • .euiAccordionForm__button (replaced with buttonProps={{ paddingSize: 'm' }})
  • .euiAccordionForm__title styles - this was only removing text underlines on hover. If still desired, re-add this behavior with custom CSS.
  • .euiAccordionForm__extraAction - there was 1 usage of this in Kibana in Watcher, which was converted to one-off custom inline Emotion CSS instead.

This change accounts for the first 3-4 commits in the PR. ⚠️ If your team was one of the 4-5 teams affected by this change, we would greatly appreciate your help QAing the UI and ensuring it looks as desired/the same as before.

Fixed EuiHeader affordance

The Sass euiHeaderAffordForFixed mixin has been deprecated and replaced by a global --euiFixedHeadersOffset CSS variable. This variable updates independently and dynamically based on the number of fixed headers on the page, and is usable by both Sass and Emotion. All underlying EUI components that need to account for fixed headers (such as flyouts and page sidebars/templates) have been updated to consume this new variable.

This change cleans up a great deal of Sass code, and is incidentally extremely timely with serverless efforts (as serverless has only one fixed header and the classic Kibana chrome has two).

This change constitutes a majority of the commits in this PR, which involve removing various fixed Sass header variables and replacing them with the new CSS variable. I strongly recommend reviewing changes by commit if possible to see any associated changes that make sense together with any of your touched file(s). ⚠️ If your team was affected by this change (primarily due to custom header layouts), your help would be greatly appreciated QAing your app to ensure no UI regressions in that regard have occurred.


v88.1.0v88.2.0

88.2.0

  • Added a new EuiTextTruncate component, which provides custom truncation options beyond native CSS (#7116)
  • Fixed-positioned EuiHeaders now set a global CSS --euiFixedHeadersOffset variable, which updates dynamically based on the number of fixed headers on the page. (#7144)
  • EuiFlyouts now dynamically set their position, height, and mask based on the number of fixed headers on the page. (#7144)
  • Sticky-positioned EuiPageSidebars now dynamically set their position and height based on the number of fixed headers on the page. This can still be overridden via the sticky.offset prop if needed. (#7144)
  • EuiPageTemplate now dynamically offsets content from any fixed headers on the page. This can still be overridden via the offset prop if needed. (#7144)
  • Updated EuiAccordion with a new borders prop (#7154)
  • Updated EuiAccordion with a new buttonProps.paddingSize prop (#7154)

Deprecations

  • Deprecated the Sass euiHeaderAffordForFixed mixin. Use the new global CSS var(--euiFixedHeadersOffset) variable instead. (#7144)

CSS-in-JS conversions

  • Except for generic CSS utilities, EUI is moving away from providing global classNames that are component-specific. As part of this effort, we have removed the following EuiAccordion-specific classes: (#7154)
    • Removed .euiAccordionForm styles. Use the borders="horizontal" prop instead
    • Removed .euiAccordionForm__button styles. Use the buttonProps={{ paddingSize: 'm' }} prop instead
    • Removed .euiAccordionForm__extraAction styles. Convert this to your own custom CSS if necessary.
    • Removed .euiAccordionForm__title styles. Convert this to your own custom CSS if necessary.

@cee-chen cee-chen force-pushed the eui-88.2.x branch 4 times, most recently from 755f4ab to c92d139 Compare September 6, 2023 16:32
- likely not important to preserve the text-decoration CSS here
- include global banner if present, account for chrome visible or not

+ flatten conditional modifiers, to make overriding by other usages easier

+ remove offsets logic in _banner.scss, easier to handle it all in one place

note: all flyouts/collapsible navs should inherit automatically from the `--euiFixedHeadersOffset` var
+ delete unused `kibanaFullBodyMinHeight` mixin
- by obtaining the height value from the DOM/CSS var
- Remove deprecated EUI mixin (now handled by CSS below)

- Remove selector-specific overrides; update their usages to use the global CSS variable instead
- remove manual offset calculation and fall back to EuiPageSidebar's default inline styles instead, which automatically uses `--euiFixedHeadersOffset`

+ bonus: fix broken `:hover` effect on solution side navs by restoring missing className

+ continue dismantling `kbnAffordForHeader` mixin
+ remove `kbnStickyMenu` entirely - it looks like old code and it's not clear to me exactly how that behavior is being used, or if it should be using EuiPageSidebar intead - will ping Fleet team to ask
- # of fixed EuiHeaders should now be automatically detected and handled by EUI without needing any custom body logic
+ some snapshot updates around the new header CSS var
- was relying on the old selectors to set the correct height - use the new EUI var instead and remove direct className reference
- className no longer has any direct styles applied, and as far as I can tell doesn't need any associated header-related flyout logic
@cee-chen cee-chen marked this pull request as ready for review September 7, 2023 01:11
@cee-chen cee-chen requested review from a team as code owners September 7, 2023 01:11
Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

ent-search changes LGTM

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.

Rules Management changes LGTM

Copy link
Contributor

@thomheymann thomheymann left a comment

Choose a reason for hiding this comment

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

security changes LGTM

@@ -138,7 +138,7 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
'web_logs_map',
updateBaselines
);
expect(percentDifference).to.be.lessThan(0.02);
Copy link
Contributor

@nreese nreese Sep 8, 2023

Choose a reason for hiding this comment

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

Can you add some context for increasing this threshold. Maybe some screen shots from each or a diff screen shot. A 50% increase is pretty big.

Maybe the baselines need to be updated instead?

Copy link
Member Author

@cee-chen cee-chen Sep 8, 2023

Choose a reason for hiding this comment

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

To be honest, I've struggled with Kibana's visual snapshot tests in the past. When I've previously tried to update the baselines locally, the new images appeared to be using a totally different set of DPI/dimensions than CI and it ended up failing completely on CI.

I'd appreciate either being able to pair with someone on your team for that, or alternatively having your team update baselines in a follow-up PR after this one. Please let me know what you prefer!

Copy link
Contributor

Choose a reason for hiding this comment

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

or alternatively having your team update baselines in a follow-up PR after this one. Please let me know what you prefer!

We can just make a PR to update the snapshots afterwards. That will be easier for you

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks a million @nreese!

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-gis changes LGTM
code review only

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Presentation team changes LGTM! Ran this locally and checked that Canvas worked with the new header height

Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

Shared UX code changes LGTM!

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Visualizations team changes LGTM!

Copy link
Member

@ashokaditya ashokaditya 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 upgrade @cee-chen This is working great. I tested it out and I found a few places within security_solution and fleet where the var() function's fallback values need to be adjusted to account for when euiFixedHeadersOffset is not available.

I've not tested the other plugins but they may need this adjustment as well.

100vh - ${(props) => parseFloat(props.theme.eui.euiHeaderHeightCompensation) * 2}px
);
// Set the min height to the viewport size minus the height of any global Kibana headers
min-height: calc(100vh - var(--euiFixedHeadersOffset));
Copy link
Member

Choose a reason for hiding this comment

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

This breaks the header spacing if euiFixedHeadersOffset is not available. Also I've not been able to figure this out yet. It doesn't work with a fallback of 96px. You might want to restore the min-height value that uses eui props for now. @juliaElastic ☝🏼

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for checking, I'll restore it. At some point the old styled-components props will be deprecated/going away, but right now they're frozen during the Emotion conversion and aren't at risk for removal for another 3+ months.

Copy link
Member Author

@cee-chen cee-chen Sep 11, 2023

Choose a reason for hiding this comment

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

Actually, @ashokaditya do you mind explaining how exactly you're getting the state of "euiFixedHeadersOffset is not available"?

The only scenario that should happen in production is when no fixed EuiHeaders are on the page, in which case falling back to 0 should be correct for all var() usages. If you're testing by unchecking the --euiFixedHeadersOffset variable definition in browser devtools, that would not be a realistic scenario end-users face.

Copy link
Member Author

@cee-chen cee-chen Sep 11, 2023

Choose a reason for hiding this comment

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

Just to close the loop on this comment and the above comments - Ash was unchecking the definition in devtools, which isn't something that will happen in production. I've marked the above code suggestions as resolved and fixed all var() usages like this one to have 0 fallbacks in b530f22 🎉

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 12, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Defend Workflows Endpoint Cypress Tests #2 / Automated Response Actions From alerts should have generated endpoint and rule should have generated endpoint and rule
  • [job] [logs] Defend Workflows Endpoint Cypress Tests #2 / Automated Response Actions From alerts should have generated endpoint and rule should have generated endpoint and rule
  • [job] [logs] Investigations - Security Solution Cypress Tests #4 / Discover Datagrid Cell Actions Filter for Filter for
  • [job] [logs] Investigations - Security Solution Cypress Tests #4 / Discover Datagrid Cell Actions Filter for Filter for
  • [job] [logs] Investigations - Security Solution Cypress Tests #4 / Discover Datagrid Cell Actions Filter out Filter out
  • [job] [logs] Investigations - Security Solution Cypress Tests #4 / Discover Datagrid Cell Actions Filter out Filter out

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
apm 3.7MB 3.7MB -1.0B
canvas 1.0MB 1.0MB -59.0B
dashboard 369.9KB 369.1KB -836.0B
discover 556.6KB 555.2KB -1.3KB
enterpriseSearch 2.6MB 2.6MB -263.0B
eventAnnotation 177.0KB 176.7KB -254.0B
exploratoryView 200.9KB 200.9KB -1.0B
filesManagement 89.7KB 89.5KB -254.0B
fileUpload 958.1KB 958.1KB -1.0B
fleet 1.2MB 1.2MB -122.0B
graph 409.3KB 409.0KB -254.0B
home 164.1KB 163.9KB -206.0B
infra 2.0MB 2.0MB +697.0B
kibanaOverview 45.1KB 44.9KB -254.0B
lens 1.4MB 1.4MB +16.0B
management 42.6KB 42.4KB -254.0B
maps 2.8MB 2.8MB -614.0B
ml 3.5MB 3.5MB -254.0B
monitoring 462.4KB 462.4KB -1.0B
observabilityShared 36.1KB 35.9KB -254.0B
security 571.6KB 571.4KB -158.0B
securitySolution 12.6MB 12.6MB -1.8KB
securitySolutionEss 42.6KB 42.4KB -254.0B
securitySolutionServerless 270.2KB 270.0KB -254.0B
spaces 174.0KB 173.8KB -206.0B
synthetics 913.7KB 913.7KB -22.0B
uptime 501.9KB 501.9KB -1.0B
visTypeVega 1.8MB 1.8MB +952.0B
visualizations 264.7KB 264.5KB -254.0B
watcher 163.1KB 163.3KB +174.0B
total -6.2KB

Page load bundle

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

id before after diff
canvas 13.4KB 13.3KB -39.0B
core 381.4KB 365.3KB -16.1KB
esUiShared 156.5KB 156.2KB -254.0B
interactiveSetup 61.1KB 61.2KB +48.0B
kbnUiSharedDeps-css 279.4KB 279.0KB -427.0B
kbnUiSharedDeps-npmDll 6.2MB 6.2MB +11.0KB
logsShared 219.4KB 219.4KB -1.0B
observability 99.8KB 99.8KB -1.0B
painlessLab 10.3KB 9.9KB -444.0B
searchprofiler 19.8KB 19.5KB -340.0B
total -6.5KB

History

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

@Ikuni17 Ikuni17 merged commit 51569b4 into elastic:main Sep 12, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 12, 2023
@cee-chen cee-chen deleted the eui-88.2.x branch September 13, 2023 19:12
graphaelli pushed a commit to graphaelli/kibana that referenced this pull request Sep 19, 2023
## Summary
[Latest upgrade of EUI](elastic#165790)
removed the `isSticky` property that we were using in Integrations
sidebar.

This PR is adding it back with some css properties.


https://github.com/elastic/kibana/assets/16084106/ffe0e1ed-cf70-45b7-8d8d-cb0c5f53e843
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 EUI release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.