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 Nav] Fix issues with sticky app menu subheader #168372

Merged
merged 18 commits into from
Oct 13, 2023

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Oct 9, 2023

Summary

Screenshot 2023-10-10 at 17 23 58

  • Fixes empty app header for top_nav component, for example, discover doc page:

Screenshot 2023-10-10 at 17 24 45

Screenshot 2023-10-10 at 17 26 56

@@ -28,7 +29,7 @@ export const AppMenuBar = ({ headerActionMenuMounter }: AppMenuBarProps) => {
display: flex;
justify-content: end;
align-items: center;
padding: ${euiTheme.size.s};
height: var(--kbnProjectHeaderAppActionMenuHeight, ${euiTheme.size.xxxl});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making the app menu height fixed.

It is also important to not render the menu if there are no actions. There is no good way for app menu component to know if there is content inside. We'd try to improve places where apps set the menu mount point, so that apps stopped setting the mount point if there is no actions

Copy link
Member

@cee-chen cee-chen Oct 11, 2023

Choose a reason for hiding this comment

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

This feels super elegant - it's also great that a plugin could theoretically update the --kbnProjectHeaderAppActionMenuHeight CSS variable and have everything update automatically, if they don't want to use the default xxxl height. Feels really flexible / future-proof!

// header banner, and is visible or hidden
height: calc(100vh - var(--euiFixedHeadersOffset, 0) - #{$additionalOffset});
// header banner, app menu, and is visible or hidden
height: calc(100vh - var(--kbnAppHeadersOffset, 0) - #{$additionalOffset});
Copy link
Contributor Author

@Dosant Dosant Oct 10, 2023

Choose a reason for hiding this comment

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

Fixes double scroll in serverless discover caused by incorrect app container height

{renderMenu(menuClassName)}
</span>
</MountPointPortal>
{(badgesEl || menuEl) && (
Copy link
Contributor Author

@Dosant Dosant Oct 10, 2023

Choose a reason for hiding this comment

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

Fixes empty app header for top_nav component, for example, discover doc page:

target="_blank"
color="warning"
iconType="editorComment"
<HeaderMenuPortal
Copy link
Contributor Author

@Dosant Dosant Oct 10, 2023

Choose a reason for hiding this comment

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

Fixes empty app header for oblt onboarding page #163326

Dosant and others added 5 commits October 10, 2023 17:16
…instead

+ separate `kbnBody--projectActionMenuVisible` into its own selector, to improve readability and reduce CSS specificity
@Dosant Dosant changed the title fix sticky header attempt 1 [Serverless Nav] Fix issues with sticky app menu subheader Oct 11, 2023
@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Project:Serverless Work as part of the Serverless project for its initial release Feature:Chrome Core's Chrome UI (sidenav, header, breadcrumbs) labels Oct 11, 2023
@Dosant Dosant marked this pull request as ready for review October 11, 2023 11:54
@Dosant Dosant requested review from a team as code owners October 11, 2023 11:54
@elasticmachine
Copy link
Contributor

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

@Dosant Dosant self-assigned this Oct 11, 2023
Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed the code changes
Tested the Security Alerts page issue locally

Copy link
Member

@cee-chen cee-chen 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 this amazingly clean fix Anton!!! I love it!

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Thanks Anton!

I don't want to block this obvious improvement so approving with a follow-up item.

I'll create a separate issue to track the layering where the app menu overlaps the global header, as seen below:

CleanShot 2023-10-12 at 08 15 03@2x CleanShot 2023-10-12 at 08 18 13@2x

@Dosant
Copy link
Contributor Author

Dosant commented Oct 13, 2023

I don't want to block this obvious improvement so approving with a follow-up item.

I'll create a separate issue to track the layering where the app menu overlaps the global header, as seen below:

Thanks! I took a closer look. Seems like this is not a regression from this pr 😮‍💨, so should be good to continue with merging this

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Love it! thanks @Dosant
LGTM

…x-sticky-header

# Conflicts:
#	x-pack/plugins/observability_onboarding/public/application/app.tsx
@Dosant Dosant removed the request for review from a team October 13, 2023 10:27
@sebelga
Copy link
Contributor

sebelga commented Oct 13, 2023

I'll create a separate issue to track the layering where the app menu overlaps the global header, as seen below:

@ryankeairns Would have to double check but I think I fixed it in my work for the panel. Had to have it on top of anything else. So the global header (where the side nav + panel lives) is on top of everything... But not merged in main.

Can you cross link my PR (#167774) in your issue and make sure my PR closes it? Cheers!

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
navigation 16 32 +16

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
kibanaReact 138 137 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 574.8KB 575.0KB +224.0B
links 25.2KB 25.3KB +56.0B
maps 2.8MB 2.8MB +56.0B
securitySolution 13.0MB 13.0MB +27.0B
total +363.0B

Page load bundle

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

id before after diff
core 366.3KB 367.4KB +1.1KB
kibanaReact 47.8KB 47.2KB -568.0B
navigation 9.8KB 11.6KB +1.8KB
painlessLab 9.9KB 9.9KB +56.0B
searchprofiler 19.4KB 19.4KB +56.0B
total +2.5KB
Unknown metric groups

API count

id before after diff
kibanaReact 176 173 -3

References to deprecated APIs

id before after diff
navigation 3 0 -3

History

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

cc @Dosant

@Dosant Dosant merged commit 326ef31 into elastic:main Oct 13, 2023
35 checks passed
@kibanamachine kibanamachine added v8.12.0 backport:skip This commit does not require backporting labels Oct 13, 2023
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
…68372)

## Summary

- Fixes sticky kql bar in serverless security project
elastic#167908
- Fixes double scroll in serverless discover caused by incorrect app
container height cc @elastic/kibana-data-discovery

![Screenshot 2023-10-10 at 17 23
58](https://github.com/elastic/kibana/assets/7784120/3bf50299-7d9f-4c38-953a-33a6a75815c6)

- Fixes empty app header for top_nav component, for example, discover
doc page:

![Screenshot 2023-10-10 at 17 24
45](https://github.com/elastic/kibana/assets/7784120/4965deac-9472-402f-8e8e-66ede83ce1bb)

---------
Co-authored-by: Cee Chen <constance.chen@elastic.co>
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 Feature:Chrome Core's Chrome UI (sidenav, header, breadcrumbs) 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.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants