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

Bump to vanilla-4.7.0 #13548

Merged
merged 10 commits into from
Feb 21, 2024
Merged

Bump to vanilla-4.7.0 #13548

merged 10 commits into from
Feb 21, 2024

Conversation

petesfrench
Copy link
Contributor

@petesfrench petesfrench commented Feb 7, 2024

Done

QA

  • Check that nothing is broken after upgrading vanilla

@webteam-app
Copy link

Demo starting at https://ubuntu-com-13548.demos.haus

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4429156) 74.41% compared to head (47bdb30) 74.41%.
Report is 92 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13548   +/-   ##
=======================================
  Coverage   74.41%   74.41%           
=======================================
  Files         107      107           
  Lines        2838     2838           
  Branches      946      946           
=======================================
  Hits         2112     2112           
  Misses        702      702           
  Partials       24       24           

Copy link
Contributor

@mtruj013 mtruj013 left a comment

Choose a reason for hiding this comment

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

Couple meganav bugs:

bubble nav items aren't aligned as expected:
Screenshot from 2024-02-07 16-08-26
vs:
Screenshot from 2024-02-07 16-08-33

Search icon appears on new line on landing:
Screenshot from 2024-02-07 16-06-04

@@ -1366,20 +1366,6 @@ $color-link-dark: #69c !default;
}
}

// XXX: @bartaz: this will be covered in Vanilla
// can be removed once https://github.com/canonical/vanilla-framework/issues/4875 is done and released
.p-logo-section.has-misaligned-images {
Copy link
Contributor

@mtruj013 mtruj013 Feb 7, 2024

Choose a reason for hiding this comment

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

I haven't finished qa'ing all the pages that use this, but it looks like the logo sections in https://ubuntu-com-13548.demos.haus/financial-services still look buggy without it compare to prod

Copy link
Member

Choose a reason for hiding this comment

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

Also, this seems to just remove the comment, but not actual code. Is this intended?

@bartaz
Copy link
Member

bartaz commented Feb 7, 2024

Couple meganav bugs:

@petesfrench @mtruj013 The main change in 4.7.0 was the increased padding of top navigation items. With 4.7.0 top nav items have padding equal to grid margin width (on large screens). (1.5rem vs previous 1rem).
So indeed it may cause some issues there. If anything was aligned to nav before, this will need to be realigned.

Similarly if there is a lot of elements in the nav (and meganav seems to be very packed) the $breakpoint-navigation-threshold may need to be adjusted to drop to mobile view as soon as they don't fit.

If there are any issues that make the new padding too large for meganav ping me and @lyubomir-popov, as maybe we would need some exception for such dense navigation…

@petesfrench
Copy link
Contributor Author

@bartaz @lyubomir-popov In the case of the meganav we already use a custom padding-right: 2.5rem to account for the down arrow and the additional 0.5rem on each button will make it too wide. In this situation would it be viable to maintain the padding-left: 1rem that we are currently using?

@bartaz
Copy link
Member

bartaz commented Feb 9, 2024

Also, 4.7.0 introduces p-navigation__row--25-75 that is more reliable way to implement grid in top nav than using row and cols.

https://vanillaframework.io/docs/examples/patterns/navigation/default

@@ -200,6 +200,10 @@ $meganav-height: 3rem;
}

.p-navigation__row--25-75 {
.p-navigation__items:first-child {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? p-navigation__row--25-75 was added specifically to avoid need for custom styling to match the grid.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ok, it's because you override the left padding on the nav items, so you need to compensate.

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 custom padding around the buttons (due to the chevron) means it doesn't align by default

@petesfrench petesfrench requested a review from bartaz February 13, 2024 13:43
Copy link
Member

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

Code looks good to me (with couple comments below), but I don't know which parts are relevant for QA to make sure there are no regressions.

templates/templates/_navigation.html Outdated Show resolved Hide resolved
templates/templates/_navigation.html Outdated Show resolved Hide resolved
templates/templates/_navigation.html Outdated Show resolved Hide resolved
templates/templates/_navigation.html Outdated Show resolved Hide resolved
margin-right: 0;
max-height: calc(100vh - 3rem);
width: auto;

.p-navigation__items {
width: 100%;

& > .p-navigation__item--dropdown-toggle > .p-navigation__link {
Copy link
Member

Choose a reason for hiding this comment

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

It's probably out of scope for this PR, as it doesn't originate here, but the way the navigation is implemented here, with A LOT of overrides of very specific Vanilla class names is quite fragile and possibly problematic whenever we update something in Vanilla.

Variants like these ideally should be implemented with different class names from Vanilla. So instead of overriding & > .p-navigation__item--dropdown-toggle > .p-navigation__link, you would define p-navigation__link--dense (or whatever is the purpose of this) and use this new class name instead.

But as I mentioned, it's not just this one thing in this PR, the whole navigation seems to be written this way, so I mention this as maybe a potential for future improvements/refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I have made a separate issue to tackle this as not to block this work https://warthogs.atlassian.net/browse/WD-8935

@juanruitina
Copy link
Contributor

I see the search button have some padding that didn't before. This might seem minor, but it is reducing the gap between "Get Ubuntu" and "All Canonical", making it barely noticeable particularly when the user is logged in.

There are some alignment issues on the mobile navigation, at the left of the nav items:

ubuntu-com-13548 demos haus_desktop(iPhone SE)
ubuntu-com-13548 demos haus_(iPhone SE)

@petesfrench
Copy link
Contributor Author

@lyubomir-popov could you give this a look please

@juanruitina
Copy link
Contributor

I see the search button have some padding that didn't before. This might seem minor, but it is reducing the gap between "Get Ubuntu" and "All Canonical", making it barely noticeable particularly when the user is logged in.

Elaborating a bit on this, see these screenshots:

This is what it looks like in the live version:

ubuntu com_

This is what it looks like in the demo:

ubuntu-com-13548 demos haus_

See how the gap between "Get Ubuntu" and "All Canonical" virtually disappears, making it all look like one long list instead of two, one left aligned the other right aligned. This arguably increases cognitive download and hinders the sense of hierarchy that separating them provides. @lyubomir-popov thoughts on it?

@bartaz
Copy link
Member

bartaz commented Feb 16, 2024

@juanruitina @petesfrench There seems to be some additional padding in this PR on the right.

What is live seems correct: search button (when hovered) should end exactly where grid ends:

image

On the demo there is some additional "padding" that squeezes the navigation:

image

But I can't figure out what causes this. It's not actuall padding or margin, it seems like the items in the nav are not spanning whole width of available space.

@bartaz
Copy link
Member

bartaz commented Feb 16, 2024

@petesfrench I think I see what the issue is.

You have all the nav items in a single p-navigation__items list.

But if you want to have 2 sets: one left aligned, and the other right aligned, you need two separate p-navigation__items lists, not one.

Compare to Vanilla home page:

image

https://vanillaframework.io/

The misalignment is caused because the first navigation items list is shifted to the left (to align with the grid). So if it includes the right aligned items, those are shifted as well. Right aligned items need to be in separate list.

@petesfrench
Copy link
Contributor Author

@bartaz @juanruitina I have added a negative margin to the top nav so it aligns. The reason for having them all in my list is to simplify the JS logic that handles the navigation. Sticking to the vanilla pattern would be better but would require some refactoring of the code which I would like to avoid right now. What do you think?

@petesfrench
Copy link
Contributor Author

Merging without 4.8.0 as it requires more SCSS changes and would grow the scope of this PR.

@petesfrench petesfrench merged commit 478db36 into main Feb 21, 2024
26 of 28 checks passed
@petesfrench petesfrench deleted the vanilla-4.7.0 branch February 21, 2024 13:49
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.

6 participants