[Workspace Chrome] Bootstrap grid layout for project nav#225772
[Workspace Chrome] Bootstrap grid layout for project nav#225772Dosant merged 20 commits intoelastic:mainfrom
Conversation
…plication-layout-2
…plication-layout-2
…plication-layout-3 # Conflicts: # src/core/packages/chrome/browser-internal/src/chrome_service.tsx # src/core/packages/chrome/browser-internal/src/types.ts # src/core/packages/chrome/layout/core-chrome-layout/layouts/grid/grid_global_app_style.tsx # src/core/packages/chrome/layout/core-chrome-layout/layouts/grid/grid_layout.tsx # src/core/packages/chrome/layout/core-chrome-layout/layouts/grid/hack_use_sync_push_flyout.tsx
…plication-layout-3
…plication-layout-3 # Conflicts: # src/core/packages/chrome/layout/core-chrome-layout-components/README.md # src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts # src/core/packages/chrome/layout/core-chrome-layout-components/debug/layout_debug_overlay.tsx # src/core/packages/chrome/layout/core-chrome-layout-components/layout_global_css.tsx # src/core/packages/chrome/layout/core-chrome-layout/layouts/legacy-fixed/legacy_fixed_global_app_style.tsx # src/platform/packages/shared/kbn-css-utils/public/full_body_height_css.ts # src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template.test.tsx.snap # src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template_inner.test.tsx.snap # src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx
…plication-layout-3
|
|
||
| const root: EmotionFn = ({ euiTheme }) => css` | ||
| position: sticky; | ||
| overflow: hidden; |
There was a problem hiding this comment.
I was checking the new layout in different browsers and noticed a bug in Safari. The push flyout from EuiCollapsibleNavBeta wasn't visible because of this. I'm removing it since it's not really needed, but taking it out will fix the bug in Safari.
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
|
clintandrewhall
left a comment
There was a problem hiding this comment.
Something that I did in the proof-of-concept was to render the side navigation in the actual area, even in older versions, rather than keep the navigation as a flyout managed by EUI.
I did this by rendering the menu itself in the in the side nav grid area and hiding the button. Then I rendered a button in the header that would expand/collapse the nav.
I would love to see this done in this PR, as well. It's going to make moving to the new navigation that much easier, IMO.
Thoughts?
Discussed offline: this PR integrates the old sidenav into the new grid layout using the current flyout approach, minimizing hacks and allowing us to start polishing the layout right away. A proper integration for the new grouped sidenav will follow in a separate PR, behind a new feature flag. The new sidenav will only be available with the grid layout, while the grid can support both nav versions. This approach lets us decouple layout and nav changes and move forward incrementally. |
| @@ -489,59 +577,13 @@ export class ChromeService { | |||
|
|
|||
| // render header | |||
| if (chromeStyle === 'project') { | |||
There was a problem hiding this comment.
This was the kind of check I wanted delegated to the layout service.
There was a problem hiding this comment.
right, new layout ("grid") does this there. but old layout still relies on this being done by chrome_service. we can refactor this now, but I think we should better clean this up together when we remove old layout.
| return getClassicHeader({ isFixed: false, includeBanner: false, as: 'div' }); | ||
| }; | ||
|
|
||
| const getProjectHeaderComponentForGridLayout = () => { |
There was a problem hiding this comment.
This too, potentially. Can we move these, or is that a planned step?
|
|
||
| return { | ||
| // TODO: this service does too much and doesn't have to compose these headers components. | ||
| // let's get rid of this in the future https://github.com/elastic/kibana/issues/225264 |
| @@ -28,7 +29,10 @@ const globalLayoutStyles = (euiTheme: UseEuiTheme['euiTheme']) => css` | |||
| --kbnHeaderBannerHeight: var(--kbn-layout--banner-height, 0px); | |||
There was a problem hiding this comment.
nit: I would like these to follow the same style we adopted for the grid layout variables, e.g. --kbn-header--banner-height (or whatever suits).
There was a problem hiding this comment.
This is just old variable names that exist for backward compatibility. The names will stay, but we will use new values. Later, I hope to clean them up.
| paddingInlineStart = paddingInlineStart ?? start; | ||
| paddingInlineEnd = paddingInlineEnd ?? end; | ||
|
|
||
| if (paddingInlineStart) { |
There was a problem hiding this comment.
This is never going to be falsey, right? Because of line 63? Or am I missing something?
There was a problem hiding this comment.
it can be falsey if there is no padding-inline-end or padding-inline styles set on body
) > [!IMPORTANT] > **Should be no user-facing changes!!!** The new layout work is behind a feature flag! ## Summary Part of [workspace chrome](elastic/kibana-team#1581 ) work. This is follow up to elastic#224255, elastic#225824 which mostly implements the new layout for project (serverless) navigation.  ### Implementation notes: - The project navigation sidebar still uses the EuiCollapsibleNavBeta component. It works as a push flyout on larger screens and as an overlay on smaller screens. - In the next steps, we will start using the new navigation grid cell for the upcoming side navigation component. ## How to review 1. Most importantly, we need to ensure that nothing is broken in the old layout during the refactor. - Functional tests + visual/manual testing 2. Then for the new layout: kibana.yml: ``` feature_flags.overrides: core.chrome.layoutType: 'grid' core.chrome.layoutDebug: true ``` - Check that it mostly works (some specific edge cases and bugs are expected and are gathered in elastic#225263) - Code-review: focus on the layout implementation split approach
Important
Should be no user-facing changes!!! The new layout work is behind a feature flag!
Summary
Part of workspace chrome work.
This is follow up to #224255, #225824 which mostly implements the new layout for project (serverless) navigation.
Implementation notes:
How to review
kibana.yml: