Repository navigation
Checklist: Unify WordPress.com checklist and banner - #26764
Conversation
f3027cf to
e20eb5f
Compare
298628a to
da105ac
Compare
| 'contact_page_updated', | ||
| 'post_published', | ||
| 'custom_domain_registered', | ||
| ].includes( taskId ) || task.completed === true |
There was a problem hiding this comment.
Ugh… this defeats the whole purpose.
Server returns more Tasks than are in the Checklist. We don't want to report incomplete when we aren't rendering some server-reported tasks (we can't complete them!)
|
Documenting that I considered only querying the tasks we're interested in, but this is a bit fragile and has its own issues. Where does filtering happen? API does not currently support it, data-layer |
| const count = Children.map( children, child => child.props.completed ).reduce( | ||
| ( acc, completed ) => ( true === completed ? acc + 1 : acc ), | ||
| const completedCount = Children.toArray( children ).reduce( | ||
| ( count, task ) => ( true === task.props.completed ? count + 1 : count ), |
There was a problem hiding this comment.
Would it make sense to use countBy() instead of reduce() here?
There was a problem hiding this comment.
It might, but I'm not familiar with countBy. If you want to rewrite to a simpler countBy, please feel free 👍
|
Noting for posterity/future me: As discussed on a video call, I find However, I've blocked the JP checklist long enough with my architectural requests, and this PR makes things already a lot better, so I rest my case 😄 |
ockham
left a comment
There was a problem hiding this comment.
Left a few notes, but overall, LGTM!
|
I'm putting this on hold, it needs a rebase and some rethinking since #26758 landed. |
|
This is what I get from copy-pasta |
|
Knee jerk reaction– GIVE ME THIS: https://eslint.org/docs/rules/no-implicit-globals (related context WordPress/gutenberg#9266) |
|
FTR (from a Slack convo with Jon): While there is a Edit: jinx |
|
@sirreal yeah, this has burned us more than a few times. |
|
Tested instructions from #26758 and it continues to perform as expected. No obvious regressions there. |
|
There's another regression after #26867 that I'm fixing. The banner is only showing when |
Changed in #26867, regression introduced during rebase.
|
I've fixed some regressions that had been introduced during rebase which lost changes from #26721 and #26867. It would be good for reviewers to test instructions from those PRs for regressions. This is working well now in my testing. |
|
I restructured in order to be able to remove some eslint namespace ignores. I've gone through all the commentary and this should be ready for review. |
There was a problem hiding this comment.
Tested:
- Jetpack site
- No
ChecklistBanner - 6 tasks
- No
- WP.com site without
designType- No
ChecklistBanner - 7 tasks
- No
- WP.com site with
designTypeset toblog-
ChecklistBannerdisplayed - 9 tasks
- 'About Page' and 'First Post' links point to correct destinations after completion
-
🎉 🎈 🎆
| const location = 'banner' === this.props.viewMode ? 'checklist_banner' : 'checklist_show'; | ||
|
|
||
| this.props.recordTracksEvent( 'calypso_checklist_task_start', { | ||
| checklist_name: 'jetpack', |
There was a problem hiding this comment.
This is a regression, should be new_blog.
Fix in #27304
This PR continues separation of state and declarative structure work outlined in #26216.
Inspired by suggestions from @ockham, the Checklist is declared once in idiomatic React JSX, and can be rendered as a checklist of tasks or a banner (see
viewModeprop).ChecklistShow, responsible only for rendering the WordPress.com checklist, has been removed.onboardingChecklisthas been removed, and is now JSX inWpcomChecklist.ChecklistBannerhas been removed and replaced by<WpcomChecklist viewMode="banner" />.ChecklistMainrenders theWpcomChecklistand some surrounding UI. Clean up its usage of task status for calculating completion.mergeObjectIntoArrayByIdutil which is no longer needed and related tests