-
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
Assembler: Add the shuffle button to the action bar #80078
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~1122 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. 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. |
b6b57b7
to
e48eeb2
Compare
|
||
export const getShuffledPattern = ( candidates: Pattern[], current: Pattern ) => { | ||
const filteredCandidates = candidates.filter( ( { ID } ) => ID !== current.ID ); | ||
const shuffledIndex = Math.floor( Math.random() * filteredCandidates.length ); |
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.
Question: Do we want to pick randomly or just the next one?
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.
Let's go with random, as per core's implementation draft.
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 👍
|
||
export const getShuffledPattern = ( candidates: Pattern[], current: Pattern ) => { | ||
const filteredCandidates = candidates.filter( ( { ID } ) => ID !== current.ID ); | ||
const shuffledIndex = Math.floor( Math.random() * filteredCandidates.length ); |
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.
Let's go with random, as per core's implementation draft.
Related to #79656
Proposed Changes
calypso_signup_pattern_assembler_pattern_shuffle_click
to track how many users click the shuffle button.Demo
assembler-shuffle-patterns.mov
Event
Testing Instructions
/setup/with-theme-assembler?siteSlug=<your_site>
Pre-merge Checklist