-
Notifications
You must be signed in to change notification settings - Fork 144
Add existing TaskList component to new home screen #4378
Conversation
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 working well, code looks good. I made a few minor comments and have a question about preloading the option so we don't have to have a placeholder.
if ( isOnboardingEnabled() ) { | ||
const options = getOptions( [ | ||
'woocommerce_task_list_hidden', | ||
] ); |
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.
Should we pre-load this option? It seems like holding off on render while waiting for this request is unnecessary. What do you think?
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 can preload this option but that doesn't remove the need for the placeholder - it's in use as the Suspense fallback as well.
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.
Sounds good, 👍 to preloading
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.
It looks like this is already preloaded:
woocommerce-admin/src/Features/Onboarding.php
Line 504 in 5f3223f
$options[] = 'woocommerce_task_list_hidden'; |
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.
Is that file getting loaded on the homescreen route? I think we do conditional loading of OBW logic. I haven't fired this one up, but I remember it waiting on this option to be fetched.
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.
Nevermind, that option is available at wcSettings.preloadOptions.woocommerce_task_list_hidden
.
I'll take a closer look today.
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.
Its some kind of wc-api thing because if I hard code the values, then it renders as soon as the chunk has arrived. This looks fine to me, #4144 will ensure the preloaded option is available immediately.
|
||
const TaskListPlaceholder = ( props ) => { | ||
const { | ||
numTasks = 5, |
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.
Nitpick: May as well destructure in the function's argument list
numTasks = 5, | ||
} = props; | ||
return ( | ||
<div className="woocommerce-task-dashboard__container"> |
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.
How about this class name?
<div className="woocommerce-task-dashboard__container"> | |
<div className="woocommerce-task-list__container"> |
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.
That's the existing class name here: https://github.com/woocommerce/woocommerce-admin/blob/master/client/dashboard/task-list/index.js#L373
export default compose( | ||
withSelect( ( select ) => { | ||
const { | ||
getOptions, |
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.
just an FYI that this is getting refactored in #4144. If this is merged first, I'll update the code.
42d813e
to
d7246f9
Compare
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.
Looking great @jeffstieler ! Working well and code looking good.
8523236
to
038cef8
Compare
Progress towards #4096
This PR seeks to render the existing
<TaskList />
component on the new home screen (before modifying it to suit the new designs).A new
TaskListPlaceholder
component has been added to use during lazy load and API fetch.It also modifies the test configuration to allow for dynamic
import()
s.Accessibility
prefers-reduced-motion
Screenshots
Detailed test instructions:
Changelog Note: