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: improved price product selection #5564

Conversation

monsieurtanuki
Copy link
Contributor

What

  • The product selection for prices was a bit confusing.
  • The current PR found inspiration in the web app, with 2 buttons - barcode type and scan.
  • In both cases, local and server searches are automatically performed.
  • This was a good opportunity to improve the use of Provider for those pages, which was not superfluous.

Screenshot

price page barcode input dialog
Screenshot_1725001673 Screenshot_1725001690

Files

Deleted file:

  • price_product_search_page.dart

New file:

  • price_add_product_card.dart: Card where the user can input a price product: type the barcode or scan.

Impacted files:

  • price_amount_card.dart: removed the "no product" option; refactored Provider and Controllers
  • price_amount_model.dart: minor refactoring
  • price_meta_product.dart: removed the "no product" option; async load of data (local+server)
  • price_model.dart: minor refactoring
  • product_price_add_page.dart: refactored Provider; now using new widget PriceAddProductCard
  • user_preferences_account.dart: minor refactoring

Deleted files:
* `price_product_search_page.dart`

New file:
* `price_add_product_card.dart`: Card where the user can input a price product: type the barcode or scan.

Impacted files:
* `price_amount_card.dart`: removed the "no product" option; refactored Provider and Controllers
* `price_amount_model.dart`: minor refactoring
* `price_meta_product.dart`: removed the "no product" option; async load of data (local+server)
* `price_model.dart`: minor refactoring
* `product_price_add_page.dart`: refactored Provider; now using new widget `PriceAddProductCard`
* `user_preferences_account.dart`: minor refactoring
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 0.59524% with 167 lines in your changes missing coverage. Please review.

Project coverage is 6.95%. Comparing base (4d9c7fc) to head (8a8f462).
Report is 301 commits behind head on develop.

Files with missing lines Patch % Lines
...h_app/lib/pages/prices/price_add_product_card.dart 1.40% 70 Missing ⚠️
...h_app/lib/pages/prices/product_price_add_page.dart 0.00% 43 Missing ⚠️
...smooth_app/lib/pages/prices/price_amount_card.dart 0.00% 26 Missing ⚠️
...mooth_app/lib/pages/prices/price_meta_product.dart 0.00% 18 Missing ⚠️
...s/smooth_app/lib/pages/prices/price_scan_page.dart 0.00% 4 Missing ⚠️
...mooth_app/lib/pages/prices/price_amount_model.dart 0.00% 3 Missing ⚠️
...kages/smooth_app/lib/pages/prices/price_model.dart 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5564      +/-   ##
==========================================
- Coverage     9.54%   6.95%   -2.60%     
==========================================
  Files          325     400      +75     
  Lines        16411   21169    +4758     
==========================================
- Hits          1567    1473      -94     
- Misses       14844   19696    +4852     

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

@monsieurtanuki monsieurtanuki marked this pull request as draft August 30, 2024 07:20
@monsieurtanuki
Copy link
Contributor Author

@teolemon @raphael0202 Only some tests to be performed live, and we're good!

@monsieurtanuki monsieurtanuki marked this pull request as ready for review August 30, 2024 08:03
@teolemon teolemon added the ✨ enhancement New feature or request label Sep 2, 2024
Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

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

Thanks, let's keep iterating on prices 👍
I'm obsessed with Open Products Facts at the moment.

@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!
I've recently detected a bug in this PR, I'll fix it in a couple of days before merging.

Impacted files:
* `app_en.arb`: minor changes
* `app_fr.arb`: minor changes
* `price_add_product_card.dart`: checked duplicate barcodes
* `pubspec.lock`: wtf
* `pubspec.yaml`: new off-dart version - 3.14
@monsieurtanuki
Copy link
Contributor Author

In the latest push:

  • fixed a "duplicate barcode" error
  • minor label changes
  • upgraded to off-dart 3.14, that supports the latest Prices API (including the fix about top contributor list).

Still need to go on errands in order to double-check the Prices IRL.

new label for "text input" duplicate barcode check
Screenshot_1725790881 Screenshot_1725790909

Impacted files:
* `price_add_product_card.dart`: populated the previously scanned barcode
* `price_scan_page.dart`: checked if barcode was just previously scanned; added back button
@monsieurtanuki monsieurtanuki merged commit 45b8b33 into openfoodfacts:develop Sep 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants