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: 5855 - no visible product type filter by default #5878

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now the servers provide product field "product_type", and we do retrieve that value.
  • We overwrite this product field with the value inherent to the server, but only if it is null on the product side, for some reason or for "old" products.
  • There's a switch in order to hide the "product type" text search filter (hidden by default).
  • No change for the barcode search: we try to find that barcode on all 4 servers.

Screenshots

switch off (default) switch on
Screenshot_1731940664 Screenshot_1731941946
Screenshot_1731941901 Screenshot_1731941961
Screenshot_1731941932 Screenshot_1731941973

Fixes bug(s)

Impacted files

  • background_task_price.dart: minor unrelated fix due to off-dart 3.17.0
  • dao_product.dart: we overwrite the products product_type with the server product type only if null
  • product_query.dart: now retrieving product_type field in products found on a server
  • product_refresher.dart: unrelated minor refactoring
  • pubspec.lock: wtf
  • pubspec.yaml: upgraded off-dart to 3.17.0
  • search_product_helper.dart: visible/invisible product type filter, by default invisible and working on food
  • user_preferences_dev_mode.dart: on/off switch for visible product type filter, off by default

Impacted files:
* `background_task_price.dart`: minor unrelated fix due to off-dart 3.17.0
* `dao_product.dart`: we overwrite the products product_type with the server product type only if null
* `product_query.dart`: now retrieving product_type field in products found on a server
* `product_refresher.dart`: unrelated minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart to 3.17.0
* `search_product_helper.dart`: visible/invisible product type filter, by default invisible and working on food
* `user_preferences_dev_mode.dart`: on/off switch for visible product type filter, off by default
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2024

Codecov Report

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

Project coverage is 6.74%. Comparing base (4d9c7fc) to head (cf55dc5).
Report is 485 commits behind head on develop.

Files with missing lines Patch % Lines
...b/pages/preferences/user_preferences_settings.dart 0.00% 7 Missing ⚠️
.../lib/data_models/preferences/user_preferences.dart 0.00% 5 Missing ⚠️
...th_app/lib/pages/search/search_product_helper.dart 0.00% 5 Missing ⚠️
packages/smooth_app/lib/database/dao_product.dart 0.00% 1 Missing ⚠️
...pp/lib/pages/product/common/product_refresher.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5878      +/-   ##
==========================================
- Coverage     9.54%   6.74%   -2.81%     
==========================================
  Files          325     433     +108     
  Lines        16411   23984    +7573     
==========================================
+ Hits          1567    1617      +50     
- Misses       14844   22367    +7523     

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


🚨 Try these New Features:

@g123k
Copy link
Collaborator

g123k commented Nov 18, 2024

Generally speaking, seems OK.

However, we don't want the settings in the DEV mode, but directly in the App Settings, in the Products section (sorry, I wasn't specific enough).
Also, I would maybe change the setting to enable it (not the other way around)

@monsieurtanuki
Copy link
Contributor Author

Generally speaking, seems OK.

However, we don't want the settings in the DEV mode, but directly in the App Settings, in the Products section (sorry, I wasn't specific enough). Also, I would maybe change the setting to enable it (not the other way around)

Understood, but I'm currently visiting family in Italy and I won't be able to change anything before Friday.

@g123k
Copy link
Collaborator

g123k commented Nov 18, 2024

Generally speaking, seems OK.
However, we don't want the settings in the DEV mode, but directly in the App Settings, in the Products section (sorry, I wasn't specific enough). Also, I would maybe change the setting to enable it (not the other way around)

Understood, but I'm currently visiting family in Italy and I won't be able to change anything before Friday.

Ok, no pb, I will change it directly in your PR.
Enjoy your time in Italy 🤌 !

@g123k
Copy link
Collaborator

g123k commented Nov 18, 2024

The filter is now in the App settings:
Screenshot 2024-11-19 at 00 20 18

@monsieurtanuki
Copy link
Contributor Author

The filter is now in the App settings

Good. I guess we're all set then.

@teolemon
Copy link
Member

Thanks @monsieurtanuki @g123k 📸🧴🐾

@monsieurtanuki monsieurtanuki merged commit 5a0ba55 into openfoodfacts:develop Nov 19, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @g123k @teolemon for your reviews, feedbacks and code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Hide the search env switcher by default
4 participants