Skip to content

Conversation

@jenny-s51
Copy link
Contributor

What: Closes #7429

@patternfly-build
Copy link
Collaborator

patternfly-build commented Jun 6, 2022

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.

Looks like the left/right padding in the masthead, as well as the image size of the PatternFly logo are both a little larger on the react dashboard wrapper than the core demos.

Jun-07-2022 13-35-14

Also, should this update include updates to the masthead in the page demos? Those are the only full page demos, i believe, that don't use the dashboard wrapper.

Copy link
Contributor Author

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

Thank you for your feedback @nicolethoen ! I think that gif is showing the difference between the react workspaces, i.e. on main vs on this branch. Did you mean to show the difference between the react and core workspaces?

I've increased the size of the masthead inset padding to match the size of the page inset as shown in the core demo, which might be causing the toolbar item spacing to look different by a few pixels. I've also increased the Brand/logo size to match the exact size in the core demos too.

I checked all the HTML elements and the components/styling all do seem to match core. Looks like the toolbar items are still a few pixels away from their placement in core though... would be awesome to get some opinions/feedback on this styling from the core folks! @mattnolting @mcoker

Copy link
Contributor Author

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

Also, yes, it looks like we do need to update Page with the new DashboardWrapper @nicolethoen ! I've opened and assigned myself to #7526! Will plan to update those full screen demos with these changes once they are approved 👍

@nicolethoen
Copy link
Contributor

Did you mean to show the difference between the react and core workspaces?

oh - you're right. I thought I had the core demo up... my bad.

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.

It's looking great! The only other thing I'm noticing is that there is a missing kebab menu in the masthead at smaller screen widths

your PR:
Screen Shot 2022-06-08 at 9 21 30 AM

core demo:
Screen Shot 2022-06-08 at 9 21 42 AM


const masthead = (
<Masthead>
<Masthead inset={{ default: 'insetLg' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

The inset should change between mobile/desktop layouts - 16px (insetMd) on mobile (< 1200px or $pf-global--breakpoint--xl by default) and 24px on desktop (insetLg).

We manage that for the user here, if the page isn't set to use the resize observer to manage the breakpoint for mobile/desktop - https://github.com/patternfly/patternfly/blob/53539639ef305b90fcfe9576b6962d8c1a5247be/src/patternfly/components/Masthead/masthead.scss#L160-L162

That seems to imply that if using the resize observer, the user is expected to manage the masthead inset themselves? Or maybe that's an oversight and our resize observer code should apply the appropriate inset manually?

I think that CSS is a bit problematic though, because it isn't just the masthead that has a dynamic inset between mobile/desktop layout. The nav, page sections, table, data list, etc all have a dynamic inset managed by CSS at the mobile/desktop breakpoint. So unless the resize observer is changing all of those things, I think this is going to lead to inconsistent insets.

IMO we could just leave the insets as they are in the masthead to change at our default breakpoint (1200px/$pf-global--breakpoint--xl), which ties the insets to viewport size instead of the configurable layout change that can be set using the resize observer. Seems acceptable to me, and likely the easiest approach. FWIW with the upcoming major version release, design is on board with just using a single inset for all screen sizes, which would alleviate all of this.

@mattnolting you have done the resize observer work so far - wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mcoker this seems like an oversight. I agree that page insets should remain based on viewport width, as all other component insets are based on viewport width. Using a consistent page inset resolves these issues, which will be great to have when we can make the update, but until then, leaving the insets as they are and opening a Core issue to update the supporting CSS makes sense to me.

alt="Fallback patternFly default logo"
>
<source media="(min-width: 768px)" srcSet="/assets/images/logo__pf--reverse-on-md.svg" />
<source srcSet="/assets/images/logo__pf--reverse--base.svg" />
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

</ToolbarItem>
</ToolbarGroup>
<ToolbarItem visibility={{ default: 'hidden', sm: 'visible', md: 'visible', lg: 'hidden' }}>
<ToolbarItem visibility={{ default: 'visible', sm: 'visible', md: 'visible', lg: 'hidden', xl: 'hidden' }}>
Copy link
Contributor

@mcoker mcoker Jun 15, 2022

Choose a reason for hiding this comment

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

Untested, but I believe all but lg are needed - it should be visible by default, and once it's set at a breakpoint, it persists through subsequent breakpoints by default.

Suggested change
<ToolbarItem visibility={{ default: 'visible', sm: 'visible', md: 'visible', lg: 'hidden', xl: 'hidden' }}>
<ToolbarItem visibility={{ lg: 'hidden' }}>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great catch @mcoker!! Fixed 👍

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

Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

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

lgtm!

@kmcfaul kmcfaul merged commit 2a6fec9 into patternfly:main Jun 22, 2022
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.61.17
  • @patternfly/react-catalog-view-extension@4.73.17
  • @patternfly/react-charts@6.75.17
  • @patternfly/react-code-editor@4.63.17
  • @patternfly/react-console@4.73.17
  • @patternfly/react-core@4.222.17
  • @patternfly/react-docs@5.83.17
  • @patternfly/react-icons@4.73.17
  • @patternfly/react-inline-edit-extension@4.67.17
  • demo-app-ts@4.182.17
  • @patternfly/react-integration@4.184.17
  • @patternfly/react-log-viewer@4.67.17
  • @patternfly/react-styles@4.72.17
  • @patternfly/react-table@4.91.17
  • @patternfly/react-tokens@4.74.17
  • @patternfly/react-topology@4.69.17
  • @patternfly/react-virtualized-extension@4.69.17
  • transformer-cjs-imports@4.60.17

Thanks for your contribution! 🎉

jenny-s51 added a commit to jenny-s51/patternfly-react that referenced this pull request Jul 26, 2022
)

* align dashboardwrapper with core

* remove inset from toolbar

* tests

* update mastheadToggle.tsx

* fix kebab visibility

* fix circular dependency

* PR feedback from mcoker, mattnolting

* visibility comment from mcoker
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.

[Dashboard wrapper] - [Update to Match core demos]

7 participants