-
Notifications
You must be signed in to change notification settings - Fork 991
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
MBL-2135: SearchAndFilter viewmodel #2247
base: master
Are you sure you want to change the base?
Conversation
- Re-setting to initial state when empty search term is now working - Updated tests (More to come error UI, analytics + reftags, more tests).
… shown on Search when using `collectLatest`
* @param selectedProject The project selected by the user. | ||
* @return The project and its appropriate ref tag. | ||
*/ | ||
private fun projectAndRefTag( |
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 method has been ported directly from the old search experience.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2247 +/- ##
============================================
+ Coverage 67.69% 67.71% +0.02%
- Complexity 2204 2219 +15
============================================
Files 360 360
Lines 24357 24419 +62
Branches 3582 3593 +11
============================================
+ Hits 16488 16535 +47
- Misses 5987 5999 +12
- Partials 1882 1885 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
if (debouncedTerm.isEmpty() || debouncedTerm.isBlank()) { | ||
_params.emit(popularDiscoveryParam) | ||
} else | ||
_params.emit( |
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.
In future additions, with category selection or project sort, there will be inputs to this VM (similar to updateSearchTerm
) that will add new emissions to _params with each user selection.
In the future will likely not collect searchTerm
chain but rather params
📲 What
🤔 Why
Some background context on why the change is needed.
🛠 How
on VM init debuncing searchterm will trigger the query with specific discovery params
ℹ️ (More sorting and filtering options will be extended in follow up tickets)
Reftags added when pressing a project result of a search (either with or without terms, take a look at unit tests if more details required).
Analytics events triggered with every search query execution ( 1CTA, 1 PAGE_VIEWED) with the discovery params.
ℹ️ (PAGE_VIEWD) even will be extended with pagination pages information on following tickets.
Error handling via red snackbar with generic error message.
CancellationException
(withinKSApolloClient
) is not considered an error, when usingcollectLatest
previous suspend functions/flow emissions will be canceled, this is the expected behaviour as we want to execute networking and update UI only with the most recent params and should not be considered an error that requires user feedback.👀 See
searchExperience.mp4
| | |
📋 QA
Story 📖
MBL-2135