-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Reducing wrapping divs from RenderingService #97017
Reducing wrapping divs from RenderingService #97017
Conversation
Some being temporary and will need a better solution when introducing the page layout component
Can’t figure out how to have a optional Observable `Received: "kbnAppWrapper class-name”`
…_1/reduce_wrappers # Conflicts: # src/core/public/rendering/_base.scss # src/core/public/rendering/rendering_service.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pgayvallet Thank you for your help on this one. I've added the places where it's failing and I don't know how to fix it below.
…_1/reduce_wrappers
…pers move APP_WRAPPER_CLASS definition to src/core/common
Reviewers:Please, please, please, check your application pages to ensure the layouts are still working correctly. Especially, if you were targeting or relying any of the following classes: The following application wrappers needing/applying flex have been removed
Import and use The class used for checking for hidden chrome has been renamed
Going forwardIf your application also has another custom class simply to provide column, flex layout for stretching you can replace your custom class with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the Kibana App owned apps in Firefox and Safari and wasn't able to find any issues. LGTM
Pinging @elastic/uptime (Team:uptime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, with banner disabled then enabled:
- dashboard
- dashboard full screen
- visualize
- maps
- canvas
- login page
All seems ok.
LGTM
Tested locally for ML - LGTM 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in Platform Security functional tests LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the ES UI apps and didn't spot any regression 👍 Thanks for doing that @cchaos !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code only review: Presentation team changes LGTM!
Tested locally on chrome, Dashboard changes LGTM. Focused on dashboard layout, fullscreen mode, embed mode & overlays. Everything LGTM!
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested for Uptime and it LGTM, except we do have one view relying on flex from one of the removed wrappers.
We can create an issue to address this using the APP_WRAPPER_CLASS
.
CC: @shahzad31 @justinkambic
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design changes LGTM 🎉
* Reducing wrapping divs from RenderingService * Applying more styles to .kbnAppWrapper Some being temporary and will need a better solution when introducing the page layout component * Almost fixing tests for rendering service Can’t figure out how to have a optional Observable `Received: "kbnAppWrapper class-name”` * Adding some comments * [Dashboard] Using the APP_WRAPPER_CLASS * fix test & ts types * Fixin a few more tests that were using `.app-wrapper` * Creating docs for new var and cleaning up some selectors * Fixing reporting * Fixing banner position and truncation * Fixed CSS error in loading screen and jump in animation * Fixing selectors in Canvas * Remove unused var * Added `APP_WRAPPER_CLASS` export from `server` and updated reporting to use it * Fix monitoring icon clicks * move APP_WRAPPER_CLASS definition to src/core/common * Fixing Monitoring snapshots and wrapper class * Moved `APP_WRAPPER_CLASS` utils but exported from `public` and `server` * Remove old folder * Fix dashboard test by only showing HR in edit mode Co-authored-by: pgayvallet Co-authored-by: tsullivan
Page Layout Service Part 1: Reduce/Reuse/Recycle
Reducing the number of wrapping elements before getting to actual page content.
It seems that over the years, instead of fixing unnecessary layers, more continued to get added creating lots of nested divs. This is trouble for the types of layouts we try to create using
flex
to stretch the contents. The following is the old vs new rendered DOM:Essentially it boils down to:
1. Reducing the wrappers in the rendering service
.content
wrapperdata-test-subj="kibanaChrome"
which is targeted by some tests, but I've moved this to the#kibana-body
element (one level above). Iffy on whether that was really the appropriate element to move it to or if it needs to be within the service..app-wrapper-panel
wrapping element<AppContainer />
wrapper which applied a way-too-generic className of.application
and is how plugins passed down theapplicationClasses
.<AppWrapper />
instead, but removed.application
in favor of.kbnAppWrapper
that most plugins can now just grab from the global variableAPP_WRAPPER_CLASS
.The result of which is
kibana/src/core/public/rendering/rendering_service.tsx
Lines 49 to 72 in 77a7f72
2. Added a better and reusable class name for any elements wrapping applications
The AppWrapper component can now be reused by individual applications to ensure proper layout, or they can use the
APP_WRAPPER_CLASS
exported variable.The variable is for places like Dashboard still creating elements through the
document
.kibana/src/plugins/dashboard/public/plugin.tsx
Line 294 in 77a7f72
3. Updated some naming of classes just to be more consistant:
.app-wrapper
->.kbnAppWrapper
Checklist
Delete any items that are not applicable to this PR.
For maintainers