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

Main navigation dropdown #12038

Merged
merged 18 commits into from
Apr 29, 2024
Merged

Main navigation dropdown #12038

merged 18 commits into from
Apr 29, 2024

Conversation

jhonatan-lopes
Copy link
Contributor

@jhonatan-lopes jhonatan-lopes commented Mar 13, 2024

Description

Merge Method
💡❗Remember to use regular merge for merging this feature branch into main

┆Issue is synchronized with this Jira Task

@jhonatan-lopes jhonatan-lopes marked this pull request as draft March 13, 2024 16:59
@jhonatan-lopes jhonatan-lopes force-pushed the feature-branch/main-nav-dropdown branch 2 times, most recently from e1148c8 to e141850 Compare April 3, 2024 15:09
@jhonatan-lopes jhonatan-lopes force-pushed the feature-branch/main-nav-dropdown branch from 1d76c60 to 271769c Compare April 4, 2024 14:56
@jhonatan-lopes jhonatan-lopes force-pushed the feature-branch/main-nav-dropdown branch from 4a4ba71 to 113a87b Compare April 18, 2024 19:46
@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 19, 2024 16:53 Inactive
@sabrinang
Copy link

Great progress on this @jhonatan-lopes! I know you mentioned some things missing but I included some in my review anyway and will leave QA feedback here:

All

  • Iconography: currently using ascii arrows but can use svg arrow icons in button and links and when icons are used (like in featured section) they are squished and cropped but they can shrink proportionally instead
  • Text style: link items are more bold than designed
  • Text alignment: link items can align with column headings so that on hover state the highlighted box extends so text is in alignment instead of the box edge
  • Orientation: no line indicated when on current page

Desktop

  • Dropdown width: is there the possibly of extending width/padding beyond container/grid so there is more horizontal space on desktop (see designs) and this could help extend the column width, so the line length isn’t as short
  • Visual detail: dropdown menu top border grey is a bit thicker than design

Tablet

  • Content alignment: width of content can have more left/right margins to match with nav above
  • Spacing: Increase spacing above newsletter button

Tablet/Mobile

  • Hover state: Primary nav item hover states appear beyond row
  • Open/Closed states: one accordion open at a time (close previously opened ones)

CMS Editing Experience

  • Icons for CMS section: will these be updated with the ones I exported for you?
  • Navigation button: we can add some help text mentioning if overview column is present this buttons appears in that column
  • The spacing of the + signs are very close to the title but it actually aligns with the previous section above it which may be a bit confusing due to the proximity
  • If we have multiple navigations made, how do you toggle between them?

@nancyt1
Copy link
Collaborator

nancyt1 commented Apr 22, 2024

Supplementing Sabrina's comment with screenshots:

  • Missing about 1.5rem of space after the last column on mobile before the divider line. Screenshot 2024-04-19 at 7 36 31 PM
  • Are we able to add more spacing at these lines? It gets confusing what plus sign belongs to which section. SCR-20240419-ommk
  • Nav item should be aligned with the column title. And Is it possible to extend the nav past the mozilla logo and/or decrease margins between the nav columns? Line length does feel a little short.
SCR-20240419-okqs

@jhonatan-lopes
Copy link
Contributor Author

Hi @nancyt1 and @sabrinang, thanks for the feedback!

Some points:

Iconography: currently using ascii arrows but can use svg arrow icons in button and links and when icons are used (like in featured section) they are squished and cropped but they can shrink proportionally instead

I've set up the backend/templates to use SVGs with a width/height of 18px (font size). Non-vector images will get blurry. There is a ticket to put validation in place so that editors only use SVGs on those image choosers but please let me know if you'd like to remove that restriction to also have raster images.

Orientation: no line indicated when on current page

This will be handled in a subsequent ticket.

Dropdown width: is there the possibly of extending width/padding beyond container/grid so there is more horizontal space on desktop (see designs) and this could help extend the column width, so the line length isn’t as short

It's using the container class now, but I'll add some negative margins to make it larger.

Visual detail: dropdown menu top border grey is a bit thicker than design

It's using 1px, exactly as the design indicated. The difference might be that there's 1px from the dropdown's top border + 1px for the navbar's bottom border. I'll try to disable the dropdown's top border on hover and see if that helps.

Open/Closed states: one accordion open at a time (close previously opened ones)

I'll fix it 👍

Icons for CMS section: will these be updated with the ones I exported for you?

Yes, I'll update those!

Navigation button: we can add some help text mentioning if overview column is present this buttons appears in that column

Will do

The spacing of the + signs are very close to the title but it actually aligns with the previous section above it which may be a bit confusing due to the proximity

Yes, this is an issue with Wagtail itself and how it's rendering the form. I'll try to add some CSS overrides from our side...

If we have multiple navigations made, how do you toggle between them?

You can keep multiple snippets under the "Navigation Menus" menu. To activate one of them, go to "Settings" > "Navigation Menu" and then select the one that you want to activate. Once you click save that menu will be active for the site defined in the setting.

Missing about 1.5rem of space after the last column on mobile before the divider line.

Thanks for flagging that up!

Are we able to add more spacing at these lines? It gets confusing what plus sign belongs to which section.

Same thing I've flagged before, it's a Wagtail issue with the form but I'll try to put some overrides on our side.

Nav item should be aligned with the column title. And Is it possible to extend the nav past the mozilla logo and/or decrease margins between the nav columns? Line length does feel a little short.

Will do

@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 23, 2024 10:40 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-feature-br-whaygi April 25, 2024 16:24 Inactive
@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 26, 2024 07:21 Inactive
@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 26, 2024 07:23 Inactive
@nancyt1
Copy link
Collaborator

nancyt1 commented Apr 26, 2024

@jhonatan-lopes Is there a way we can add a super small delay on the menu so it doesn't open immediately on mouse over? I'm thinking about the instances where I'm moving my mouse to something past the menu and I don't really want it to flash open. The wirecutter site does kinda what i was thinking. I also don't want to lose the snappiness of going between menus tho.

Menu.mov

@jhonatan-lopes
Copy link
Contributor Author

Hi @nancyt1, I'll add that to the "animations" ticket!

@nancyt1
Copy link
Collaborator

nancyt1 commented Apr 26, 2024

  1. Requesting some spacing updates to mobile! The red line is where the nav links should line up too. Hope this is better than me just typing it out.
SCR-20240426-lrua
  1. In the mockup we had the blog right aligned so that it feels more connected when opened, are we still able to do that?
Screenshot 2024-04-26 at 1 09 50 PM

@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 26, 2024 19:49 Inactive
@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 26, 2024 20:17 Inactive
@jhonatan-lopes jhonatan-lopes changed the title [WIP] Main navigation dropdown Main navigation dropdown Apr 26, 2024
@jhonatan-lopes jhonatan-lopes marked this pull request as ready for review April 26, 2024 20:17
@mmmavis mmmavis temporarily deployed to foundation-s-feature-br-whaygi April 26, 2024 23:35 Inactive
@jhonatan-lopes
Copy link
Contributor Author

Further feedback has been addressed on #12259

* Add `nav` app

* Make only page, external and relative links available on base link block

* Make label part of the base link block

* Define a NavLinkBlock

* Add NavLinkBlock factory

* Add tests for block

* Make `link_to` field required
* Add description to NavLinkBlock

* Set max length
* Add description to NavLinkBlock

* Rename NavLinkBlock to NavItem

* Add NavButtonBlock

* Fix test name

* Add a NavColumn model
* Better NavColumn block with default values

* Add NavOverview block

* Setup rich text features on overview description

* Define an ExtendedStructBlockFactory

* Use ExtendedStructBlockFactory

* Add NavDropdown block

* Lint

* Fix types
* Add `NavMenu` model

* Add factory for `NavMenu`

* Add initial migration for `NavMenu`

* Add tests for `NavMenu`

* Register nav on wagtail side bar

* Update migration file
* Add NavFeaturedItem block

* Add NavFeaturedColumn block

* Add featured column to dropdown

* Adjust factories to featured column

* Adjust tests to new factories and add tests for featured column

* Fix migration
* Better panels on NavMenu

* Add SiteNavMenu setting

* Show only default locale nav menus on settings

* Fix donate banner test

* Add title and locale to NavDropdownFactory

* Remove print statements
jhonatan-lopes and others added 9 commits April 29, 2024 16:40
* Add template tag to render SVG from static dir

* Add arrow glyphs for nav

* Nav item block template

* Update template path on NavItem block

* Lint

* Add new colours

* Remove `include_svg` template tag

* Use font glyph instead of SVG

* Only display arrow if link is external

* Rename `open_in_new_window` prop to `is_external`

* Rename item template

* Add template docs

* Rename item template

* Use display:block on description
* Add blog dropdown functionality

* Add factory for nav menu blog topic relationship model

* Add tests for blog dropdown

* Override routablepageurl so that it works on pattern library

* Adjust templates to be extendable

* Blog dropdown post template

* Blog dropdown topic template

* Blog dropdown button template

* Blog dropdown featured posts column template

* Blog dropdown featured topics column template

* Blog dropdown template

* Readme

* Add preview template for nav menu

* Add blog dropdown to menu template

* Special validation on blog dropdown form

* Update NavMenu factory for blog dropdown fields

* Add tests to NavMenuForm
* SVG validation for NavFeaturedItem block + tests

* validator is now in utils

* featuredblogtopic svg validation + tests + moved validator to utility file

* formatting, migrations, and tests for related topics and validation utility

* linting
* Align link items with column headings

* Get 600 version of Nunito Sans

* Expand max-width of dropdowns

* Move dropdown down 1px

* Fix blue margins on mobile/tablet

* Increase top padding on newsletter button

* Only keep one dropdown open at a time

* Add custom icons

* Better help text on dropdown button

* Reduce column margins

* Lint

* Set only image height

* Try to set desktop spacing between nav items to 40px

* Fix migration conflict
* Add utility to extract key values from nested dict

* Move nav_tags to nav app

* Add NavMenu props to extract/cache page references

* Add custom template tags to check if dropdown and link are in wayfinding/active state

* Mark dropdown as wayfinding/active state

* Mark item as wayfinding/active state

* Modify dropdown JS components to handle wayfinding states

* Put test data in JSON file

* Fix desktop dropdown

* Lint

* Put border on dropdown's title text instead of whole div

* Lint

* Make dropdown button required

* Fix migration

* Remove print statement

* Set underline thickness to 2px

* Make wayfinding sibling dropdown border gray
@jhonatan-lopes jhonatan-lopes force-pushed the feature-branch/main-nav-dropdown branch from ec8775d to 9128e57 Compare April 29, 2024 19:41
@jhonatan-lopes jhonatan-lopes temporarily deployed to foundation-s-feature-br-whaygi April 29, 2024 19:41 Inactive
Copy link
Collaborator

@robdivincenzo robdivincenzo left a comment

Choose a reason for hiding this comment

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

Your magnum opus, @jhonatan-lopes 🔥🔥🔥

* Address design feedback

* Make sure that dropdown titles init without bottom border
@jhonatan-lopes jhonatan-lopes merged commit 60d5282 into main Apr 29, 2024
7 checks passed
@jhonatan-lopes jhonatan-lopes deleted the feature-branch/main-nav-dropdown branch April 29, 2024 20:21
@data-sync-user
Copy link
Collaborator

➤ Kristina Shu commented:

Simon Acosta Torres I can’t tell what this ticket is, is it for dev? Can it be closed?

@data-sync-user
Copy link
Collaborator

➤ Simon Acosta Torres commented:

Kristina Shu This is a PR that as I can see, has already been merged to the code. I will proceed to close this synced ticket.

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.

7 participants