Skip to content

[Workspace Chrome] Bootstrap grid layout for project nav#225772

Merged
Dosant merged 20 commits intoelastic:mainfrom
Dosant:d/2025-06-13-application-layout-3
Jul 3, 2025
Merged

[Workspace Chrome] Bootstrap grid layout for project nav#225772
Dosant merged 20 commits intoelastic:mainfrom
Dosant:d/2025-06-13-application-layout-3

Conversation

@Dosant
Copy link
Copy Markdown
Contributor

@Dosant Dosant commented Jun 30, 2025

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.

Screenshot 2025-07-01 at 15 04 45

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

Dosant added 19 commits June 23, 2025 12:03
…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

# 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

const root: EmotionFn = ({ euiTheme }) => css`
position: sticky;
overflow: hidden;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@Dosant Dosant changed the title [WIP] Project nav grid [Workspace Chrome] Bootstrap grid layout for project nav Jul 1, 2025
@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// labels Jul 1, 2025
@Dosant Dosant marked this pull request as ready for review July 1, 2025 13:14
@Dosant Dosant requested a review from a team as a code owner July 1, 2025 13:14
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

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

id before after diff
core 471.8KB 473.0KB +1.2KB

History

Copy link
Copy Markdown
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

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?

@Dosant
Copy link
Copy Markdown
Contributor Author

Dosant commented Jul 3, 2025

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.

@Dosant Dosant requested a review from clintandrewhall July 3, 2025 07:54
Copy link
Copy Markdown
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

Nice work.

@@ -489,59 +577,13 @@ export class ChromeService {

// render header
if (chromeStyle === 'project') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This was the kind of check I wanted delegated to the layout service.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, I see now. 🎉

@@ -28,7 +29,10 @@ const globalLayoutStyles = (euiTheme: UseEuiTheme['euiTheme']) => css`
--kbnHeaderBannerHeight: var(--kbn-layout--banner-height, 0px);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is never going to be falsey, right? Because of line 63? Or am I missing something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it can be falsey if there is no padding-inline-end or padding-inline styles set on body

@Dosant Dosant merged commit 222d16b into elastic:main Jul 3, 2025
10 checks passed
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
)

> [!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.


![Screenshot 2025-07-01 at 15 04
45](https://github.com/user-attachments/assets/270a9871-4eec-49ac-bb75-75ea1b68916e)

### 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
@Dosant Dosant added the chrome-grid Work related to Chrome refactor to grid layout label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting chrome-grid Work related to Chrome refactor to grid layout release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants