-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add product description title in old product editor #35154
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
Add product description title in old product editor #35154
Conversation
Test Results SummaryCommit SHA: 0a72fc3
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
joshuatf
left a comment
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! Flashbacks to the old days of jQuery.
Left one question and a minor clean-up comment, but pre-approving as everything is working as described.
The design feels slightly odd and eats into valuable screen real estate on smaller screens, but I'll leave this up to @jarekmorawski to approve.

| margin: 6px 12px 0; | ||
| } | ||
| #post-status-info { | ||
| margin: 0px 12px 12px; |
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.
Do we have access to our usual scss vars in here? If so we could use gap vars like $gap-small.
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.
Unfortunately it doesn't seem like we do.
| @@ -0,0 +1,15 @@ | |||
| /* global woocommerce_admin_product_editor */ | |||
| jQuery( function ( $ ) { | |||
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.
jQuery 💥
| wp_enqueue_script( 'wc-admin-product-editor', WC()->plugin_url() . '/assets/js/admin/product-editor' . $suffix . '.js', array( 'jquery' ), $version ); | ||
|
|
||
| wp_localize_script( 'wc-admin-product-editor', 'woocommerce_admin_product_editor', array( | ||
| 'i18n_description' => esc_js( __( 'Product Description', 'woocommerce' ) ), |
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 think this should be a lowercase "D" to match the other field titles on the page:
| 'i18n_description' => esc_js( __( 'Product Description', 'woocommerce' ) ), | |
| 'i18n_description' => esc_js( __( 'Product description', 'woocommerce' ) ), |
Can we add a bottom padding to the permalink element, so the space between the product name input field and the description card is maintained? It looks off when they're this close to each other.
What about it feels odd to you, Josh? It does take up more space, but not unlike all other cards on the screen. I would keep it as is. |
d5b624e to
1551091
Compare
|
Thanks @jarekmorawski I updated the screenshots above with the new spacing.
Instead of add a bottom padding to the permalink, I added a margin to the top of the description meta box. Mostly because this would prevent the Product description to jump down once the permalink becomes visible. This is how the previous design was laid out as well. The extra spacing doesn't appear to be to noticable. |
|
@joshuatf this should be ready for a re-review |
|
I agree. It looks good to me! |
joshuatf
left a comment
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.
Sorry about the late re-review! LGTM 🚢
What about it feels odd to you, Josh? It does take up more space, but not unlike all other cards on the screen. I would keep it as is.
I suppose because unlike other cards it's an editing experience and on smaller screens could reduce the editor by almost 10%. But if this looks good to you, then it's fine by me. I also think the number of users editing on smaller screens is relatively small.
AFAIK it's in single digits. I don't think we need to focus on it too much now. We'll do mobile right in the new UX. 👍 |
|
Hi @louwie17, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
Added a product description title to the product text editor, using a similar format as the short description, making use of the postbox styling.
There wasn't an overly clean way to do this aside from doing it through JavaScript, as the
edit-form-advanced.phpfile doesn't provide many filters to wrap thewp_editorin: https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-form-advanced.php#L581-L649The only options would be to make use of the
edit_form_after_titleand remove thepost_type_supports, but this could break backwards compatibility and theedit_form_after_titledoes not seem like the right action to use for this.One side note to my JavaScript implementation, I decided to only append the title html and add a class to handle the remaining styling. I did try to actually wrap the
editorhtml usinginnerHtml, but this seemed to break the bootstrapping of the editor.cc @jarekmorawski for styling approval, see above two images.
Closes #33538 .
How to test the changes in this Pull Request:
Other information:
pnpm --filter=<project> run changelog add?FOR PR REVIEWER ONLY: