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

New knowledge panels properties: half size panel + very short title and description #9368

Closed
Tracked by #4842
stephanegigandet opened this issue Nov 22, 2023 · 5 comments · Fixed by #9683
Closed
Tracked by #4842
Labels
🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 🤳🥫 mobile apps 🎯 P1

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Nov 22, 2023

On mobile (app + web) we want to show some panels in a more condensed way, 2 by 2:

image

We need to define new properties for specifying that the panel should be shown half size on mobile, and add very short titles and descriptions.

Part of

@monsieurtanuki
Copy link
Contributor

@stephanegigandet @alexgarel Data that is currently missing from the server side that I've noticed in openfoodfacts/smooth-app#4890 (about the Nutriscore panel only):

  • The localized short title, e.g. "Sugars" (for the moment we have something like "Sugars in big quantity") (already mentioned in the OP)
  • The localized grade, e.g. "Poor" (for the moment we have something like "Poor nutritional value") (somehow already mentioned in the OP)

Besides, assuming that the percentage is the percentage of nutrient quantity in grams:

  • We would need the value as a double
  • Meanwhile I've managed to compute the value from the product nutrition facts
  • Currently the decimal separator is not localized (e.g. for "Sucre : 1.2%" and not "Sucre : 1,2%") (current bug en passant, we won't care anyway if we have the double field)
  • It's a bit confusing to see for each nutrient the percentage and colors that don't match (e.g. Fat 16% is orange and Saturated fat 11% is red)
  • a11y sucks in the screenshots, because only the colors show the importance, which is not user-friendly for color-blinds

@john-gom john-gom self-assigned this Jan 15, 2024
@john-gom
Copy link
Contributor

I've started looking into this (also referring to openfoodfacts/smooth-app#4889). Initial observations:

There seem to be three pieces of information that need to be conveyed:

  1. Short name of the attribute, e.g. "Saturated fat", "Packaging", etc.
  2. Value for that attribute, e.g. "11%", "High impact"
  3. Indication of whether the value is good, bad or average (in order to colour the text)

For the name of the attribute, this should already exist and be consistent with the name used when users are selecting their food preferences.

For the value of the attribute I'm not sure a double is going to work for attributes like Packaging and Species threat, so it may be we need to keep this as text (and fix the decimal separator on the server side).

It looks like the existing undocumented "evaluation" property could be used to indicate good / bad.

@john-gom
Copy link
Contributor

Update. We already have a "type" to indicate grade, so expanding this to include "percentage" allows the value to be supplied as a raw number, so regional formatting can be done on the client

@teolemon teolemon added 🎯 P1 🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps labels Aug 14, 2024
@teolemon
Copy link
Member

teolemon commented Aug 14, 2024

  • Per @g123k , add an optional parameter to ask for the summarized/condensed version of the Knowledge Panel.
  • format=condensed

Scope:

  • nutrient_levels
  • ecoscore panel

@alexgarel
Copy link
Member

@teolemon as we have the include / exclude knowledge panels parameters, I would better add a condensed_knowledge_panels=panel1,panel2 etc. which means include the knowledge panel, in condensed form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 🤳🥫 mobile apps 🎯 P1
Development

Successfully merging a pull request may close this issue.

5 participants