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 improvements to the block navigator #22796

Merged
merged 15 commits into from
Jun 10, 2020

Conversation

adamziel
Copy link
Contributor

@adamziel adamziel commented Jun 1, 2020

Description

This PR is an initial take on the design changes proposed in #22497

Zrzut ekranu 2020-06-1 o 16 08 13

What's missing

Comment on lines +83 to +72
padding-top: $grid-unit-30 !important;
padding-bottom: $grid-unit-30 !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

let's get rid of these !important before merging

Comment on lines 52 to 60
.block-editor-block-navigation-leaf {
transition: background 0.1s ease-out;
@include reduce-motion("transition");

> :first-child {
padding-left: $grid-unit-20;
}
> :last-child {
padding-right: $grid-unit-20;
}

&:hover {
background: $light-gray-300;
}

.block-editor-block-navigation-block-contents {
padding-top: $grid-unit-15;
padding-bottom: $grid-unit-15;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes should live in components/block-navigation/style.scss if they should also apply to the post editor block navigator.

@@ -74,7 +81,7 @@ $tree-item-height: 36px;

.block-editor-block-mover-button {
width: $button-size;
height: $button-size;
height: 16px;
Copy link
Contributor Author

@adamziel adamziel Jun 1, 2020

Choose a reason for hiding this comment

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

Movers PR will supersede these customizations

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean this one? #22673

@github-actions
Copy link

github-actions bot commented Jun 1, 2020

Size Change: +794 B (0%)

Total Size: 1.13 MB

Filename Size Change
build/block-editor/index.js 106 kB +14 B (0%)
build/block-editor/style-rtl.css 12.1 kB +300 B (2%)
build/block-editor/style.css 12.1 kB +299 B (2%)
build/block-library/index.js 127 kB +2 B (0%)
build/components/index.js 195 kB +53 B (0%)
build/edit-navigation/index.js 8.26 kB +14 B (0%)
build/edit-navigation/style-rtl.css 975 B +57 B (5%) 🔍
build/edit-navigation/style.css 974 B +55 B (5%) 🔍
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.62 kB 0 B
build/api-fetch/index.js 3.4 kB 0 B
build/autop/index.js 2.83 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.77 kB 0 B
build/block-directory/style-rtl.css 892 B 0 B
build/block-directory/style.css 892 B 0 B
build/block-library/editor-rtl.css 7.88 kB 0 B
build/block-library/editor.css 7.89 kB 0 B
build/block-library/style-rtl.css 7.72 kB 0 B
build/block-library/style.css 7.72 kB 0 B
build/block-library/theme-rtl.css 684 B 0 B
build/block-library/theme.css 686 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/blocks/index.js 48.1 kB 0 B
build/components/style-rtl.css 19.5 kB 0 B
build/components/style.css 19.5 kB 0 B
build/compose/index.js 9.31 kB 0 B
build/core-data/index.js 11.4 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/data/index.js 8.44 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.17 kB 0 B
build/edit-post/index.js 303 kB 0 B
build/edit-post/style-rtl.css 5.6 kB 0 B
build/edit-post/style.css 5.6 kB 0 B
build/edit-site/index.js 16.6 kB 0 B
build/edit-site/style-rtl.css 2.96 kB 0 B
build/edit-site/style.css 2.96 kB 0 B
build/edit-widgets/index.js 9.34 kB 0 B
build/edit-widgets/style-rtl.css 2.4 kB 0 B
build/edit-widgets/style.css 2.4 kB 0 B
build/editor/editor-styles-rtl.css 425 B 0 B
build/editor/editor-styles.css 428 B 0 B
build/editor/index.js 44.8 kB 0 B
build/editor/style-rtl.css 4.26 kB 0 B
build/editor/style.css 4.27 kB 0 B
build/element/index.js 4.64 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/index.js 7.72 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.13 kB 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/keyboard-shortcuts/index.js 2.51 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.12 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/media-utils/index.js 5.29 kB 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/plugins/index.js 2.56 kB 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/rich-text/index.js 14.8 kB 0 B
build/server-side-render/index.js 2.68 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/url/index.js 4.06 kB 0 B
build/viewport/index.js 1.85 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.17 kB 0 B

compressed-size-action

@adamziel adamziel requested a review from karmatosed June 2, 2020 12:44
@jasmussen
Copy link
Contributor

jasmussen commented Jun 3, 2020

Before:

before 2

After:

after

In short, this is a massive improvement. Well done.

A few small things:

  • Can we distinguish between the type of menu item and show the corresponding icon? Page keeps the page icon present now. The page set as "home" gets a house icon. The "Posts" page gets a blog icon. External links get a link icon, and categories get a category icon. I don't think we have a "posts" icon yet, but I'd be more than happy to make one for you if we can.
  • Alternatively, we should go back to a generic "menu item" icon.

One thing we need to fix is the row-height. It's 36px which doesn't afford big enough tap targets:

Screenshot 2020-06-03 at 09 47 42

We should make it 48px tall, so that it can afford up and down mover buttons that are 24x24 both:

Screenshot 2020-06-03 at 09 43 09

@adamziel
Copy link
Contributor Author

adamziel commented Jun 3, 2020

@jasmussen wait, the "after" gif you posted looks different from what I see on my end:

2020-06-03 10-37-12 2020-06-03 10_37_26

A few small things

Sure! Looking into these now

@jasmussen
Copy link
Contributor

Ah no, it's the same, I just tested this in the block navigator that is invoked in the Navigation block, whereas you're showing it in context of the edit-menus screen! Which is good, becasue it should be the same in both.

@adamziel
Copy link
Contributor Author

adamziel commented Jun 3, 2020

@jasmussen here's how it looks like in the "global" block navigator in the post editor:

Zrzut ekranu 2020-06-3 o 12 46 36

It seems a bit off, maybe the background shouldn't react to hover there? Or only the button should light up?

@adamziel
Copy link
Contributor Author

adamziel commented Jun 3, 2020

Hovering just the buttons seems off as well, I think we're better off not highlighting at all in the popover:

Zrzut ekranu 2020-06-3 o 13 04 58

@adamziel
Copy link
Contributor Author

adamziel commented Jun 3, 2020

@jasmussen

Can we distinguish between the type of menu item and show the corresponding icon? Page keeps the page icon present now. The page set as "home" gets a house icon. The "Posts" page gets a blog icon. External links get a link icon, and categories get a category icon. I don't think we have a "posts" icon yet, but I'd be more than happy to make one for you if we can.

That's possible, but I'd rather move it to another PR as it would involve grabbing the ID of the current home and posts pages from the API.

One thing we need to fix is the row-height. It's 36px which doesn't afford big enough tap targets

It is 48px now, although the movers are visually further apart from each other:

Zrzut ekranu 2020-06-3 o 13 13 56

Zrzut ekranu 2020-06-3 o 13 10 21

This could be addressed by moving the arrows closer to the button's edge, but I'm not too sure about this approach:

Zrzut ekranu 2020-06-3 o 13 12 59

Zrzut ekranu 2020-06-3 o 13 13 10

Maybe we should just keep them more spread apart. I'm curious about your opinion.

@adamziel
Copy link
Contributor Author

adamziel commented Jun 3, 2020

This one is ready for a re-review

@adamziel adamziel changed the title CSS Iterations on the block navigator Visual iterations on the block navigator Jun 3, 2020
@adamziel adamziel changed the title Visual iterations on the block navigator Visual improvements to the block navigator Jun 3, 2020
@adamziel adamziel requested a review from chrisvanpatten as a code owner June 8, 2020 09:22
@adamziel
Copy link
Contributor Author

adamziel commented Jun 8, 2020

@jasmussen I fixed the margin issues aside of this one:

The block navigator when invoked from the block toolbar is a little big, I recall it being smaller previously?

Unfortunately I am not able to reproduce it. Would you mind taking it for a spin if it still shows up on your end?

@jasmussen
Copy link
Contributor

Unfortunately I am not able to reproduce it. Would you mind taking it for a spin if it still shows up on your end?

Nope, I can't reproduce anymore. Must've been a cache ghost or something?

Screenshot 2020-06-08 at 11 41 26

And by the way, NICE. That square plus really helps a lot:

Screenshot 2020-06-08 at 11 41 44

@adamziel
Copy link
Contributor Author

adamziel commented Jun 8, 2020

The inserter is all @noisysocks in #22590, I just rebased :-) If it looks good, would you mind approving?

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.

Great work here @adamziel. 🎉

I noticed a few minor style problems when the branch is rebased against master that might need to be tweaked :
Screenshot 2020-06-10 at 10 02 37 am

  • The settings menu icon button is misaligned, might just need some padding adjustment (I think there was a separate PR that adjusted it's alignment)
  • Getting the appender lined up with the block icons would be great

In the post editor:
Screenshot 2020-06-10 at 10 11 30 am

  • There's a slight overlap between the focus ring and the descending line.

And then I noticed there was a comment about removing some !importants from the css. Hopefully those should all be relatively easy things though.

@adamziel adamziel force-pushed the update/navigator-css-iterations branch from 69a1fd5 to a5de001 Compare June 10, 2020 12:38
@adamziel adamziel merged commit d478d7c into master Jun 10, 2020
@adamziel adamziel deleted the update/navigator-css-iterations branch June 10, 2020 13:32
@github-actions github-actions bot added this to the Gutenberg 8.4 milestone Jun 10, 2020
@adamziel
Copy link
Contributor Author

Awesome! I made a few tweaks to fix these minor issues you mentioned Dan. Should any other tweaks be necessary, let's address then in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] List View Menu item in the top toolbar to select blocks from a list of links.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants