-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Adding badge to legacy admin menu to indicate remaining onboarding tasks #32611
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
Conversation
| return; | ||
| } | ||
|
|
||
| foreach ( $submenu['woocommerce'] as $key => $menu_item ) { |
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 using basically the same logic and styles as the preexisting orders badge, but I'm receptive to a more elegant way if one exists.
|
Good job @joelclimbsthings! The code looks good and it's working as expected but I'm not sure about the current behavior. There are a few tasks that don't refresh the page after finishing them and the badge doesn't update, creating some confusion. Is it possible to update the remaining tasks badge on the fly? |
|
Thanks for the review @octaedro !
Yeah, I actually mentioned this in my "Notes" above. We can definitely do this, although it would just be altering the markup via JS, so feels a bit hacky. That said I still may be in favor of it. Also, we'd want to ensure that's it's only executed when a task doesn't result in a page refresh, and I'm not sure offhand if there's a good preexisting place to do that, or if we'd have to do something tricky.
Actually not sure on this one. The original issue doesn't mention that as an exception, but we'd have to ask @jarekmorawski to clarify. |
|
Thank you @joelclimbsthings for your answer.
Since this is something with high visibility, I would be cautious about possible inconsistencies because they could be seen as bugs by the user that doesn't refresh the page. Is there a chance for us to improve that? // CCing @pmcpinto and @jarekmorawski , to have more insights about the expected behavior here. |
7a75a79 to
cc09e94
Compare
Considering this, I wonder I we should show just "1" in the badge instead of the number of incomplete tasks. @jarekmorawski @verofasulo what do you think? |
"1" can be misleading since it's not entirely clear what it'd mean. How about an asterisk or a simple red dot? Anything to indicate there are things in there that require people's attention. 🤔 |
plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php
Outdated
Show resolved
Hide resolved
octaedro
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.
Thank you @joelclimbsthings for adding the dynamic update. The changes look good, I just left a couple of small comments.
|
Hey @octaedro , I've resolved the issues you brought up, and also took the liberty of tweaking the condition controlling the reminder bar since it was out of date. |
…experiment states and control
ed51f31 to
8e04383
Compare
jacob-sewell
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.
The only hiccup I had was that hiding the task list didn't result in the badge disappearing until after a refresh.
|
Thanks!
Nice catch. Since the remedy would be fairly inelegant and hacky, and it's a fairly rare event, I'm opting for leaving it as is for now. We can revisit if needed. |
|
Hi @joelclimbsthings, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
|
Just noting this PR was merged with a failing k6 test due to the badge addition causing the k6 test assertion (which used the home menu item) to fail. PR to update the assertion here #33044 |



All Submissions:
Changes proposed in this Pull Request:
Adding a badge to the home-screen item on the admin menu to indicate how many setup tasks remain.
Notes:
Closes #32160 .
How to test the changes in this Pull Request:
Other information:
pnpm nx affected --target=changelog?FOR PR REVIEWER ONLY: