openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
GNU Affero General Public License v3.0
633 stars 371 forks source link

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

Open stephanegigandet opened 9 months ago

stephanegigandet commented 9 months ago

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 commented 9 months ago

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

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

john-gom commented 8 months ago

I've started looking into this (also referring to https://github.com/openfoodfacts/smooth-app/issues/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 commented 7 months ago

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 commented 1 month ago

Scope:

alexgarel commented 1 week ago

@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.