Skip to content
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

feat: #1343 - "world" queries and faster cached result display #2718

Merged
merged 3 commits into from Aug 3, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Deleted file:

  • group_query_filter_view.dart: old code never used and never changed

Impacted files:

  • app_en.arb: added 2 labels for "world results"
  • app_fr.arb: added 2 labels for "world results"
  • category_product_query.dart: implemented world query
  • keywords_product_query.dart: implemented world query
  • paged_product_query.dart: introduced word query parameter and methods
  • paged_search_product_query.dart: implemented world query
  • paged_to_be_completed_product_query.dart: implemented world query
  • product_list_supplier.dart: refactored
  • product_model.dart: loosely related safer "notifyListeners" method
  • product_query.dart: now storing here the country, which makes "world" queries possible
  • product_query_model.dart: removed all the "category filter" code; better management of the "what if the refresh download fails?" case
  • product_query_page.dart: added "world" queries; removed the "category filter" code; now displays a MaterialBanner (more flexibility than a SnackBar)
  • smooth_theme.dart: added a banner theme for MaterialBanner

What

  • As in the web version, there's the possibility to run search queries not only on the current country, but in the world.
  • This is specifically useful for country with few products, or queries with few results in general.
  • As an optimization, the category filter has been removed. As a result, the cached results are displayed instantly.

Screenshot

country page world page
Capture d’écran 2022-08-03 à 09 43 02 Capture d’écran 2022-08-03 à 09 43 28

Fixes bug(s)

…isplay

Deleted file:
* `group_query_filter_view.dart`: old code never used and never changed

Impacted files:
* `app_en.arb`: added 2 labels for "world results"
* `app_fr.arb`: added 2 labels for "world results"
* `category_product_query.dart`: implemented world query
* `keywords_product_query.dart`: implemented world query
* `paged_product_query.dart`: introduced word query parameter and methods
* `paged_search_product_query.dart`: implemented world query
* `paged_to_be_completed_product_query.dart`: implemented world query
* `product_list_supplier.dart`: refactored
* `product_model.dart`: loosely related safer "notifyListeners" method
* `product_query.dart`: now storing here the country, which makes "world" queries possible
* `product_query_model.dart`: removed all the "category filter" code; better management of the "what if the refresh download fails?" case
* `product_query_page.dart`: added "world" queries; removed the "category filter" code; now displays a `MaterialBanner` (more flexibility than a `SnackBar`)
* `smooth_theme.dart`: added a banner theme for `MaterialBanner`
Copy link
Member

@VaiTon VaiTon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Some minors comments left but nothing blocking for me!

@monsieurtanuki monsieurtanuki merged commit 8599d10 into openfoodfacts:develop Aug 3, 2022
@monsieurtanuki
Copy link
Contributor Author

Thank you @VaiTon for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants