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

Nav unification: add flyout menu to sidebar #46046

Merged
merged 8 commits into from
Oct 1, 2020

Conversation

frontdevde
Copy link
Contributor

@frontdevde frontdevde commented Sep 30, 2020

Changes proposed in this Pull Request

This PR adds a flyout menu that appears on hover to the Calypso sidebar.

For details and design see issue #45676

Known issues

This is an initial prototype implementation for the flyout. It's meant to give us an initial feel for how the flyout in Calypso.

There are two known issues, that we'll have to address next:

  • Right now in Calypso the sidebar container is position:fixed and it's content is scrollable. The overflow:auto on the sidebar prevents the flyout from being visible. We're deactivating it here but this has two side effects: a) the sidebar container isn't scrollable anymore and b) when using the site switcher, the overflow is visible when selecting a site. wp-admin gets around the first issue by not having a scrollable sidebar container but instead adjusting the sidebar positioning via JS based on scroll state. The second issue is not present in wp-admin as there's no in-page site switcher.

  • On nav elements towards the bottom of the page flyouts get cut off. In wp-admin the flyouts are positioned higher via JS if the content doesn’t fit the screen.

  • Flyout menus with a lot of items also get cut off. This is an issue with the reader in particular. In wp-admin the same can happen if there are too many items in a menu.

Testing instructions

  • run yarn && yarn start or use the calypso.live link
  • add ?flags=nav-unification to the URL
  • interact with the sidebar and confirm all works as expected

ezgif com-gif-maker (2)

@frontdevde frontdevde added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two. labels Sep 30, 2020
@frontdevde frontdevde self-assigned this Sep 30, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@cpapazoglou cpapazoglou left a comment

Choose a reason for hiding this comment

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

Thanks @frontdevde for working on this! Generally it works as expected. We just need to address the following issues:

  • Let's check that hovering on an element in the flyout is in par with wp-admin
Calypso Now wp-admin
image
  • on breakpoints < 782px it should expand / collapse ................. sorry for that.......
    SS 2020-09-30 at 16 53 35

  • we need to take care of touch devices too eg for width 870px
    SS 2020-09-30 at 16 56 40

@frontdevde
Copy link
Contributor Author

Let's check that hovering on an element in the flyout is in par with wp-admin

Agreed, it should definitely be the same in Calypso and wp-admin. I removed the bold font weight. As for the color I'm not certain which side we need to adjust though. In the i2 design, the hovered state of the sidebar is white (see comparison below). Based on that maybe we should change wp-admin to be white instead of Calypso to be blue?

@sfougnier Could you please advise us which color to pick here? Thank you!

Design i2 wp-admin
Screenshot 2020-09-30 at 17 34 42 Screenshot 2020-09-30 at 17 35 14

@ghost
Copy link

ghost commented Sep 30, 2020

Let's check that hovering on an element in the flyout is in par with wp-admin

Agreed, it should definitely be the same in Calypso and wp-admin. I removed the bold font weight. As for the color I'm not certain which side we need to adjust though. In the i2 design, the hovered state of the sidebar is white (see comparison below). Based on that maybe we should change wp-admin to be white instead of Calypso to be blue?

@sfougnier Could you please advise us which color to pick here? Thank you!

Based on the consensus to stick to wp-admin as much as possible, I think we should keep the blue for now. I have updated this in the designs.
desktop - hover state

@frontdevde
Copy link
Contributor Author

Based on the consensus to stick to wp-admin as much as possible, I think we should keep the blue for now. I have updated this in the designs.

OK, perfect! Will change it to the blue used in wp-admin right now. Thank you!

@cpapazoglou
Copy link
Contributor

cpapazoglou commented Oct 1, 2020

I can verify that

Let's check that hovering on an element in the flyout is in par with wp-admin

is now showing the desired effects (colors , bg color, font-weight)

@getdave
Copy link
Contributor

getdave commented Oct 1, 2020

Just merged this PR which will no doubt effect this one

#46050 (review)

@frontdevde frontdevde force-pushed the update/nav-unification-sidebar-flyout-v1 branch from 11008ce to aa40ac9 Compare October 1, 2020 10:00
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Loving the top level flyouts!

I'd say overall we still have UX issues to resolve. I would usually say let's merge and iterate but some regressions have occurred following your rebase.

Issues

Possible to have multiple items in "selected" visual state

This has been reintroduced since my PR #46050 fixed this.
Screen Shot 2020-10-01 at 11 25 01

Cannot toggle menu sections open/closed

We can't toggle the sections open/closed. I think this is due to the top-level items now having a dual function of:

  1. Navigating to a route.
  2. Toggling the menu section.

Screen Capture on 2020-10-01 at 11-29-29

Clicking some sections appears to close other sections

This seems fairly random but watching the capture below you can see clicking on some sections closes another section whereas for others it doesn't.

Screen Capture on 2020-10-01 at 11-29-29

@cpapazoglou cpapazoglou mentioned this pull request Oct 1, 2020
3 tasks
@frontdevde
Copy link
Contributor Author

frontdevde commented Oct 1, 2020

Possible to have multiple items in "selected" visual state

Definitely, fixed that just now:

Screenshot 2020-10-01 at 12 57 18

Unrelated to the changes here: I have to say it feels a bit weird that a section can be open but not selected. AFAIR we did that so the menu doesn't jump when opening a different section (which less of an issue in wp-admin because of the full reload). That said, maybe we should consider closing sections when clicking a different section. IIRC @getdave suggested that previously.

Cannot toggle menu sections open/closed

Clicking some sections appears to close other sections

I definitely agree those should be addressed! That said, they seem to be unrelated to this PR?

@getdave
Copy link
Contributor

getdave commented Oct 1, 2020

Definitely, fixed that just now:

That's much better now @frontdevde - thanks for fixing that.

Unrelated to the changes here: I have to say it feels a bit weird that a section can be open but not selected.

We decided against this because otherwise if you have a section open and then you click another section you get a double whammy "jump" of

  1. Existing section collapsing.
  2. New section opening (or in the case it's not a section then this doesn't happen).

This felt like a worse experience but I'm happy to be told I'm wrong. Either way we should address in a followup. Let's raise an Issue.

Cannot toggle menu sections open/closed
Clicking some sections appears to close other sections
I definitely agree those should be addressed! That said, they seem to be unrelated to this PR?

Let's tackle in followups. I raised the following Issues: #46089 #46091

Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Seeing some strange hover styles in Reader.

Screen Capture on 2020-10-01 at 12-34-23

If that's unrelated to this PR, let's make an Issue and then I'd be happy to 👍 this PR.

@frontdevde
Copy link
Contributor Author

Seeing some strange hover styles in Reader.
If that's unrelated to this PR, let's make an Issue and then I'd be happy to 👍 this PR.

It's not related to this PR but I adjusted the hover color anyway. Reader has a different markup and css class structure and will need additional attention. We should do this in a seperate PR, we're already doing more than we should in this one imo.

Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Thanks for being so diligent on this and putting up with having to rebase in my PR and all my changes.

On last test this look much better than it is in master and so I say merge and followup.

@frontdevde frontdevde merged commit 62aff13 into master Oct 1, 2020
@frontdevde frontdevde deleted the update/nav-unification-sidebar-flyout-v1 branch October 1, 2020 12:46
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 1, 2020
Copy link
Collaborator

@wp-desktop wp-desktop left a comment

Choose a reason for hiding this comment

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

WordPress Desktop CI Failure for job "wp-desktop-mac".

@frontdevde please inspect this job's build steps for breaking changes at this link. For temporal failures, you may try to "Rerun Workflow from Failed".

Please also ensure this branch is rebased off latest Calypso.

@frontdevde
Copy link
Contributor Author

^ Just noting that tests passed prior to deploying.
Canary tests for your Calypso changes (62aff133) completed successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants