Skip to content

Conversation

kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Aug 12, 2021

What: Closes #6119

In this PR:

  • Adds Masthead, MastheadToggle, MastheadBrand, MastheadMain, MastheadContent
  • Adds isFullHeight flag to Dropdown and ContextSelector (for demo)
  • Adds Masthead unit tests, Masthead integration demo

Open issues:

  • Masthead is missing inset modifiers on css (core issue open) but the property is in place
  • Styling on demo context selector + dropdown is off due to ToolbarContent having align-items: center (which is limiting the full height). @mattnolting @mcoker Should I override the property on pf-c-toolbar__content? I noticed that this element is not in the HTML demo at all but our react component bundles pf-c-toolbar__content and pf-c-toolbar__content-section together under ToolbarContent.

@patternfly-build
Copy link
Contributor

patternfly-build commented Aug 12, 2021

Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

Did you or could you open an issue to convert the reusable demo header/page you created to use the masthead?

@CooperRedhat
Copy link
Contributor

image

I took the MastheadBrand out of its MastheadMain wrapper and it broke the layout. From the docs it's not immediately clear that it needs that wrapper (however the examples make it clear). Should we enforce that wrapper in code, or mention it in the docs? Not sure the best practice in this case.

Otherwise LGTM

@CooperRedhat CooperRedhat self-requested a review August 16, 2021 21:28
@kmcfaul
Copy link
Contributor Author

kmcfaul commented Aug 17, 2021

Yeah the relationship between MastheadMain and MastheadBrand is a little loose due to Masthead's composable structure. The initial idea was to leave it open to the user to include other elements with the MastheadBrand (or replace it altogether) under MastheadMain. I'll update the documentation to make it clear that Masthead expects MastheadToggle, MastheadMain, and MastheadContent, and that MastheadMain will typically contain a MastheadBrand.

The other option is to roll MastheadMain into MastheadBrand and not let anything else be put in the main div. Anyone have opinions?

@kmcfaul
Copy link
Contributor Author

kmcfaul commented Aug 17, 2021

Added the expected structure to the docs

Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

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

Looks good @kmcfaul but I did have a question about the demo you are showing. We had defined unique styles for the dropdowns placed in the masthead but I don't see those applied here. @mattnolting can you comment regarding what's needed to pull those in? They are seen in the core demo here: https://www.patternfly.org/v4/components/masthead

@nicolethoen
Copy link
Contributor

The other option is to roll MastheadMain into MastheadBrand and not let anything else be put in the main div. Anyone have opinions?

In my memory, keeping the two components separate left room for someone to have a clickable logo AND a non-clickable text or company name or something like that. I'm not sure if thats likely or something we really want to allow, but I'm fine either way.

@kmcfaul
Copy link
Contributor Author

kmcfaul commented Aug 17, 2021

@mcarrano The new modifiers are in place for Dropdown/ContextSelector, but the difference in height is caused by a difference in HTML. Our ToolbarContent component contains two divs with the classes pf-c-toolbar__content and pf-c-toolbar__content-section while the HTML demo only uses pf-c-toolbar__content-section. The align-items css property on pf-c-toolbar__content is causing the height to shrink.

I need guidance on how we want to resolve the difference, I can either override the align-items property or manually create the single pf-c-toolbar__content-section div inside the demo code, or we need a styling/html update.

@mcoker @mattnolting

@mattnolting
Copy link
Contributor

@kmcfaul I think we need to make a styling update in Core.

mattnolting
mattnolting previously approved these changes Aug 18, 2021
Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

This looks great @kmcfaul! My only nit is that, in the demo, I wouldn't expect the dropdown to be pf-m-full-height, just the context selector.

}
isOpen={isDropdownOpen}
dropdownItems={dropdownItems}
isFullHeight
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think this would be isFullHeight

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The HTML demo has the dropdown with pf-m-full-height though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you're right. I should change that to dropdown with image and text. Issue 4320

CooperRedhat
CooperRedhat previously approved these changes Aug 18, 2021
nicolethoen
nicolethoen previously approved these changes Aug 18, 2021
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

Looks great Katie. Just a few nits.

@kmcfaul kmcfaul dismissed stale reviews from nicolethoen and CooperRedhat via fe0ae6f August 19, 2021 16:08
tlabaj
tlabaj previously approved these changes Aug 19, 2021
@kmcfaul
Copy link
Contributor Author

kmcfaul commented Aug 19, 2021

Will have 1 minor update when core bump gets merged to fix the toolbar demo css

tlabaj
tlabaj previously approved these changes Aug 20, 2021
Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

Looks great! Left a couple of questions. Only thing I think needs to be updated is the dropdown menu alignment since it's going off screen currently.

Screen Shot 2021-08-20 at 11 04 53 AM

tlabaj
tlabaj previously approved these changes Aug 20, 2021
mcoker
mcoker previously approved these changes Aug 20, 2021
Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM!

@nicolethoen
Copy link
Contributor

I'm noticing that the Logo link is not navigable using the keyboard. Not sure why that is...

@kmcfaul kmcfaul dismissed stale reviews from mcoker and tlabaj via d2e7608 August 23, 2021 15:10
@kmcfaul
Copy link
Contributor Author

kmcfaul commented Aug 23, 2021

Updated the MastheadBrand to have a tabIndex

@tlabaj tlabaj merged commit 7f152d0 into patternfly:main Aug 23, 2021
@patternfly-build
Copy link
Contributor

Your changes have been released in:

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new Masthead component
10 participants