-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Redesign Table Block Placeholder #15903
Conversation
Thanks, @tellthemachines! This looks great. Here's a screenshot: 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: |
@kjellr done! |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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! 🙂
There was a problem hiding this comment.
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 😭 😂
Cool, thanks @tellthemachines. Looks good on my end: I'd like to just make sure @mapk gets one last look too, since he started the original ticket. |
Doesn't look like the Travis CI failures are legitimate—I restarted the job for you! |
@mapk would be awesome to get your feedback on this change! |
I just tested as well. It looks great @tellthemachines! LGTM! |
Excellent. Looks like we've got multiple ✅, so I'll go ahead and merge this in. Thanks again, @tellthemachines! |
Nice one @tellthemachines |
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:
Screenshots
Types of changes
Enhancement (non-breaking change which adds functionality)
Checklist: