-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Document Settings: Make Post Format, Slug and Author fields fill the sidebar #42146
Conversation
.editor-post-author__select { | ||
margin: -5px 0; | ||
|
||
// Set the width of the author select box in IE11 to prevent it overflowing | ||
// outside of the container because of IE11 flexbox bugs. | ||
// We reset it to `width: auto;` for non-IE11 browsers. | ||
width: 100%; | ||
@supports (position: sticky) { | ||
width: auto; | ||
} |
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.
This appears to be dead code.
Size Change: -121 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
It looks good to me! |
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.
This tests well for me, @noisysocks 👍
Question: Do you think removing some classes makes it a backward-compatibility breakage?
@@ -41,25 +42,19 @@ export class PostSlug extends Component { | |||
} | |||
|
|||
render() { | |||
const { instanceId } = this.props; | |||
const { editedSlug } = this.state; |
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.
The slug change from URL form isn't reflected in the slug text field without page refresh.
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.
Looks like this bug exists on trunk
too so I'm just going to plow ahead.
For context I think this component was added back when we used the post editor for templates and template parts but was never removed and now we're stuck maintaining it. In theory a plugin can add add_post_type_support( 'post', 'slug' )
but I do not see any evidence that this is happening.
We don't officially consider class names as part of the public API, so no, but my view is that it's best to minimise class name changes. In this PR the removed class names are for elements that are being removed so we can't offer an alternative. |
What?
Tidies up the Post Format, Slug and Author fields by making them fill the width of the document settings sidebar.
Why?
Related to #39082. I noticed these fields looked pretty janky and so spoke with @javierarce about how we can clean them up with minimal effort.
How?
Tweaked the CSS and switched these controls over to using
SelectControl
andTextControl
.Testing Instructions
gutenberg.php
so that you see Slug:add_post_type_support( 'post', 'slug' )
.