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: #1060 - new dev mode lenient/strong matching switch #1133

Merged
merged 5 commits into from
Feb 13, 2022

Conversation

monsieurtanuki
Copy link
Contributor

"lenient" means @jasmeet0817's version, "strong" means @monsieurtanuki's.
Why? Because for @jasmeet0817 it's impossible to be an "unknown" match.
For @monsieurtanuki with at least one unknown attribute, you're at best "unknown".

New file:

  • smooth_matched_product.dart: replacing off-dart's "MatchedProduct"

Impacted files:

  • personalized_ranking_page.dart: added the UserPreferences parameter for dev mode lenient/strong matching switch; not using off's matched_product.dart anymore
  • product_compatibility_helper.dart: not using off's matched_product.dart anymore
  • smooth_it_model.dart: added the UserPreferences parameter for dev mode lenient/strong matching switch; not using off's matched_product.dart anymore
  • smooth_product_card_found.dart: added the UserPreferences parameter for dev mode lenient/strong matching switch; not using off's matched_product.dart anymore
  • summary_card.dart: added the UserPreferences parameter for dev mode lenient/strong matching switch; not using off's matched_product.dart anymore
  • user_preferences_dev_mode.dart: added a "lenient/strong" matching switch (aka "Swiss switch")

"lenient" means @jasmeet0817's version, "strong" means @monsieurtanuki's.
Why? Because for @jasmeet0817 it's impossible to be an "unknown" match.
For @monsieurtanuki with at least one unknown attribute, you're at best "unknown".

New file:
* `smooth_matched_product.dart`: replacing off-dart's "MatchedProduct"

Impacted files:
* `personalized_ranking_page.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `product_compatibility_helper.dart`: not using off's `matched_product.dart` anymore
* `smooth_it_model.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `smooth_product_card_found.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `summary_card.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `user_preferences_dev_mode.dart`: added a "lenient/strong" matching switch (aka "Swiss switch")
"lenient" means @jasmeet0817's version, "strong" means @monsieurtanuki's.
Why? Because for @jasmeet0817 it's impossible to be an "unknown" match.
For @monsieurtanuki with at least one unknown attribute, you're at best "unknown".

New file:
* `smooth_matched_product.dart`: replacing off-dart's "MatchedProduct"

Impacted files:
* `personalized_ranking_page.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `product_compatibility_helper.dart`: not using off's `matched_product.dart` anymore
* `smooth_it_model.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `smooth_product_card_found.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `summary_card.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `user_preferences_dev_mode.dart`: added a "lenient/strong" matching switch (aka "Swiss switch")
"lenient" means @jasmeet0817's version, "strong" means @monsieurtanuki's.
Why? Because for @jasmeet0817 it's impossible to be an "unknown" match.
For @monsieurtanuki with at least one unknown attribute, you're at best "unknown".

New file:
* `smooth_matched_product.dart`: replacing off-dart's "MatchedProduct"

Impacted files:
* `personalized_ranking_page.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `product_compatibility_helper.dart`: not using off's `matched_product.dart` anymore
* `smooth_it_model.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `smooth_product_card_found.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `summary_card.dart`: added the `UserPreferences` parameter for dev mode lenient/strong matching switch; not using off's `matched_product.dart` anymore
* `user_preferences_dev_mode.dart`: added a "lenient/strong" matching switch (aka "Swiss switch")
@monsieurtanuki monsieurtanuki marked this pull request as ready for review February 12, 2022 14:27
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner February 12, 2022 14:27
@monsieurtanuki
Copy link
Contributor Author

I've finally managed to create a proper PR.
With that PR we have more flexibility regarding product ranking algorithm, starting from 2 historical algorithms: @monsieurtanuki (that's me) and @jasmeet0817.
Regardless of which one is better, I think that the key point is to induce the end-user into improving the data when the status is unknown. But that's another story.

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Code looks good nice that we can try both

PreferenceImportance.ID_NOT_IMPORTANT: 0,
};

/// Lenient version (monsieurtanuki) (found back in #1046)
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't it from jasmeet

@monsieurtanuki
Copy link
Contributor Author

Thank you @M123-dev for your code review! I've changed the comment you mentioned.

@monsieurtanuki monsieurtanuki merged commit af2e5c9 into openfoodfacts:develop Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants