For #17377 - Fix for empty awesomeBar on searchFragment open #17435
For #17377 - Fix for empty awesomeBar on searchFragment open #17435
Conversation
9044707
to
a9f0044
Compare
Pushed a fix for the case where the awesomebar would disappear if ever the user would type in the address bar the same url the tab has. |
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 think it's fine to fix this here as it's more responsive, as you wrote, and would need a bit more thought in A-C e.g. is it always the right default to hide the awesomebar if there are no suggestions or do we need to make this configurable?
So +1 to landing this. It regressed a while ago and is already in beta as well, so we should consider uplifting this.
One nit / potential simplification below. It would also be nice to cover this with a unit test, but in this case it can be a follow-up ticket.
app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt
Outdated
Show resolved
Hide resolved
… open The awesomeBar was set to stay hidden for the first consumeFrom(store) if the SearchDialogFragment.kt. However, recent changes send an additional store update when the view is created. To work around it we can take a look at AwesomeBarView.update(), we see that the awesomeBar suggestions get provided only if the query != url. So we can use the same method to keep the awesomeBar hidden until the user changes anything in the url.
a9f0044
to
05a08cb
Compare
Codecov Report
@@ Coverage Diff @@
## master #17435 +/- ##
============================================
+ Coverage 32.27% 32.30% +0.03%
Complexity 1289 1289
============================================
Files 456 456
Lines 18946 18925 -21
Branches 2642 2637 -5
============================================
Hits 6114 6114
+ Misses 12348 12327 -21
Partials 484 484
Continue to review full report at Codecov.
|
… open (mozilla-mobile#17435) The awesomeBar was set to stay hidden for the first consumeFrom(store) if the SearchDialogFragment.kt. However, recent changes send an additional store update when the view is created. To work around it we can take a look at AwesomeBarView.update(), we see that the awesomeBar suggestions get provided only if the query != url. So we can use the same method to keep the awesomeBar hidden until the user changes anything in the url.
The awesomeBar was set to stay hidden for the first consumeFrom(store) of the SearchDialogFragment.kt. However, recent changes send an additional store update when the view is created. To work around it we can take a look at AwesomeBarView.update(), we see that the awesomeBar suggestions get provided only if the query != url. So we can use the same method to keep the awesomeBar hidden until the user changes anything in the url.
Pull Request checklist
To download an APK when reviewing a PR:
awesomebarfix.mp4