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

Redesign Table Block Placeholder #15903

Merged
merged 7 commits into from
Jun 4, 2019

Conversation

tellthemachines
Copy link
Contributor

@tellthemachines tellthemachines commented May 30, 2019

Description

Fixes #15820

Updated table block to use Placeholder component and implement design from #15820.

How has this been tested?

Updated e2e tests to reflect changed button text.

Steps to test:

  1. Create a new post;
  2. Add table block;
  3. Verify that placeholder displays according to design spec.

Screenshots

Screen Shot 2019-05-30 at 5 15 21 pm

Types of changes

Enhancement (non-breaking change which adds functionality)

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.

@tellthemachines tellthemachines marked this pull request as ready for review May 30, 2019 07:30
@talldan talldan added [Block] Table Affects the Table Block [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. labels May 30, 2019
@talldan talldan requested review from mapk and kjellr May 30, 2019 07:31
@tellthemachines
Copy link
Contributor Author

Hi @mapk and @kjellr the design changes to the table block placeholder are ready for review. As discussed on the issue, these changes vary slightly from the designs on the issue. Let me know what you think!

@kjellr
Copy link
Contributor

kjellr commented May 30, 2019

Thanks, @tellthemachines! This looks great.

Here's a screenshot:

Screen Shot 2019-05-30 at 2 24 09 PM

I don't mind the labels-on-top, but I do think the number fields are a little long considering the content that'll go inside them. I wonder if we can narrow them down a bit? Something like this, perhaps:

Screen Shot 2019-05-30 at 2 23 52 PM

@tellthemachines
Copy link
Contributor Author

@kjellr done!

Screen Shot 2019-05-31 at 2 07 03 pm

@noisysocks noisysocks removed the Needs Design Feedback Needs general design feedback. label May 31, 2019
Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

Nice work, and congrats on your first PR! 🎉🌈

Tested this locally and it's looking groovy. Just a few minor comments.

@@ -54,6 +54,11 @@
}
}

.components-placeholder__fieldset.is-column-layout,
.components-placeholder__fieldset.is-column-layout form {
Copy link
Member

Choose a reason for hiding this comment

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

Any thoughts on overriding this style in packages/block-library/src/table/editor.scss as opposed to introducing a new prop? Will the prop be useful in any other blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. The existing blocks all have a horizontal layout, but so far there are no others with multiple inputs. That is probably the scenario where the column layout is most useful. Is it likely there will be more of these in the future?

Copy link
Member

@noisysocks noisysocks Jun 3, 2019

Choose a reason for hiding this comment

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

I'd lean towards You Ain't Gonna Need It, but no strong preference either way 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm good point, I'll look into a table-specific override.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK so there's no way of doing this without changing the Placeholder component in some way, because the CSS for column layout needs to be added to an inner element, not to the wrapper that takes the className prop. The alternative to isColumnLayout would be to pass in a second className prop, say fieldsetClassName, to be applied to the inner div. That seems a bit messier, and less self-explanatory, so will stick with the current solution.

Copy link
Member

Choose a reason for hiding this comment

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

We could pass in className="wp-block-table__placeholder" and then have:

.wp-block-table__placeholder .components-placeholder__fieldset,
.wp-block-table__placeholder .components-placeholder__fieldset form,
{
	flex-direction: column;
}

But, yes, as this point it's not very tidy. I'll defer to your judgement! 🙂

Copy link
Contributor Author

@tellthemachines tellthemachines Jun 3, 2019

Choose a reason for hiding this comment

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

I've been using CSS Modules for too long, keep forgetting that nesting classes is a thing 😭 😂

@kjellr
Copy link
Contributor

kjellr commented May 31, 2019

Cool, thanks @tellthemachines. Looks good on my end:

Screen Shot 2019-05-31 at 9 14 58 AM

I'd like to just make sure @mapk gets one last look too, since he started the original ticket.

@noisysocks
Copy link
Member

Doesn't look like the Travis CI failures are legitimate—I restarted the job for you!

@tellthemachines
Copy link
Contributor Author

@mapk would be awesome to get your feedback on this change!

@mapk
Copy link
Contributor

mapk commented Jun 4, 2019

I just tested as well. It looks great @tellthemachines! LGTM! :shipit: Thanks so much for working on this.

@kjellr
Copy link
Contributor

kjellr commented Jun 4, 2019

Excellent. Looks like we've got multiple ✅, so I'll go ahead and merge this in. Thanks again, @tellthemachines!

@kjellr kjellr merged commit 0d60f1b into WordPress:master Jun 4, 2019
@talldan talldan added this to the 5.9 (Gutenberg) milestone Jun 5, 2019
@youknowriad
Copy link
Contributor

Nice one @tellthemachines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table block: Placeholder setup screen redesign
6 participants