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: prices - barcode reader for additional products #5381

Merged

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now we can scan a barcode when adding a product to prices.

Screenshots

barcode search: new button new barcode reader page
Screenshot_20240615_153933 Screenshot_20240615_154251
product found product added
Screenshot_20240615_154013 Screenshot_20240615_154024

Files

New file:

  • price_scan_page.dart: Page showing the camera feed and decoding the first barcode, for Prices.

Impacted files:

  • app_en.arb: added 1 "barcode reader" label
  • app_fr.arb: added 1 "barcode reader" label
  • camera_scan_page.dart: minor refactoring
  • price_product_search_page.dart: added a FAB towards the new barcode reader page

New file:
* `price_scan_page.dart`: Page showing the camera feed and decoding the first barcode, for Prices.

Impacted files:
* `app_en.arb`: added 1 "barcode reader" label
* `app_fr.arb`: added 1 "barcode reader" label
* `camera_scan_page.dart`: minor refactoring
* `price_product_search_page.dart`: added a FAB towards the new barcode reader page
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner June 15, 2024 13:51
@github-actions github-actions bot added the 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… label Jun 15, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2024

Codecov Report

Attention: Patch coverage is 1.78571% with 55 lines in your changes missing coverage. Please review.

Project coverage is 7.37%. Comparing base (4d9c7fc) to head (5c05c38).
Report is 191 commits behind head on develop.

Files Patch % Lines
...pp/lib/pages/prices/price_product_search_page.dart 0.00% 32 Missing ⚠️
...s/smooth_app/lib/pages/prices/price_scan_page.dart 5.88% 16 Missing ⚠️
...es/smooth_app/lib/pages/scan/camera_scan_page.dart 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5381      +/-   ##
==========================================
- Coverage     9.54%   7.37%   -2.18%     
==========================================
  Files          325     385      +60     
  Lines        16411   19667    +3256     
==========================================
- Hits          1567    1450     -117     
- Misses       14844   18217    +3373     

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

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.

When I tried the initial support yesterday, I tried to click on the little barcode. Will it work ? Not sure a bottom right fab will be the most intuitive

@monsieurtanuki
Copy link
Contributor Author

When I tried the initial support yesterday, I tried to click on the little barcode. Will it work ? Not sure a bottom right fab will be the most intuitive

The point of the little barcode is to say that it's a barcode input, not a text input.
For the record, according to Material specs, "A floating action button (FAB) performs the primary, or most common, action on a screen.", which seems appropriate to me in this case.
Would you prefer no FAB, an icon button and then the text field without image (on the same row)?

@teolemon
Copy link
Member

I would have also made the little barcode clickable but I can survive.

@monsieurtanuki monsieurtanuki merged commit 35a4ab0 into openfoodfacts:develop Jun 15, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review and feedbacks!

Anyway now that the barcode reader feature is there, we may change the UI/UX when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Development

Successfully merging this pull request may close these issues.

3 participants