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: 3749 - improvements for packaging suggestions #3750

Merged
merged 7 commits into from
Feb 28, 2023

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • edit_new_packagings.dart: added categories parameter for suggestions
  • edit_new_packagings_component.dart: added categories field; added categories parameters for shape search; added categories and shape parameters for material search; added specific minLengthForSuggestions parameter set to 0 for shape and material search
  • simple_input_text_field.dart: added minLengthForSuggestions, categories and shape fields; added categories, shape and country parameters for getSuggestions

What

  • Added country, categories and shape parameters for suggestions, which makes sense especially for material and shape.
  • Added a minimum length for suggestions, with a default of 1 (like before), and especially set to 0 for material and shape.
  • Could not test it unfortunately.

Fixes bug(s)

# Conflicts:
#	packages/smooth_app/pubspec.lock
#	packages/smooth_app/pubspec.yaml
Impacted files:
* `edit_new_packagings.dart`: added categories parameter for suggestions
* `edit_new_packagings_component.dart`: added categories field; added categories parameters for shape search; added categories and shape parameters for material search; added specific minLengthForSuggestions parameter set to 0 for shape and material search
* `simple_input_text_field.dart`: added minLengthForSuggestions, categories and shape fields; added categories, shape and country parameters for `getSuggestions`
@codecov-commenter
Copy link

Codecov Report

Merging #3750 (d3bd95b) into develop (c281395) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #3750      +/-   ##
===========================================
- Coverage    10.41%   10.40%   -0.01%     
===========================================
  Files          272      272              
  Lines        13824    13835      +11     
===========================================
  Hits          1440     1440              
- Misses       12384    12395      +11     
Impacted Files Coverage Δ
...oth_app/lib/pages/product/edit_new_packagings.dart 0.00% <0.00%> (ø)
...b/pages/product/edit_new_packagings_component.dart 0.00% <0.00%> (ø)
...app/lib/pages/product/simple_input_text_field.dart 0.00% <0.00%> (ø)

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

@stephanegigandet
Copy link
Contributor

Thanks a lot @monsieurtanuki , this will speed up entry of packagings quite a bit!

thomas-algo added a commit to thomas-algo/smooth-app that referenced this pull request Feb 28, 2023
@monsieurtanuki as addressed the issue in openfoodfacts#3750 without disturbing old default behavior of the widget.
@monsieurtanuki
Copy link
Contributor Author

Thanks a lot @monsieurtanuki , this will speed up entry of packagings quite a bit!

@stephanegigandet Don't hesitate to create a new issue in order to make the entry of packagings even smoother.

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you

@monsieurtanuki monsieurtanuki merged commit 90a9bc5 into openfoodfacts:develop Feb 28, 2023
@monsieurtanuki
Copy link
Contributor Author

Thank you @stephanegigandet for the review!

monsieurtanuki added a commit that referenced this pull request Mar 2, 2023
… size of the autocomplete tab. (#3744)

* Updated the preview of the package in the 'Packaging components ' tab.

Preview is now clearer and more coherent with what is shown on the product page.

* Autocomplete now gives hints before anything is typed & maxOptionsHeight fixed

- The autocomplete now gives the most common answers for the field before user start typing. (Useful for packaging material, recycling...)

- Fixing _AssertionError 'maxOptionsHeight >= 0': is not true:
      The old formula could give negative values. It could also create an unreadable autocomplete if the field was too close to the keyboard.

* Removed Autocomplete now gives hints before anything is typed.

@monsieurtanuki as addressed the issue in #3750 without disturbing old default behavior of the widget.

* Comment explaining the limit of suggestions.

* Taking into account the case 'Material empty' and 'Weight not empty' & format

* Removing unused variables

This variables where previously used in the formula of maxOptionsHeight

* Update packages/smooth_app/lib/pages/product/edit_new_packagings_helper.dart

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Editing - Packaging input Related to the structured input of food packaging. 🥫 Product page
Projects
None yet
3 participants