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

fix(build): update to PF6 betas #228

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

jenny-s51
Copy link
Collaborator

@jenny-s51 jenny-s51 commented Jul 30, 2024

What

Update to beta versions.

Docs workspace looks good with PR updates (see below for generated link preview once build passes).

Demo app needs some CSS updates to viewport heights to fix the demos. This is a known issue - currently investigating and will push the updates here once resolved.

  • Updates CSS to fix demo viewport heights
  • Updates brand img to use new PF logo
  • Removes padding:0 to fix control bar positioning

Can see the current state of the demo-app here: https://v6-betas.surge.sh/

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

@jenny-s51 jenny-s51 marked this pull request as draft July 30, 2024 21:17
@patternfly-build
Copy link

patternfly-build commented Jul 30, 2024

Copy link
Contributor

@dlabaj dlabaj left a comment

Choose a reason for hiding this comment

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

@jenny-s51 Looks like snap shots need updating.

@jenny-s51 jenny-s51 changed the title [WIP] fix(build): update to PF6 betas fix(build): update to PF6 betas Aug 2, 2024
Copy link
Collaborator 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.

Updated to fix UI issues in the demo app, added changes to PR description.

@jeff-phillips-18 curious to get your thoughts, Topology Package and Styles -> Labels demos are cutting off the bottom part of the graph view with these updates. Is there a way to load in the graph at a smaller size for those demos?

@jeff-phillips-18
Copy link
Member

@jenny-s51 This is no different from the past. We could decrease the space between the rows if we wanted but it is really just dependent on the browser height. The user can pan the view to see those items not in view.

@jenny-s51
Copy link
Collaborator Author

jenny-s51 commented Aug 5, 2024

Thank you @jeff-phillips-18 for your clarity here. Marking this PR as ready for review with the existing updates cc @dlabaj @nicolethoen

@jenny-s51 jenny-s51 marked this pull request as ready for review August 5, 2024 17:06
@jenny-s51 jenny-s51 requested a review from dlabaj August 5, 2024 17:06
@@ -77,4 +77,10 @@

.pf-v6-c-toolbar__content.pf-m-hidden {
display: none;
}

.pf-v6-c-page__main-container,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we introduced a prop that applies these styles to page sections. Let me ask the scrum channel

Copy link
Contributor

Choose a reason for hiding this comment

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

@jenny-s51 here's the response I got from @mcoker

The general setup is, if you have a page section(s) you want to fill the available space, you add isContentFilled to and that tells the container that wraps the page content to fill the viewport (the white background will extend the height of the viewport). Then you need to add isFilled to any page sections you want to fill that space.

Here's an example w/ those deets - https://staging-v6.patternfly.org/components/page#filled-page-sections

and here's a codesandbox - https://codesandbox.io/s/sweet-frog-pp7zcr?file=/index.tsx:1761-1776

(FWIW the old behavior in v5 was that the main content area always filled the viewport height, and the last page section (whichever matches :last-child) would be filled by default. If you wanted to, for example, have the first page section fill the viewport instead, you'd add isFilled to the first page section, then add isFilled={false} to the last page section

If you see isFilled={false} that's probably why. That's no longer needed in v6)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch, thank you @nicolethoen. I asked @mcoker a follow-up question in the Slack thread after applying these suggested changes , curious to get his thoughts on this. We want a StackItem to fill the height of the PageSection and currently without the height set on .pf-v6-c-page__main-body, the fill does not get applied even though StackItem has the pf-m-fill class as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the custom styling on the page components - added hasBodyWrapper={false} to the filled <PageSections> per @mcoker 's suggestion which resolved the issue

@@ -23,6 +22,7 @@
.pf-ri__topology-demo .pf-v6-c-toolbar {
--pf-v6-c-toolbar__expandable-content--lg--PaddingBottom: 0;
--pf-v6-c-toolbar--PaddingBottom: 0;
--pf-v6-c-toolbar--PaddingBlockStart: var(--pf-t--global--spacer--300);
Copy link
Contributor

@nicolethoen nicolethoen Aug 5, 2024

Choose a reason for hiding this comment

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

I see some references to base tokens in this CSS. Ideally we would use semantic tokens without --300 or other numbers at the end.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @nicolethoen ! Updated to use semantic tokens with the exception of --pf-t--color--red--50 , which I couldn't find referenced with any semantic tokens in https://github.com/patternfly/patternfly/blob/v6/src/patternfly/base/tokens

@jeff-phillips-18
Copy link
Member

Do we know the cause of the changes to the toolbar alignment:

v5:
image

v6:
image

@nicolethoen
Copy link
Contributor

@jeff-phillips-18 are you using a flex layout in the toolbar?

@jenny-s51
Copy link
Collaborator Author

jenny-s51 commented Aug 6, 2024

@nicolethoen yes we do wrap the toolbar items in a Flex layout

@jeff-phillips-18
Copy link
Member

@jeff-phillips-18 are you using a flex layout in the toolbar?

It is using Flex for the outer container, and Split for the layout label and dropdown.

@nicolethoen
Copy link
Contributor

if you remove the Split, does it look better?

@jeff-phillips-18
Copy link
Member

jeff-phillips-18 commented Aug 6, 2024

Yes. Changing the Split to Flex and using the center align setting fixes the issue and aligns everything nicely. I've PR'd a fix to this PR for that.

Just kinda wondering why the difference between v5 and v6?

@nicolethoen
Copy link
Contributor

Lots of spacing was streamlined and standardized to use the tokens. So more components should aligns and be spaced better out of the box 👍🏻

<Split>
<SplitItem>
<Flex flexWrap={{ default: 'nowrap' }} gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}>
<FlexItem>
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you don't have a flex layouts in the toolbar at all?

you could use:

<ToolbarItem variant='label'>Layout:</ToolbarItem>
<ToolbarItem'><Dropdown.../></ToolbarItem>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Working on refactoring these instances where we use Flex layouts to use the syntax above

Copy link
Member

Choose a reason for hiding this comment

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

The reason I used a single ToolbarItem with a Flex for the label and input was so that the label and input would look more related (less space between them than between the input and the next label). Also, if the widow width is less, the new implementation cuts off the items rather than wrapping.

Before:
image

After:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for clarifying @jeff-phillips-18 , reverted back to your changes in jenny-s51#11

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.

LGTM

update PF icon, update styling to fix demo-app examples

update snapshots

fix brand height

remove custom page styles, add props to fix page fill

wip toolbar refactor for topology package

update to semantic tokens

refactor split and flex instances in favor of toolbar components

remove unused split components

revert toolbar refactor
@jeff-phillips-18 jeff-phillips-18 merged commit 40649ff into patternfly:v6 Aug 6, 2024
8 checks passed
Copy link

github-actions bot commented Aug 6, 2024

🎉 This PR is included in version 6.0.0-alpha.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

5 participants