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: #2169 - new simple input page for "Stores" #2195

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

monsieurtanuki
Copy link
Contributor

New files:

  • simple_input_page.dart: Simple input page: we have a list of labels, we add, we remove, we save.
  • simple_input_page_helpers.dart: Helpers for Simple Input Page.

Impacted files:

  • category_picker_page.dart: refactored
  • edit_ingredients_page.dart: refactored
  • edit_product_page.dart: added an "edit store" button; refactored
  • nutrition_page_loaded.dart: refactored
  • product_query.dart: added field for stores
  • product_refresher.dart: now we return the saved and refreshed product instead of a mere bool

What

  • This is the first implementation of the new "simple input page".
  • In that kind of page, we retrieve a list of labels from the product (in this case, the stores).
  • Labels can be added and removed.
  • When the end-user Bob exits the page, Bob is being asked to save (or not) the data to the back-end and local database.
  • I'm glad to say that it works(I had doubt about just adding "Monoprix").
  • Special message for @teolemon (I know you won't like that) - stores were not part of the data we retrieved from the server. As the refresh is not automatic, you have to refresh manually the products (or start from an empty list of stores).

Screenshot

Added a "Stores" button in the detailed edit page:
Capture d’écran 2022-06-06 à 20 30 28

landing page adding... added
Capture d’écran 2022-06-06 à 20 30 58 Capture d’écran 2022-06-06 à 20 31 16 Capture d’écran 2022-06-06 à 20 31 37

Exiting the page after changes:
Capture d’écran 2022-06-06 à 20 32 07

Part of

New files:
* `simple_input_page.dart`: Simple input page: we have a list of labels, we add, we remove, we save.
* `simple_input_page_helpers.dart`: Helpers for Simple Input Page.

Impacted files:
* `category_picker_page.dart`: refactored
* `edit_ingredients_page.dart`: refactored
* `edit_product_page.dart`: added an "edit store" button; refactored
* `nutrition_page_loaded.dart`: refactored
* `product_query.dart`: added fields for stores
* `product_refresher.dart`: now we return the saved and refreshed product instead of a mere bool
@codecov-commenter
Copy link

Codecov Report

Merging #2195 (eef8b51) into develop (2ea0da3) will decrease coverage by 0.99%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           develop   #2195      +/-   ##
==========================================
- Coverage     8.86%   7.86%   -1.00%     
==========================================
  Files          161     180      +19     
  Lines         6623    8837    +2214     
==========================================
+ Hits           587     695     +108     
- Misses        6036    8142    +2106     
Impacted Files Coverage Δ
...kages/smooth_app/lib/widgets/attribute_button.dart 0.00% <0.00%> (-92.00%) ⬇️
packages/smooth_app/lib/themes/smooth_theme.dart 54.54% <0.00%> (-28.44%) ⬇️
...s/smooth_app/lib/data_models/user_preferences.dart 10.46% <0.00%> (-21.85%) ⬇️
...p/lib/generic_lib/dialogs/smooth_alert_dialog.dart 19.23% <0.00%> (-14.98%) ⬇️
...mooth_app/lib/data_models/product_preferences.dart 26.47% <0.00%> (-4.96%) ⬇️
.../smooth_app/lib/pages/onboarding/welcome_page.dart 0.00% <0.00%> (-3.13%) ⬇️
.../smooth_app/lib/pages/onboarding/scan_example.dart 0.00% <0.00%> (-2.28%) ⬇️
packages/smooth_app/lib/main.dart 15.74% <0.00%> (-2.16%) ⬇️
...s/smooth_app/lib/pages/onboarding/next_button.dart 2.22% <0.00%> (-1.78%) ⬇️
...p/lib/pages/onboarding/consent_analytics_page.dart 0.00% <0.00%> (-1.57%) ⬇️
... and 166 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae54d77...eef8b51. Read the comment docs.

@teolemon
Copy link
Member

teolemon commented Jun 6, 2022

That's really great @monsieurtanuki 👍 🎊
I will cope with the refreshing, I believe ;-)
Labels have a meaning of their own in OFF, so I would rename it to tags ?
https://world.openfoodfacts.org/label/organic

@teolemon
Copy link
Member

teolemon commented Jun 6, 2022

The very strong next candidates are labels since they are paramount for Eco-Score

@teolemon teolemon added ✏️ Contribution ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users labels Jun 6, 2022
@teolemon teolemon added this to the V1 milestone Jun 6, 2022
@monsieurtanuki
Copy link
Contributor Author

@teolemon Labels and tags both already have a meaning in off-dart. "terms" instead of "labels"?

About "your" labels, isn't there a limited list of labels we could play with instead of typing them (which made sense for stores). I remember 2 different things:

  • some endless list of random "terms" like "Médaille d'or Concours 2020 de la Tripe"
  • a very restricted list of icons cf. Eco-Score labels input #524

Which list should we implement?

@teolemon
Copy link
Member

teolemon commented Jun 6, 2022

One of the Open Food Facts principles is that we taxonomize based on popularity. Free-form input is a way to learn about new interesting labels we don't know about (like "Médaille d'or Concours 2020 de la Tripe") and if they are popular enough, add them in taxonomies. So #524 is not the way to go for this implementation, but might be for a future very optimized Eco-Score pipeline.

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @monsieurtanuki

@teolemon
Copy link
Member

teolemon commented Jun 7, 2022

It will reset for products with no nutrition facts, but so will nutrition input @monsieurtanuki

@teolemon teolemon merged commit efe7f8d into openfoodfacts:develop Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Contribution ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users
Development

Successfully merging this pull request may close these issues.

4 participants