-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update free domain suggestions UI #17998
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
|
💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
App | WordPress | |
Build Flavor | Jalapeno | |
Build Type | Debug | |
Commit | ab46b8f |
|
💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
App | Jetpack | |
Build Flavor | Jalapeno | |
Build Type | Debug | |
Commit | ab46b8f |
👋 @ovitrif ! I am seeing being included in this feature related PR review, alongside other feature engineers, was that on purpose, is there is anything core specific that you would like me to review here? 🤔 |
...ss/src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsAdapter.kt
Show resolved
Hide resolved
👋 Petros, you're uber fast 🚀 👀 🏆 |
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.
Nice job! I added a few comments (mostly questions and minor suggestions).
Also, while testing it I noticed a couple of things and just wanted to confirm with you that this is the intender behavior right now.
- When following this step: "Replace the
t
in the search field with%
" both in the Control and Treatment Variations, I found that I only get the error if there are ONLY invalid characters, is that correct? - In the Treatment Variation, selecting an item doesn't make it "selected" (highlighted or something visually different), is that on purpose for now?
Screenshots for question 1:
Valid + Invalid Chars | Only Invalid Chars |
---|---|
.../src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainViewHolder.kt
Show resolved
Hide resolved
.../src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainViewHolder.kt
Outdated
Show resolved
Hide resolved
...ss/src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsAdapter.kt
Show resolved
Hide resolved
.../src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsViewModel.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/sitecreation/domains/compose/DomainItem.kt
Show resolved
Hide resolved
.../test/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsViewModelTest.kt
Show resolved
Hide resolved
.../src/main/java/org/wordpress/android/ui/sitecreation/domains/SiteCreationDomainsViewModel.kt
Outdated
Show resolved
Hide resolved
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.
🛑 Uh-oh, I was testing it a bit more and I found a crash 😬
First, I found that the animations get janky when tapping a free domain and that the keyboard is shown again even though I just hid it.
Then, I found out that when tapping 2 different free domains alternately quickly, the app crashes.
It seems it happens because this changes the selectedDomain
here, causing an UI state update, which triggers this observable here and causes the whole UI to be rebuilt.
This causes the recycler view holder to call onBind
again, but if done too quickly it seems to be causing a call to a LifecycleOwner
that no longer exists (or something like that) when calling this line.
Crash video (OnePlus 5T on Android 10) ↘️
pr-17998-quick-tap-crash.mp4
See the crash logs below ↘️
FATAL EXCEPTION: main
Process: com.jetpack.android.prealpha, PID: 15414
java.lang.IllegalStateException: View tree for androidx.compose.ui.platform.ComposeView{9a4a4be V.E...... .......D 0,0-1080,142 #7f0a019b app:id/compose_view} has no ViewTreeLifecycleOwner
at androidx.compose.ui.platform.ViewCompositionStrategy$DisposeOnViewTreeLifecycleDestroyed.installFor(ViewCompositionStrategy.android.kt:109)
at androidx.compose.ui.platform.AbstractComposeView.setViewCompositionStrategy(ComposeView.android.kt:140)
at org.wordpress.android.ui.sitecreation.domains.SiteCreationDomainViewHolder$DomainComposeItemViewHolder.onBind(SiteCreationDomainViewHolder.kt:74)
at org.wordpress.android.ui.sitecreation.domains.SiteCreationDomainsAdapter.onBindViewHolder(SiteCreationDomainsAdapter.kt:40)
at org.wordpress.android.ui.sitecreation.domains.SiteCreationDomainsAdapter.onBindViewHolder(SiteCreationDomainsAdapter.kt:19)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1631)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4012)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4578)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at androidx.core.widget.NestedScrollView.onLayout(NestedScrollView.java:1983)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:148)
at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:2119)
at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:786)
at android.view.View.layout(View.java:22085)
at android.view.ViewGroup.layout(ViewGroup.java:6290)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3363)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2834)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1947)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8048)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1163)
at android.view.Choreographer.doCallbacks(Choreographer.java:986)
at android.view.Choreographer.doFrame(Choreographer.java:902)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1148)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7697)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Thanks for your great review @thomashorta 🙇
Yep that's the expected and existing behavior on 📮 Postman screenshots when querying the
True, that's because we were still deciding on the new UI, and this task was the initial plan: #17901 where we would have shown a modal instead of any a visual indication on the selected item 😉 . |
Thanks a lot for finding this bug @thomashorta before we merge the PR. It almost slipped through and we could have missed it 🤦 . This really reminds me how important it is to a little more exploratory testing in every PR and continue to dedicate the last week of a project to testing, a ritual we started last year in our team. I was able to repro it and proceeded to address the issue in this commit: 039ea86. It doesn't reproduce for me anymore 🤞 Thanks for investigating the call stack leading to it. |
@thomashorta Can you make a recording of this or explain how I could repro this? Thanks in advance 🙏
Another great discovery @thomashorta 🥇 . This seems to be a bug in production as well, I filed issue #18004 and added it on the project board. I won't fix it it this PR since it's already an existing issue and this PR is starting to be concerned with too many things 😅 . |
👋 @antonis (and @thomashorta) This PR is ready for another pass. The crash has been resolved in 039ea86. I don't see any unaddressed issues except #18004 which is in production as well so we skip it on purpose 🤞 |
The original crash video I posted shows the animation issue, but it is subtle. The animation I'm referring to is the ripple effect on item clicks when tapping a free domain that is not the currently selected one. It is very subtle so maybe not worth taking a look now, especially because I think it might be related to using Compose inside a Here's a video that makes the issue clearer by tapping twice on the same item. Notice how the first animation stops abruptly and the second one (which doesn't trigger a UI update) has a smoother fade-out. I also slowed down the animations using Developer Settings so it's easier to see, in the second part of the video. pr-17998-ripple-animation-update.mp4But again, I'm fine with keeping it this way for now, as it is probably related to the |
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 and the crash doesn't happen anymore. Thanks!
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 for the update @ovitrif and for the extensive review @thomashorta 🙇
The #17998 (comment) has been resolved in 039ea86. I don't see any unaddressed issues except #18004 which is in production as well so we skip it on purpose 🤞
I've retested with a debug build on my Pixel 5 / Android 13 and wasn't able to reproduce the crash or any other new issue. The code after the updates also LGTM 🎉
Thanks @thomashorta. It's rather inconsistent than "janky" IMHO. |
Gonna merge this once the PR of the base branch can be merged to |
039ea86
to
ab46b8f
Compare
Resolves #17899
This PR:
Domain
prefixes from ui state class names when it can be deducedTo Test
Prerequisites:
◐ Toggle the Site Creation Domain Purchasing feature (
SiteCreationDomainPurchasingFeatureConfig
)Me
→App Settings
→Debug settings
Features in development
sectionSiteCreationDomainPurchasingFeatureConfig
RESTART THE APP
buttonSite Creation Domain Purchasing
feature flagOFF
(should be the case)Open Site Picker
→➕
→Create WordPress.com site
Choose a domain
screentest
in the search fieldtest.wordpress.com
followed by available one(s)✗
button to clear the search querytested
in the search field✗
button to clear the search querytestet
in the search fieldThere is no network available
Retry
)t
in the search field with%
Site Creation Domain Purchasing
feature flagON
Open Site Picker
→➕
→Create WordPress.com site
Choose a domain
screenCreate Site
button is displayedCreate Site
button is hiddenScreenshots
Regression Notes
Potential unintended areas of impact
Site creation → Domains when the experimental feature is disabled
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
Updated unit tests in
SiteCreationDomainsViewModelTest
. I don't think more tests are needed since most of the changes are in the view layer and the improved ui state strong typing is a solid way to guard against regressions when it comes to view-model.PR submission checklist:
RELEASE-NOTES.txt
if necessary.