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

[Serverless] Changes to TopNavMenu placement for serverless projects. #158053

Merged
merged 7 commits into from
May 22, 2023

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented May 18, 2023

Summary

Part of #158034

This PR moves the TopNavMenu placement to below the breadcrumbs bar for the serverless project chrome layout.

The app toolbar must appear below the breadcrumbs bar in the layout, when the app has TopNavMenu items registered with the navigation service.

To prevent the layout from rendering an empty container, I had to create a new hook, useHeaderActionMenuMounter, that extracts the state from HeaderActionMenu. The state (mounter: MountPoint | undefined) is hoisted above so that the header can check if it is empty before rendering the container.

Future work is still needed to achieve the end goal of the design. Apps must be able to define custom layouts, which commonly require grid and spacer components. The TopNavMenu needs augmentation to support the new API. See the project document from the issue.

Screenshots

App showing the toolbar, with the container shown below breadcrumbs
image

App without the toolbar and no empty container
image

@tsullivan tsullivan added Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Project:Serverless Work as part of the Serverless project for its initial release labels May 18, 2023
@tsullivan tsullivan self-assigned this May 18, 2023
@tsullivan tsullivan force-pushed the serverless/app-toolbar-discover branch from 6fa3f85 to e3578ce Compare May 18, 2023 02:55
@tsullivan tsullivan force-pushed the serverless/app-toolbar-discover branch from e3578ce to 8be4dab Compare May 18, 2023 19:44

act(() => {
menuMount$.next(createMountPoint('FOO'));
});
await refresh();
Copy link
Member Author

Choose a reason for hiding this comment

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

Minor cleanup: I've removed the unnecessary await statements, as they create warnings in my editor.

@tsullivan tsullivan force-pushed the serverless/app-toolbar-discover branch from 8d08509 to c674d5e Compare May 18, 2023 21:33
@tsullivan tsullivan force-pushed the serverless/app-toolbar-discover branch from c674d5e to c75427b Compare May 18, 2023 21:34
@tsullivan tsullivan marked this pull request as ready for review May 18, 2023 21:37
@tsullivan tsullivan requested a review from a team as a code owner May 18, 2023 21:37
@elasticmachine
Copy link
Contributor

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

@tsullivan tsullivan added the release_note:skip Skip the PR/issue when compiling release notes label May 18, 2023
@tsullivan tsullivan changed the title [Serverless] POC allow customizations for app toolbar [Serverless] Changes to TopNavMenu placement for serverless projects. May 18, 2023
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Code review only. Approving now, as I know future changes to match designs are coming.

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.

LGTM - tested locally
thanks for the test addition with mounter undefined 👍🏻

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.

LGTM - tested locally
thanks for the test addition with mounter undefined 👍🏻

@kibana-ci
Copy link
Collaborator

💚 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 365.7KB 365.8KB +185.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 400 404 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 480 484 +4
total +6

History

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

cc @tsullivan

@tsullivan tsullivan merged commit dba3c03 into elastic:main May 22, 2023
@tsullivan tsullivan deleted the serverless/app-toolbar-discover branch May 22, 2023 16:00
@kibanamachine kibanamachine added v8.9.0 backport:skip This commit does not require backporting labels May 22, 2023
delanni pushed a commit to delanni/kibana that referenced this pull request May 25, 2023
…elastic#158053)

## Summary

Part of elastic#158034

This PR moves the TopNavMenu placement to below the breadcrumbs bar for
the serverless project chrome layout.

The app toolbar must appear below the breadcrumbs bar in the layout,
when the app has TopNavMenu items registered with the navigation
service.

To prevent the layout from rendering an empty container, I had to create
a new hook, `useHeaderActionMenuMounter`, that extracts the state from
HeaderActionMenu. The state (`mounter: MountPoint | undefined`) is
hoisted above so that the header can check if it is empty before
rendering the container.

_Future work is still needed to achieve the end goal of the design._
Apps must be able to define custom layouts, which commonly require grid
and spacer components. The TopNavMenu needs augmentation to support the
new API. See the project document from the issue.

## Screenshots
**App showing the toolbar, with the container shown below breadcrumbs**

![image](https://github.com/elastic/kibana/assets/908371/a6f49772-2f0b-4e4a-9a32-7b02398bd0b2)

**App without the toolbar and no empty container**

![image](https://github.com/elastic/kibana/assets/908371/df361b26-1bb0-430a-98c1-863de4cde2da)
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 Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants