Skip to content

fix: 6784 - readyForPriceTagValidation true only for priceTag and bulk #6794

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

monsieurtanuki
Copy link
Contributor

What

  • As we upload price proofs, we now set readyForPriceTagValidation to true if-and-only-if it's both a price tag and a bulk upload.
  • Additional warning about AI and image validation.

Screenshot

Screenshot_1753113254

Fixes bug(s)

Impacted files

  • background_task_add_price.dart: added field and parameter bool bulkProofUpload; set readyForPriceTagValidation as "priceTag and bulk"
  • price_bulk_proof_card.dart: added warning about AI and image validation
  • price_model.dart: added field bool bulkProofUpload
  • proof_bulk_add_page.dart: added parameter bulkProofUpload: true

Impacted files:
* `background_task_add_price.dart`: added field and parameter `bool bulkProofUpload`; set `readyForPriceTagValidation` as "priceTag and bulk"
* `price_bulk_proof_card.dart`: added warning about AI and image validation
* `price_model.dart`: added field `bool bulkProofUpload`
* `proof_bulk_add_page.dart`: added parameter `bulkProofUpload: true`
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2025

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 5.35%. Comparing base (4d9c7fc) to head (7af968b).
⚠️ Report is 975 commits behind head on develop.

Files with missing lines Patch % Lines
...th_app/lib/pages/prices/price_bulk_proof_card.dart 0.00% 7 Missing ⚠️
...kages/smooth_app/lib/pages/prices/price_model.dart 0.00% 6 Missing ⚠️
.../lib/data_models/preferences/user_preferences.dart 0.00% 4 Missing ⚠️
..._app/lib/background/background_task_add_price.dart 0.00% 3 Missing ⚠️
...ooth_app/lib/pages/prices/proof_bulk_add_page.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6794       +/-   ##
============================================
- Coverage     9.54%    5.35%    -4.19%     
============================================
  Files          325      648      +323     
  Lines        16411   218822   +202411     
============================================
+ Hits          1567    11728    +10161     
- Misses       14844   207094   +192250     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raphael0202
Copy link
Collaborator

I don't understand the first warning message, does it mean that we can't delete selected images before the upload? Why is that?

And I think we should allow the user to opt-out of the community validation. On the web version, we have a toggle for this:
Capture d’écran du 2025-07-22 10-02-22

poke @raphodn for your opinion on the matter

@monsieurtanuki
Copy link
Contributor Author

I don't understand the first warning message, does it mean that we can't delete selected images before the upload?

That's correct. The user does select images from the gallery. And then the images are sent to the server.

And I think we should allow the user to opt-out of the community validation. On the web version, we have a toggle for this

It doesn't look like a parameter in https://prices.openfoodfacts.org/api/docs#/proofs/proofs_upload_create

@raphael0202
Copy link
Collaborator

It doesn't look like a parameter in https://prices.openfoodfacts.org/api/docs#/proofs/proofs_upload_create

Well this is the idea behind ready_for_price_tag_validation: control whether the price tag is displayed in the validation page. Currently, if this parameter is set to true, it is displayed on the validation page for all users (not only the user who submitted the proof).

Instead of forcing ready_for_price_tag_validation=true, we can add a toggle to keep the user in control.

@monsieurtanuki
Copy link
Contributor Author

Well this is the idea behind ready_for_price_tag_validation: control whether the price tag is displayed in the validation page. Currently, if this parameter is set to true, it is displayed on the validation page for all users (not only the user who submitted the proof).
Instead of forcing ready_for_price_tag_validation=true, we can add a toggle to keep the user in control.

Oh, understood, but that wasn't specified that way in the issue.

So, let's clarify things:

  1. ready_for_price_tag_validation may be true only for bulk proof uploads
  2. (only) in the bulk proof upload page, there must be a toggle that lets the user select if it's OK (ready_for_price_tag_validation: true) to let AI or other users analyze the image/set the price

@raphael0202 Is that correct?

@monsieurtanuki
Copy link
Contributor Author

@raphael0202 Just checking: AI will always process the images, but the community will only if ready_for_price_tag_validation: true. Is that so?

@raphael0202
Copy link
Collaborator

Just checking: AI will always process the images, but the community will only if ready_for_price_tag_validation: true. Is that so?

Yes indeed, AI will always process the image, but it will only be available for validation (for both the uploader and the community) if ready_for_price_tag_validation: true.

Impacted files:
* `background_task_add_price.dart`: replaced parameter bulkProofUpload with readyForPriceTagValidation
* `price_bulk_proof_card.dart`: added a switch to change the value of readyForPriceTagValidation
* `price_model.dart`: readyForPriceTagValidation with getter and setter
* `proof_bulk_add_page.dart`: start with the default user value for readyForPriceTagValidation
* `user_preferences.dart`: storing the default user value for readyForPriceTagValidation
@monsieurtanuki
Copy link
Contributor Author

@raphael0202 I've just taken into account your latest comment.
Screenshot_1753261955

@teolemon
Copy link
Member

@monsieurtanuki @raphael0202 is on holidays for the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Status: 💬 To discuss and validate
Development

Successfully merging this pull request may close these issues.

Prices: set readyForPriceTagValidation to true only for bulk proof upload
4 participants