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

Visual and experience improvements to existing sub navigation flow #22107

Merged
merged 12 commits into from
May 8, 2020

Conversation

adamziel
Copy link
Contributor

@adamziel adamziel commented May 5, 2020

Description

Implementation of #22087

Before
2020-05-06 14-25-56 2020-05-06 14_26_21

After
2020-05-06 15-25-28 2020-05-06 15_25_43

How has this been tested?

  1. Open post editor
  2. Add a navigation block with two levels of nested menus
  3. Confirm the nested menus are only visible after clicking on them
  4. Confirm everything looks good visually
  5. Save the post
  6. Open the post on the actual site (outside of the editor)
  7. Confirm the menu works the same as before this PR and looks good

Types of changes

Non-breaking changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@github-actions
Copy link

github-actions bot commented May 5, 2020

Size Change: +1.89 kB (0%)

Total Size: 824 kB

Filename Size Change
build/api-fetch/index.js 4.08 kB +1 B
build/block-directory/index.js 6.61 kB +7 B (0%)
build/block-editor/index.js 102 kB +463 B (0%)
build/block-editor/style-rtl.css 10.3 kB +124 B (1%)
build/block-editor/style.css 10.3 kB +123 B (1%)
build/block-library/editor-rtl.css 7.12 kB +42 B (0%)
build/block-library/editor.css 7.12 kB +40 B (0%)
build/block-library/index.js 115 kB -21 B (0%)
build/block-library/style-rtl.css 7.34 kB +59 B (0%)
build/block-library/style.css 7.34 kB +55 B (0%)
build/blocks/index.js 48.1 kB +4 B (0%)
build/components/index.js 180 kB +541 B (0%)
build/components/style-rtl.css 17 kB +42 B (0%)
build/components/style.css 16.9 kB +41 B (0%)
build/compose/index.js 6.66 kB -1 B
build/core-data/index.js 11.4 kB +14 B (0%)
build/data/index.js 8.45 kB +4 B (0%)
build/edit-navigation/index.js 4.4 kB +328 B (7%) 🔍
build/edit-navigation/style-rtl.css 618 B +133 B (21%) 🚨
build/edit-navigation/style.css 617 B +132 B (21%) 🚨
build/edit-post/index.js 28 kB -132 B (0%)
build/edit-post/style-rtl.css 12.2 kB +20 B (0%)
build/edit-post/style.css 12.2 kB +20 B (0%)
build/edit-site/index.js 12.1 kB -177 B (1%)
build/edit-site/style-rtl.css 5.22 kB +25 B (0%)
build/edit-site/style.css 5.22 kB +24 B (0%)
build/edit-widgets/index.js 8.37 kB +1 B
build/edit-widgets/style-rtl.css 4.69 kB +13 B (0%)
build/edit-widgets/style.css 4.69 kB +12 B (0%)
build/editor/editor-styles-rtl.css 425 B -3 B (0%)
build/editor/editor-styles.css 428 B -3 B (0%)
build/editor/index.js 44.3 kB -38 B (0%)
build/element/index.js 4.65 kB +1 B
build/format-library/index.js 7.63 kB -2 B (0%)
build/hooks/index.js 2.14 kB +7 B (0%)
build/keyboard-shortcuts/index.js 2.51 kB -1 B
build/keycodes/index.js 1.94 kB -1 B
build/list-reusable-blocks/index.js 3.12 kB -1 B
build/media-utils/index.js 5.29 kB -1 B
build/notices/index.js 1.79 kB -1 B
build/nux/index.js 3.4 kB +1 B
build/plugins/index.js 2.56 kB -2 B (0%)
build/redux-routine/index.js 2.85 kB -2 B (0%)
build/rich-text/index.js 14.8 kB -1 B
build/server-side-render/index.js 2.67 kB -1 B
build/token-list/index.js 1.28 kB -1 B
build/url/index.js 4.02 kB +1 B
build/viewport/index.js 1.84 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/annotations/index.js 3.62 kB 0 B
build/autop/index.js 2.82 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 761 B 0 B
build/block-library/theme-rtl.css 683 B 0 B
build/block-library/theme.css 685 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/date/index.js 5.47 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.1 kB 0 B
build/editor/style-rtl.css 5.07 kB 0 B
build/editor/style.css 5.08 kB 0 B
build/escape-html/index.js 734 B 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/shortcode/index.js 1.7 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.18 kB 0 B

compressed-size-action

@adamziel adamziel added [Block] Navigation Affects the Navigation Block [Feature] List View Menu item in the top toolbar to select blocks from a list of links. CSS Styling Related to editor and front end styles, CSS-specific issues. labels May 6, 2020
@adamziel adamziel marked this pull request as ready for review May 6, 2020 12:29
@adamziel adamziel marked this pull request as draft May 6, 2020 12:54
@adamziel adamziel marked this pull request as ready for review May 6, 2020 13:28
@draganescu
Copy link
Contributor

Hey @adamziel any idea why to me the menus are transparent?

transparent

Theme: Ambitious (blocks) and TwentyTwenty (classic)

@adamziel
Copy link
Contributor Author

adamziel commented May 6, 2020

@draganescu interesting! That background color should come from the following rule:

.is-style-light:not(.has-background) .wp-block-navigation__container {
	background-color: $light-style-sub-menu-background-color;
}

from navigation/style.scss.

Is it missing in your editor? Is the style variation not assigned maybe?

@draganescu
Copy link
Contributor

@adamziel the problem is that is-style-light does not apply by default for me and in any case the default should not be transparent ... right?

@noisysocks
Copy link
Member

I'm also seeing the issue @draganescu mentioned in both Twenty Twenty and Gutenberg Starter Theme.

Other than that, the code LGTM and it's a big improvement when I test locally! Nice job 👍

Pinging @karmatosed for any feedback she has.

@noisysocks noisysocks added the Needs Design Feedback Needs general design feedback. label May 7, 2020
@talldan
Copy link
Contributor

talldan commented May 7, 2020

There's a bug report for the transparent submenus - #21449

@adamziel
Copy link
Contributor Author

adamziel commented May 7, 2020

I believe the problem with the background is that getBlocksWithDefaultStylesApplied only considers preferredStyleVariations and not the default block style. I'll proceed with this PR as it is and spin a new one to address/discuss it more.

@adamziel adamziel mentioned this pull request May 7, 2020
6 tasks
@adamziel
Copy link
Contributor Author

adamziel commented May 7, 2020

I extracted the appender change into a separate PR (#22165).

The failing test here is also broken on master.

@adamziel
Copy link
Contributor Author

adamziel commented May 7, 2020

Let's move the discussion about the transparent background here: #22167

@mapk
Copy link
Contributor

mapk commented May 7, 2020

This is looking good! I saw one area that can be improved visually (excluding the glaring lack of background 😄 )

The top level of the 2nd subnav doesn't align to the top of the first subnav. I see that's because it aligns to the top of the focused/selected area of the parent nav item. This makes sense, but still looks odd.

Screen Shot 2020-05-07 at 10 00 42 AM

Can we align the selected state AND the child level to the top on both accounts? Like this:

Screen Shot 2020-05-07 at 10 15 38 AM

@karmatosed does this feel right to you? Or did you have some mockups closer to G2 that should be applied here?

@karmatosed
Copy link
Member

@mapk in mocks there was a little gap, so I'd be keen to see that come back in. For example:

Frame 3

@karmatosed
Copy link
Member

@adamziel I'm going to hold off another design review for now, once it's refined a bit I will give one again though. On the whole, this is shaping up really well and I am excited to see these iterations thank you.

Copy link
Contributor

@talldan talldan 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. 👍

I also noticed the same thing about the menus not quite being lined up with the link:
Screenshot 2020-05-08 at 2 17 42 pm

Lets try to get this merged and improve that separately.

@adamziel adamziel merged commit 0984ca0 into master May 8, 2020
@adamziel
Copy link
Contributor Author

adamziel commented May 8, 2020

I fixed the vertical alignment of sub-menus and merged this one. Let's do more improvements in another PR.

@github-actions github-actions bot added this to the Gutenberg 8.1 milestone May 8, 2020
@adamziel adamziel mentioned this pull request May 8, 2020
6 tasks
@adamziel
Copy link
Contributor Author

adamziel commented May 8, 2020

See #22228 and #22227

@adamziel
Copy link
Contributor Author

@karmatosed both PRs are now merged. What we did not reach a consensus on just yet, is whether or not the top-level navigation should have a background by default:

Let's get it sorted out here and we should be good to marked this issue as resolved.

@mapk
Copy link
Contributor

mapk commented May 11, 2020

What we did not reach a consensus on just yet, is whether or not the top-level navigation should have a background by default:

@adamziel, no other text/link based blocks (ie. Heading, Paragraph, Media+Text, Quote, etc.) have a default background that I'm aware of. I think we're pretty safe following that pattern here. A setting that allows a background color to be added works well, but it's not necessary as a default.

@draganescu
Copy link
Contributor

@mapk I wonder if any other blocks have z-index stacked parts? Because that is the issue with no default background, see through things appear broken.

@mapk
Copy link
Contributor

mapk commented May 12, 2020

@draganescu, when a user adds a Nav block to their Header (in the near future), they'll likely add the Nav block on top of a solid color Header. It is also likely they'll want the background color of the Header to show through the Navigation block. I foresee this being a highly common experience based on web patterns out there.

Now, any elements that are z-indexed on top of the Nav block (ie. submenus) should definitely have a background color. I'm totally in favor of this, because it feels like this is the only time where we experience a z-indexing issue of content on top of other content.

Here's a quick diagram to help communicate my direction.

background

The user can always add a background color to the block with the Color Settings.

@draganescu
Copy link
Contributor

We should create an issue that explains this background setting behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] List View Menu item in the top toolbar to select blocks from a list of links. Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants