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: 4058 - new UI for "add product" #4060

Merged
merged 3 commits into from
Jun 3, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • New UI for the "add product" page:
    • score titles and subtitles
    • no more blue background
    • score on one line
    • leading (1) and (2) icons
    • deactivated button when relevant
    • green background when relevant
  • TODO:
    • dark mode
    • localization
  • Outside of this PR:
    • facultative ecoscore fields

Screenshot

landing page categories set scrolled to ecoscore
Screenshot_2023-06-02-09-26-46 Screenshot_2023-06-02-09-27-14 Screenshot_2023-06-02-09-27-31
nutrition facts photo details
Screenshot_2023-06-02-09-28-02 Screenshot_2023-06-02-09-28-44 Screenshot_2023-06-02-09-29-05

Part of

Impacted files

  • add_new_product_page.dart: score titles and subtitles; no more blue background; score on one line; leading (1) and (2) icons; deactivated button
  • add_simple_input_button.dart: minor refactoring
  • edit_product_page.dart: minor refactoring
  • simple_input_page_helpers.dart: new method showEditPage from previous code
  • smooth_large_button_with_icon.dart: refactored with backgroundColor, foregroundColor and trailing parameters

TODO:
* dark mode
* localization
* facultative ecoscore fields

Impacted files:
* `add_new_product_page.dart`: score titles and subtitles; no more blue background; score on one line; leading (1) and (2) icons; deactivated button
* `add_simple_input_button.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `simple_input_page_helpers.dart`: new method `showEditPage` from previous code
* `smooth_large_button_with_icon.dart`: refactored with `backgroundColor`, `foregroundColor` and `trailing` parameters
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner June 2, 2023 07:51
@monsieurtanuki monsieurtanuki requested a review from teolemon June 2, 2023 07:51
@github-actions github-actions bot added Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page labels Jun 2, 2023
@teolemon
Copy link
Member

teolemon commented Jun 2, 2023

info • Use Flutter TODO format: // TODO(username): message, https://URL-to-issue • packages/smooth_app/lib/pages/product/add_new_product_page.dart:338:32 • flutter_style_todos
info • Use Flutter TODO format: // TODO(username): message, https://URL-to-issue • packages/smooth_app/lib/pages/product/add_new_product_page.dart:340:37 • flutter_style_todos

@monsieurtanuki
Copy link
Contributor Author

info • Use Flutter TODO format: // TODO(username): message, https://URL-to-issue

@teolemon Indeed. That's a typical case - dark mode to be implemented, or localizations.
I prefer it that way: first have a look at the light mode screenshots, tell me what should be changed. Then once the light mode is somehow approved, I can code the final changes: dark mode and localizations. Which are easy to locate as they are the only dart analysis warnings. Instead of "legal" TODOs.

@teolemon
Copy link
Member

teolemon commented Jun 3, 2023

was just pasting the build failure.

Impacted files:
* `add_new_product_page.dart`: dark mode; images first; titles and subtitles for nutriscore and ecoscore
* `app_en.arb`: titles and subtitles for nutriscore and ecoscore
* `app_fr.arb`: titles and subtitles for nutriscore and ecoscore
@codecov-commenter
Copy link

Codecov Report

Merging #4060 (1ef5b86) into develop (6cd6933) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #4060      +/-   ##
===========================================
- Coverage    10.96%   10.94%   -0.02%     
===========================================
  Files          270      270              
  Lines        13415    13434      +19     
===========================================
  Hits          1471     1471              
- Misses       11944    11963      +19     
Impacted Files Coverage Δ
...ric_lib/buttons/smooth_large_button_with_icon.dart 0.00% <0.00%> (ø)
...th_app/lib/pages/product/add_new_product_page.dart 0.00% <0.00%> (ø)
...app/lib/pages/product/add_simple_input_button.dart 0.00% <0.00%> (ø)
...mooth_app/lib/pages/product/edit_product_page.dart 0.46% <0.00%> (+0.01%) ⬆️
...p/lib/pages/product/simple_input_page_helpers.dart 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@monsieurtanuki
Copy link
Contributor Author

Latest commit:

  • dark mode
  • images first
  • titles and subtitles for nutriscore and ecoscore

New product:

light dark
Screenshot_2023-06-03-13-46-08 Screenshot_2023-06-03-13-47-35
Screenshot_2023-06-03-13-46-14 Screenshot_2023-06-03-13-47-42
Screenshot_2023-06-03-13-46-20 Screenshot_2023-06-03-13-47-49
Screenshot_2023-06-03-13-46-25 Screenshot_2023-06-03-13-47-54

Regarding the "unknown" / "not applicable" score icons, for the moment I kept the so called ugly icons, for consistency reasons.
Assuming that the "unknown" icons are ugly, that would mean that we should probably never show them and always show the "not applicable" version instead.
That means that:

  • that should apply to the "new product" dialog too
  • we should override the icon provided by the product (if "unknown" then "not-applicable") - because as soon as a product field is populated, the score and the icon are computed (and will be the "unknown" version)
  • should that extend to the rest of the app?

Following are screenshots with the "not applicable" icons:
New product dialog, nutriscore and ecoscore "not applicable":

light dark
Screenshot_2023-06-03-13-49-50 Screenshot_2023-06-03-13-49-10

New product page, nutriscore "not applicable":

light dark
Screenshot_2023-06-03-13-49-59 Screenshot_2023-06-03-13-49-19

New product page, ecoscore "not applicable":

light dark
Screenshot_2023-06-03-13-50-03 Screenshot_2023-06-03-13-49-22

@teolemon Waiting for your instructions about the "unknown" / "not applicable" icons for the "new product".

@teolemon
Copy link
Member

teolemon commented Jun 3, 2023

This will break consistency with server, so let's keep as is, I guess

@monsieurtanuki
Copy link
Contributor Author

This will break consistency with server, so let's keep as is, I guess

@teolemon Feel free to approve then. The "additional ecoscore" edits will be in another PR.

@monsieurtanuki monsieurtanuki merged commit fa570d4 into openfoodfacts:develop Jun 3, 2023
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 l10n Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants