-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Mobile - Notice list - Code improvements and bug fixes #40415
Conversation
- Removes the shouldStack prop which is not used - Stack all notices in the same position if there's more than one - Refactor List component to functional component - Fixes bug where the notices weren't getting removed - Replace dimension listener with windowDimensions hook
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
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.
I tested both iOS and Android with this branch checked out, and was no longer able to replicate any of the duplication with the notice. This PR was also a nice masterclass for me in best practices and code quality (thank you!) :)
The issue with the notice was also noticeable when tapping the "Set/Removed Featured" button in an image block's settings multiple times in a row, which always bugged me. I'm happy to see it's fixed as part of these changes, too. 🎉
LGTM! Thanks Gerardo.
Aside: I believe the E2E test failure will be fixed when updating from trunk
following the changes in #40412
Yay! Thank you for the review and testing!
Ohh glad that's fixed as well 🙌
Cool! I'll update it and merge 🚀 |
- Removes the shouldStack prop which is not used - Stack all notices in the same position if there's more than one - Refactor List component to functional component - Fixes bug where the notices weren't getting removed - Replace dimension listener with windowDimensions hook
Gutenberg Mobile PR
-> Mobile - Notice list - Code improvements and bug fixes wordpress-mobile/gutenberg-mobile#4768Fixes wordpress-mobile/WordPress-iOS#18036
Fixes wordpress-mobile/WordPress-Android#15643
What?
A few issues were opened reporting that toggling between the HTML / Visual mode of the editor does not track the change in the notices.
Why?
By checking the code I found the notices weren't getting removed from the store as well as the animation when collapsing wasn't running as expected.
How?
For the Notice component, it refactors the code with the following:
useWindowDimensions
.onNoticeHidden
when it should, to remove the displayed notice from the store.For the NoticeList component:
shouldStack
prop since it's not used at all.key
prop from the containersView
.Testing Instructions
Test case 1 - Toggling between HTML/Visual mode
Test case 2 - Block actions
Screenshots or screencast