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: 5586 - OxF filter for term searches #5637

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now for term searches, there is an OxF "radio button": the search will be run on the specific server.
  • Pending questions
    • for the user page ("products you edited") and contribute button ("contribute by completing products"), for the moment we consider only the food products, does that make sense? (impact on user_preferences_account.dart, user_preferences_contribute.dart)
    • Maybe reinit default product type (food) with latest value for the filter (impact on search_product_helper.dart)
    • Matomo: shouldn't we send the product type to Matomo? (impact at least on product_query.dart)
    • I believe it's very optimistic to display 4 labels in the filter - what about icons and hints? (impact on product_query.dart)

Screenshots

food beauty
Screenshot_1727459262 Screenshot_1727459267
pet food products
Screenshot_1727459271 Screenshot_1727459274

Part of

Impacted files

  • category_product_query.dart: refactored with new productType parameter
  • keywords_product_query.dart: refactored with new productType parameter
  • paged_product_query.dart: refactored with new productType parameter
  • paged_search_product_query.dart: refactored with new productType parameter
  • paged_to_be_completed_product_query.dart: refactored with new productType parameter
  • paged_user_product_query.dart: refactored with new productType parameter
  • product_list.dart: refactored with new productType parameter
  • product_query.dart: added a "get label" method for ProductType
  • search_field.dart: displayed the new optional "additional filter" (e.g. OxF)
  • search_helper.dart: added a new optional "additional filter"
  • search_product_helper.dart: new "product type filter" widget
  • summary_card.dart: minor "productType" fix
  • user_preferences_account.dart: added "productType.food" to user page counts
  • user_preferences_contribute.dart: added "productType.food" to "to be completed" products

Impacted files:
* `category_product_query.dart`: refactored with new `productType` parameter
* `keywords_product_query.dart`: refactored with new `productType` parameter
* `paged_product_query.dart`: refactored with new `productType` parameter
* `paged_search_product_query.dart`: refactored with new `productType` parameter
* `paged_to_be_completed_product_query.dart`: refactored with new `productType` parameter
* `paged_user_product_query.dart`: refactored with new `productType` parameter
* `product_list.dart`: refactored with new `productType` parameter
* `product_query.dart`: added a "get label" method for `ProductType`
* `search_field.dart`: displayed the new optional "additional filter" (e.g. OxF)
* `search_helper.dart`: added a new optional "additional filter"
* `search_product_helper.dart`: new "product type filter" widget
* `summary_card.dart`: minor "productType" fix
* `user_preferences_account.dart`: added "productType.food" to user page counts
* `user_preferences_contribute.dart`: added "productType.food" to "to be completed" products
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 66 lines in your changes missing coverage. Please review.

Project coverage is 6.88%. Comparing base (4d9c7fc) to head (0cdaa73).
Report is 334 commits behind head on develop.

Files with missing lines Patch % Lines
...th_app/lib/pages/search/search_product_helper.dart 0.00% 18 Missing ⚠️
...ages/smooth_app/lib/pages/search/search_field.dart 0.00% 12 Missing ⚠️
...s/smooth_app/lib/query/category_product_query.dart 0.00% 7 Missing ⚠️
...s/smooth_app/lib/query/keywords_product_query.dart 0.00% 7 Missing ⚠️
...lib/query/paged_to_be_completed_product_query.dart 0.00% 6 Missing ⚠️
...smooth_app/lib/query/paged_user_product_query.dart 0.00% 5 Missing ⚠️
...kages/smooth_app/lib/data_models/product_list.dart 0.00% 2 Missing ⚠️
...ges/smooth_app/lib/pages/product/summary_card.dart 0.00% 2 Missing ⚠️
...ages/smooth_app/lib/query/paged_product_query.dart 0.00% 2 Missing ⚠️
...ib/pages/preferences/user_preferences_account.dart 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5637      +/-   ##
==========================================
- Coverage     9.54%   6.88%   -2.67%     
==========================================
  Files          325     402      +77     
  Lines        16411   21307    +4896     
==========================================
- Hits          1567    1466     -101     
- Misses       14844   19841    +4997     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teolemon teolemon added 🧴 Open Beauty Facts Please see this proposal: https://github.com/openfoodfacts/smooth-app/discussions/1378 🔎 Search 📸 Open Products Facts 🐾 Open Pet Food Facts labels Sep 27, 2024
@teolemon
Copy link
Member

Agree with the first 3 points, on 4th, I'd like to try text first. You could have chips instead of a big pill so that we can overflow on very small screens.

@monsieurtanuki monsieurtanuki merged commit 077bf5e into openfoodfacts:develop Sep 27, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

I'm about to transform somehow the pending questions into issues.

Please keep in mind that we still cannot edit non-food products - that would probably create food products from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧴 Open Beauty Facts Please see this proposal: https://github.com/openfoodfacts/smooth-app/discussions/1378 🐾 Open Pet Food Facts 📸 Open Products Facts 🥫 Product page 🔎 Search summary card
Projects
Status: Done
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants