-
Notifications
You must be signed in to change notification settings - Fork 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
A4A: Add WooCommerce extension product descriptions. #90763
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~910 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~5544 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~3339 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Per the slack discussion, could we:
Keeping in mind that the more links open a model with the full more robust product descriptions. We don’t need to cram everything into these cards, especially with such inconsistency in description length. With a char limit, these will be so much more uniform and easy to browse |
const truncateDescription = ( description: any ) => { | ||
if ( description.length <= 130 ) { | ||
return description; | ||
} | ||
|
||
const lastSpace = description.slice( 0, 128 ).lastIndexOf( ' ' ); | ||
|
||
return description.slice( 0, lastSpace > 0 ? lastSpace : 129 ) + '…'; | ||
}; | ||
|
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 is a nit pick. But I think you can simplify this by just:
const truncateDescription = ( description: any ) => { | |
if ( description.length <= 130 ) { | |
return description; | |
} | |
const lastSpace = description.slice( 0, 128 ).lastIndexOf( ' ' ); | |
return description.slice( 0, lastSpace > 0 ? lastSpace : 129 ) + '…'; | |
}; | |
const truncateDescription = ( description: any ) => { | |
const lastSpace = description.slice( 0, 128 ).lastIndexOf( ' ' ); | |
return description.slice( 0, lastSpace <= 129 ? lastSpace : 128 ) + '…'; | |
}; | |
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.
LGTM
Rock on @rcoll - thanks for this. Just a couple more small adjustments if you don't mind before we ship. Changes:
Future PR / project@madebynoam @keoshi @rcanepa @simonktnga8c - a problem I'm seeing at scale is some wasted space and misalignment within these cards. Some of these Woo exts have very long titles. Our current card pattern doesn't scale to meet them, and we're wasting a lot of real estate. Currently:
Proposal:
I think we can squeeze this update in within the marketplace scale project (pfunGA-1kR-p2). If not, this should happen soon after, regardless. |
d11f292
to
544549a
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/13479749 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Hi @rcoll, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include all of the following strings:
Thank you in advance! |
Proposed Changes
Testing Instructions
Pre-merge Checklist