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

Navigation Block: Placeholder empty state #26947

Merged
merged 6 commits into from
Jan 18, 2021
Merged

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Nov 12, 2020

Description

There are already a couple of issues around Navigator block placeholder, but those are around the big white placeholder spot and not the InnerBlocks when empty. See gifs below for visual explanation.

With #25941 a new placeholder property was introduced to help Social Links initial empty state, this PR is to use that same property to help the Navigation block empty state (no menu selected)

How has this been tested?

DRAFT

  • Add Navigation block
  • Choose create empty Navigation

Screenshots

This capture shows the current existing behavior, when creating a new empty Navigation it is confusing, particular if you click away.

navigation-current

This is the updated placeholder to show when a new empty Navigation is inserted, this is obviously not the final design but to illustrate the location and potential.

navigation-update

Types of changes

  • Use InnerBlocks placeholder property for Navigation

@mkaz mkaz added the [Block] Navigation Affects the Navigation Block label Nov 12, 2020
@mkaz mkaz requested a review from shaunandrews November 12, 2020 19:39
@mkaz mkaz marked this pull request as draft November 12, 2020 19:40
@mkaz mkaz added the Needs Design Needs design efforts. label Nov 12, 2020
@github-actions
Copy link

github-actions bot commented Nov 12, 2020

Size Change: +210 B (0%)

Total Size: 1.28 MB

Filename Size Change
build/block-library/blocks/navigation/editor-rtl.css 1.46 kB +79 B (+6%) 🔍
build/block-library/blocks/navigation/editor.css 1.46 kB +77 B (+6%) 🔍
build/block-library/editor-rtl.css 8.96 kB +24 B (0%)
build/block-library/editor.css 8.96 kB +18 B (0%)
build/block-library/index.js 142 kB +12 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.8 kB 0 B
build/api-fetch/index.js 3.42 kB 0 B
build/autop/index.js 2.83 kB 0 B
build/blob/index.js 665 B 0 B
build/block-directory/index.js 9.03 kB 0 B
build/block-directory/style-rtl.css 1.01 kB 0 B
build/block-directory/style.css 1.01 kB 0 B
build/block-editor/index.js 121 kB 0 B
build/block-editor/style-rtl.css 11.5 kB 0 B
build/block-editor/style.css 11.5 kB 0 B
build/block-library/blocks/archives/editor-rtl.css 196 B 0 B
build/block-library/blocks/archives/editor.css 196 B 0 B
build/block-library/blocks/audio/editor-rtl.css 194 B 0 B
build/block-library/blocks/audio/editor.css 194 B 0 B
build/block-library/blocks/audio/style-rtl.css 225 B 0 B
build/block-library/blocks/audio/style.css 225 B 0 B
build/block-library/blocks/block/editor-rtl.css 283 B 0 B
build/block-library/blocks/block/editor.css 283 B 0 B
build/block-library/blocks/button/editor-rtl.css 576 B 0 B
build/block-library/blocks/button/editor.css 577 B 0 B
build/block-library/blocks/button/style-rtl.css 552 B 0 B
build/block-library/blocks/button/style.css 552 B 0 B
build/block-library/blocks/buttons/editor-rtl.css 345 B 0 B
build/block-library/blocks/buttons/editor.css 346 B 0 B
build/block-library/blocks/buttons/style-rtl.css 419 B 0 B
build/block-library/blocks/buttons/style.css 419 B 0 B
build/block-library/blocks/calendar/style-rtl.css 319 B 0 B
build/block-library/blocks/calendar/style.css 319 B 0 B
build/block-library/blocks/categories/editor-rtl.css 210 B 0 B
build/block-library/blocks/categories/editor.css 209 B 0 B
build/block-library/blocks/categories/style-rtl.css 208 B 0 B
build/block-library/blocks/categories/style.css 208 B 0 B
build/block-library/blocks/code/style-rtl.css 216 B 0 B
build/block-library/blocks/code/style.css 216 B 0 B
build/block-library/blocks/columns/editor-rtl.css 300 B 0 B
build/block-library/blocks/columns/editor.css 299 B 0 B
build/block-library/blocks/columns/style-rtl.css 529 B 0 B
build/block-library/blocks/columns/style.css 528 B 0 B
build/block-library/blocks/cover/editor-rtl.css 524 B 0 B
build/block-library/blocks/cover/editor.css 522 B 0 B
build/block-library/blocks/cover/style-rtl.css 1.3 kB 0 B
build/block-library/blocks/cover/style.css 1.3 kB 0 B
build/block-library/blocks/embed/editor-rtl.css 594 B 0 B
build/block-library/blocks/embed/editor.css 595 B 0 B
build/block-library/blocks/embed/style-rtl.css 489 B 0 B
build/block-library/blocks/embed/style.css 489 B 0 B
build/block-library/blocks/file/editor-rtl.css 314 B 0 B
build/block-library/blocks/file/editor.css 313 B 0 B
build/block-library/blocks/file/style-rtl.css 352 B 0 B
build/block-library/blocks/file/style.css 352 B 0 B
build/block-library/blocks/freeform/editor-rtl.css 2.55 kB 0 B
build/block-library/blocks/freeform/editor.css 2.55 kB 0 B
build/block-library/blocks/gallery/editor-rtl.css 749 B 0 B
build/block-library/blocks/gallery/editor.css 750 B 0 B
build/block-library/blocks/gallery/style-rtl.css 1.17 kB 0 B
build/block-library/blocks/gallery/style.css 1.17 kB 0 B
build/block-library/blocks/group/editor-rtl.css 433 B 0 B
build/block-library/blocks/group/editor.css 432 B 0 B
build/block-library/blocks/group/style-rtl.css 190 B 0 B
build/block-library/blocks/group/style.css 190 B 0 B
build/block-library/blocks/heading/editor-rtl.css 248 B 0 B
build/block-library/blocks/heading/editor.css 248 B 0 B
build/block-library/blocks/heading/style-rtl.css 212 B 0 B
build/block-library/blocks/heading/style.css 212 B 0 B
build/block-library/blocks/html/editor-rtl.css 384 B 0 B
build/block-library/blocks/html/editor.css 385 B 0 B
build/block-library/blocks/image/editor-rtl.css 801 B 0 B
build/block-library/blocks/image/editor.css 800 B 0 B
build/block-library/blocks/image/style-rtl.css 569 B 0 B
build/block-library/blocks/image/style.css 570 B 0 B
build/block-library/blocks/latest-comments/editor-rtl.css 277 B 0 B
build/block-library/blocks/latest-comments/editor.css 275 B 0 B
build/block-library/blocks/latest-comments/style-rtl.css 382 B 0 B
build/block-library/blocks/latest-comments/style.css 382 B 0 B
build/block-library/blocks/latest-posts/editor-rtl.css 254 B 0 B
build/block-library/blocks/latest-posts/editor.css 254 B 0 B
build/block-library/blocks/latest-posts/style-rtl.css 634 B 0 B
build/block-library/blocks/latest-posts/style.css 634 B 0 B
build/block-library/blocks/list/editor-rtl.css 203 B 0 B
build/block-library/blocks/list/editor.css 203 B 0 B
build/block-library/blocks/list/style-rtl.css 201 B 0 B
build/block-library/blocks/list/style.css 201 B 0 B
build/block-library/blocks/media-text/editor-rtl.css 311 B 0 B
build/block-library/blocks/media-text/editor.css 311 B 0 B
build/block-library/blocks/media-text/style-rtl.css 642 B 0 B
build/block-library/blocks/media-text/style.css 640 B 0 B
build/block-library/blocks/more/editor-rtl.css 545 B 0 B
build/block-library/blocks/more/editor.css 545 B 0 B
build/block-library/blocks/navigation-link/editor-rtl.css 503 B 0 B
build/block-library/blocks/navigation-link/editor.css 504 B 0 B
build/block-library/blocks/navigation-link/style-rtl.css 805 B 0 B
build/block-library/blocks/navigation-link/style.css 803 B 0 B
build/block-library/blocks/navigation/style-rtl.css 274 B 0 B
build/block-library/blocks/navigation/style.css 274 B 0 B
build/block-library/blocks/nextpage/editor-rtl.css 507 B 0 B
build/block-library/blocks/nextpage/editor.css 507 B 0 B
build/block-library/blocks/paragraph/editor-rtl.css 236 B 0 B
build/block-library/blocks/paragraph/editor.css 236 B 0 B
build/block-library/blocks/paragraph/style-rtl.css 351 B 0 B
build/block-library/blocks/paragraph/style.css 352 B 0 B
build/block-library/blocks/post-author/editor-rtl.css 329 B 0 B
build/block-library/blocks/post-author/editor.css 329 B 0 B
build/block-library/blocks/post-author/style-rtl.css 303 B 0 B
build/block-library/blocks/post-author/style.css 303 B 0 B
build/block-library/blocks/post-comments-form/style-rtl.css 358 B 0 B
build/block-library/blocks/post-comments-form/style.css 358 B 0 B
build/block-library/blocks/post-content/editor-rtl.css 262 B 0 B
build/block-library/blocks/post-content/editor.css 262 B 0 B
build/block-library/blocks/post-excerpt/editor-rtl.css 206 B 0 B
build/block-library/blocks/post-excerpt/editor.css 206 B 0 B
build/block-library/blocks/post-featured-image/editor-rtl.css 453 B 0 B
build/block-library/blocks/post-featured-image/editor.css 453 B 0 B
build/block-library/blocks/post-featured-image/style-rtl.css 223 B 0 B
build/block-library/blocks/post-featured-image/style.css 223 B 0 B
build/block-library/blocks/preformatted/style-rtl.css 193 B 0 B
build/block-library/blocks/preformatted/style.css 193 B 0 B
build/block-library/blocks/pullquote/editor-rtl.css 304 B 0 B
build/block-library/blocks/pullquote/editor.css 304 B 0 B
build/block-library/blocks/pullquote/style-rtl.css 428 B 0 B
build/block-library/blocks/pullquote/style.css 428 B 0 B
build/block-library/blocks/query-loop/editor-rtl.css 217 B 0 B
build/block-library/blocks/query-loop/editor.css 216 B 0 B
build/block-library/blocks/query-loop/style-rtl.css 427 B 0 B
build/block-library/blocks/query-loop/style.css 429 B 0 B
build/block-library/blocks/query/editor-rtl.css 279 B 0 B
build/block-library/blocks/query/editor.css 279 B 0 B
build/block-library/blocks/quote/editor-rtl.css 195 B 0 B
build/block-library/blocks/quote/editor.css 195 B 0 B
build/block-library/blocks/quote/style-rtl.css 284 B 0 B
build/block-library/blocks/quote/style.css 285 B 0 B
build/block-library/blocks/rss/editor-rtl.css 307 B 0 B
build/block-library/blocks/rss/editor.css 309 B 0 B
build/block-library/blocks/rss/style-rtl.css 394 B 0 B
build/block-library/blocks/rss/style.css 393 B 0 B
build/block-library/blocks/search/editor-rtl.css 285 B 0 B
build/block-library/blocks/search/editor.css 285 B 0 B
build/block-library/blocks/search/style-rtl.css 454 B 0 B
build/block-library/blocks/search/style.css 456 B 0 B
build/block-library/blocks/separator/editor-rtl.css 229 B 0 B
build/block-library/blocks/separator/editor.css 229 B 0 B
build/block-library/blocks/separator/style-rtl.css 352 B 0 B
build/block-library/blocks/separator/style.css 352 B 0 B
build/block-library/blocks/shortcode/editor-rtl.css 603 B 0 B
build/block-library/blocks/shortcode/editor.css 603 B 0 B
build/block-library/blocks/site-logo/editor-rtl.css 321 B 0 B
build/block-library/blocks/site-logo/editor.css 321 B 0 B
build/block-library/blocks/site-logo/style-rtl.css 238 B 0 B
build/block-library/blocks/site-logo/style.css 238 B 0 B
build/block-library/blocks/social-link/editor-rtl.css 283 B 0 B
build/block-library/blocks/social-link/editor.css 283 B 0 B
build/block-library/blocks/social-links/editor-rtl.css 811 B 0 B
build/block-library/blocks/social-links/editor.css 810 B 0 B
build/block-library/blocks/social-links/style-rtl.css 1.44 kB 0 B
build/block-library/blocks/social-links/style.css 1.44 kB 0 B
build/block-library/blocks/spacer/editor-rtl.css 391 B 0 B
build/block-library/blocks/spacer/editor.css 391 B 0 B
build/block-library/blocks/spacer/style-rtl.css 184 B 0 B
build/block-library/blocks/spacer/style.css 184 B 0 B
build/block-library/blocks/subhead/editor-rtl.css 223 B 0 B
build/block-library/blocks/subhead/editor.css 223 B 0 B
build/block-library/blocks/subhead/style-rtl.css 210 B 0 B
build/block-library/blocks/subhead/style.css 210 B 0 B
build/block-library/blocks/table/editor-rtl.css 593 B 0 B
build/block-library/blocks/table/editor.css 593 B 0 B
build/block-library/blocks/table/style-rtl.css 501 B 0 B
build/block-library/blocks/table/style.css 501 B 0 B
build/block-library/blocks/tag-cloud/editor-rtl.css 237 B 0 B
build/block-library/blocks/tag-cloud/editor.css 235 B 0 B
build/block-library/blocks/tag-cloud/style-rtl.css 221 B 0 B
build/block-library/blocks/tag-cloud/style.css 221 B 0 B
build/block-library/blocks/template-part/editor-rtl.css 714 B 0 B
build/block-library/blocks/template-part/editor.css 714 B 0 B
build/block-library/blocks/text-columns/editor-rtl.css 220 B 0 B
build/block-library/blocks/text-columns/editor.css 220 B 0 B
build/block-library/blocks/text-columns/style-rtl.css 283 B 0 B
build/block-library/blocks/text-columns/style.css 283 B 0 B
build/block-library/blocks/verse/editor-rtl.css 194 B 0 B
build/block-library/blocks/verse/editor.css 194 B 0 B
build/block-library/blocks/verse/style-rtl.css 215 B 0 B
build/block-library/blocks/verse/style.css 215 B 0 B
build/block-library/blocks/video/editor-rtl.css 617 B 0 B
build/block-library/blocks/video/editor.css 617 B 0 B
build/block-library/blocks/video/style-rtl.css 303 B 0 B
build/block-library/blocks/video/style.css 304 B 0 B
build/block-library/common-rtl.css 1.01 kB 0 B
build/block-library/common.css 1.01 kB 0 B
build/block-library/style-rtl.css 8.5 kB 0 B
build/block-library/style.css 8.5 kB 0 B
build/block-library/theme-rtl.css 860 B 0 B
build/block-library/theme.css 860 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.06 kB 0 B
build/blocks/index.js 48.1 kB 0 B
build/components/index.js 173 kB 0 B
build/components/style-rtl.css 15.5 kB 0 B
build/components/style.css 15.5 kB 0 B
build/compose/index.js 11.2 kB 0 B
build/core-data/index.js 15.2 kB 0 B
build/data-controls/index.js 829 B 0 B
build/data/index.js 8.97 kB 0 B
build/date/index.js 31.8 kB 0 B
build/deprecated/index.js 768 B 0 B
build/dom-ready/index.js 571 B 0 B
build/dom/index.js 4.95 kB 0 B
build/edit-navigation/index.js 11.1 kB 0 B
build/edit-navigation/style-rtl.css 938 B 0 B
build/edit-navigation/style.css 944 B 0 B
build/edit-post/index.js 306 kB 0 B
build/edit-post/style-rtl.css 6.56 kB 0 B
build/edit-post/style.css 6.55 kB 0 B
build/edit-site/index.js 24.2 kB 0 B
build/edit-site/style-rtl.css 4 kB 0 B
build/edit-site/style.css 4 kB 0 B
build/edit-widgets/index.js 23.6 kB 0 B
build/edit-widgets/style-rtl.css 3.16 kB 0 B
build/edit-widgets/style.css 3.16 kB 0 B
build/editor/editor-styles-rtl.css 476 B 0 B
build/editor/editor-styles.css 478 B 0 B
build/editor/index.js 42.3 kB 0 B
build/editor/style-rtl.css 3.89 kB 0 B
build/editor/style.css 3.89 kB 0 B
build/element/index.js 4.62 kB 0 B
build/escape-html/index.js 735 B 0 B
build/format-library/index.js 6.75 kB 0 B
build/format-library/style-rtl.css 620 B 0 B
build/format-library/style.css 621 B 0 B
build/hooks/index.js 2.27 kB 0 B
build/html-entities/index.js 623 B 0 B
build/i18n/index.js 3.57 kB 0 B
build/is-shallow-equal/index.js 698 B 0 B
build/keyboard-shortcuts/index.js 2.54 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.15 kB 0 B
build/list-reusable-blocks/style-rtl.css 629 B 0 B
build/list-reusable-blocks/style.css 628 B 0 B
build/media-utils/index.js 5.31 kB 0 B
build/notices/index.js 1.86 kB 0 B
build/nux/index.js 3.42 kB 0 B
build/nux/style-rtl.css 731 B 0 B
build/nux/style.css 727 B 0 B
build/plugins/index.js 2.54 kB 0 B
build/primitives/index.js 1.43 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.84 kB 0 B
build/reusable-blocks/index.js 2.91 kB 0 B
build/rich-text/index.js 13.5 kB 0 B
build/server-side-render/index.js 2.77 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.27 kB 0 B
build/url/index.js 3.01 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.22 kB 0 B

compressed-size-action

@shaunandrews
Copy link
Contributor

I really dig what @jasmussen proposed for the Social Links block: #26953 (comment)

I tried something similar for the Navigation block and think it might be worth trying it out:

Navigation Placeholder Unselected - Block Only

Here's how that could look within a template, perhaps inheriting some colors from the theme:

Navigation Placeholder Unselected

@jasmussen
Copy link
Contributor

Love that mockup, Shaun. I have some things I need to focus on today, but otherwise I'm going to try and push some tweaks to this PR based on that mockup.

@karmatosed karmatosed added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Nov 19, 2020
@mkaz mkaz force-pushed the try/nav-block/empty branch from cda12e2 to 16e56fd Compare December 8, 2020 18:10
@mkaz
Copy link
Member Author

mkaz commented Dec 8, 2020

@jasmussen I updated the "Start empty state" to insert the same preview component that you had. Take a look, I think it helps with the behavior instead of just having another [+] button with no context.

navigation-placeholder-3

There are a still a few more usability cases to handle, but I think this is another step in the right direction.

@mkaz mkaz marked this pull request as ready for review December 8, 2020 18:15
@jasmussen
Copy link
Contributor

Thanks Marcus, nice work. This is what I see:

gif

I do like that this uses the same mechanism as Social Links. And I really like that if you insert a navigation block, choose to start empty, and the deselect the block, it isn't empty.

However the current flow also highlights a weirdness that we need to address. Compare with social links:

social

Notably when the block is selected, the placeholder blobs fade out and the plus is on the left. That bit is missing here.

But moreover, with the current flow, you can get this slightly jarring experience:

  1. Unselected preview with skeleton indication
  2. Select and it's the white box with button.
  3. Press "Start empty" and you see the skeleton indication again, with a plus at the end.

Step 3 here is the tricky one as it makes you think you went back to 1 again.

I think we should try and tweak step 3 to be closer to social links — that is, fade the skeleton out, maybe completely out to a previous suggestion by Shaun, and have the plus be at the start. I'm gonna try and see if I can push some tweaks to make that happen.

@jasmussen
Copy link
Contributor

I also encountered this bug, which does not exist on social links:

empty

Specifically that if I deselect the empty block, then select it again, I don't seem to actually select the block, I just focus it. I have to select an adjacent block first, before I can select it truly. I suspect it has to do with the skeleton placeholder actually getting focus, as opposed to the block getting selected.

This may solve itself if I can apply the tweaks we did to social links.


const PlaceholderPreview = ( { hideSelected } ) => {
const classes = classNames( 'wp-block-navigation-placeholder__preview', {
'wp-block-navigation-placeholder__preview_select_hide': hideSelected,
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't appear to work for me. I can't get this class to appear in the editor.

@jasmussen
Copy link
Contributor

I need to add markup to the placeholder, and a classname, to get my idea to work. Before I do that, I just want to make sure what you added in #26947 (review) wasn't the same thing.

@jasmussen jasmussen force-pushed the try/nav-block/empty branch 2 times, most recently from c831c4a to f122dab Compare December 14, 2020 09:23
@jasmussen
Copy link
Contributor

I pushed the tiniest tweak, but I'm still mulling over the best path forward for this one. On the one hand, the horizontal flow is close to feeling right:

empty

But the vertical flow is less good:

empty vertical

The jumpiness and the positioning of the + button can be addressed, but it might add some unwanted complexity. In any case, I'm still thinking.

Meanwhile, I can't figure out why this bug exists:

bug

Quite simply, sometimes when you click to select the block, it doesn't get selected. I mentioned this here #26947 (comment) but it remains even after a small refactor. The is-selected classname is not applied to the block at all. Do you have any insights here Marcus?

@mkaz mkaz force-pushed the try/nav-block/empty branch from f122dab to 18099cc Compare December 18, 2020 18:45
@shaunandrews
Copy link
Contributor

If we implement the shortcuts for adding all pages and if we allow choosing from other existing menus/navigations the vertical variant feels a little less jarring:

Nav Vertical Placeholder

Knowing that not everyone has existing menus, perhaps its better to just keep the height of the empty block fixed when selected:

Vertical Placeholder 2

@jasmussen jasmussen force-pushed the try/nav-block/empty branch from 18099cc to d415a9c Compare January 12, 2021 08:03
@jasmussen
Copy link
Contributor

If we implement the shortcuts for adding all pages and if we allow choosing from other existing menus/navigations the vertical variant feels a little less jarring:

Turns out this is already the case, I had just forgotten to create any existing menus:

screencast 2021-01-12 09-05-10

@jasmussen
Copy link
Contributor

As I worked on this today, hoping to further it, I noticed this behavior:

screencast 2021-01-12 09-31-19

Here's what's going on:

  • A freshly inserted Navigation block shows the placeholder.
  • If you click "Start empty", you get to the state with the black plus.
  • If you deselect, the empty state of the empty navigation block looks like the placeholder, but is not the placeholder.
  • If you then reload, that empty navigation block reverts back to the actual placeholder.

This begs to me the question whether we need this PR at all, or whether we might want to pause it for the time being.

The primary reason for adding the placeholder state was to show something when the thing is empty. But once you explicitly pick the "Start Empty" option, presumably that means you're about to insert content. If you then deselect, save, reload, and it's back to the placeholder state, what we're doing here might be of little value, considering what a headache it has turned into with the selection bug.

@jasmussen jasmussen force-pushed the try/nav-block/empty branch from d415a9c to a56c853 Compare January 12, 2021 11:42
@jasmussen
Copy link
Contributor

I'm debugging this, and have found out that the "is-selected" that isn't applied as it should on the navigation block is an issue also present in the master branch at the moment. I'm trying to figure out what makes this one different from all other blocks, it's a doozy!

@jasmussen
Copy link
Contributor

I ticketed #28166 to have that issue be tracked separately, and will proceed with wrapping this one, as the issue is not specific to this branch.

@jasmussen
Copy link
Contributor

Alright, I rearranged a few things and landed on this:

Jan-13-2021 12-28-01

Because this PR has gone on for a while, I'm tempted to suggest it'd be good to call it done, and review it as it is here.

Outside of adressing #28166 as a followup, I think there's an opportunity to refactor the placeholder component to be a generic component showing these "skeleton indicators" in a way that's more easy to port between various blocks. We can then go back and revisit both this and social links to refactor. What do you think @mkaz?

@shaunandrews
Copy link
Contributor

shaunandrews commented Jan 13, 2021

image

I selected the Navigation (vertical) block, then clicked in the white space below. This created a new Paragraph block and the Navigation placeholder appears overlapping.

image

It seems like there's a double-border thing happening here; The thin black line seems unintentional.

@jasmussen
Copy link
Contributor

Ah, good catch, I know that is.

@jasmussen jasmussen force-pushed the try/nav-block/empty branch from 2f8bab3 to 1c03cae Compare January 14, 2021 08:48
@jasmussen
Copy link
Contributor

Alright I pushed some fixes. The previous refactor had not taken into account the vertical orientation.

Jan-14-2021 10-09-06

It seems like there's a double-border thing happening here; The thin black line seems unintentional.

As is perhaps visible in the GIF above, here's a screenshot without the blue focus rectangle:

Screenshot 2021-01-14 at 10 10 52

So the white box is intentionally set to inline-flex, which allows its width to collapse to only the buttons inside. The alternative felt overwhelming to me:

Screenshot 2021-01-14 at 10 11 52

Here's another alternative, where the height isn't set:

Screenshot 2021-01-14 at 10 13 21

You can barely see the search loupe below, as the skeleton placeholder indicators peek through at low opacity.

Happy to go either direction, let me know your thoughts.

@talldan
Copy link
Contributor

talldan commented Jan 15, 2021

This isn't feedback related to this PR, but just thought I'd mention that there's an issue here for how the placeholder should work on the navigation screen - #23953. Would definitely welcome input on that issue if you get a chance.

@jasmussen
Copy link
Contributor

Before this PR goes on any longer, I think it'd be good to just land it and do followups. I think we can do the final review!

@mkaz
Copy link
Member Author

mkaz commented Jan 16, 2021

👍 This is testing well for me now and agree it is in a good spot, we should land and iterate.
I would approve but looks like it is my PR 😆

@jasmussen jasmussen requested a review from a team January 18, 2021 08:42
Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

Tested this and it worked very well. The code looks good to me 👍

@jasmussen jasmussen merged commit 3f065f1 into master Jan 18, 2021
@jasmussen jasmussen deleted the try/nav-block/empty branch January 18, 2021 10:53
@github-actions github-actions bot added this to the Gutenberg 9.9 milestone Jan 18, 2021
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 Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants