openfoodfacts / openfoodfacts-hungergames-react Goto Github PK
View Code? Open in Web Editor NEWOne click categorizer for Open Food Facts
License: GNU Affero General Public License v3.0
One click categorizer for Open Food Facts
License: GNU Affero General Public License v3.0
Why n, k and o in "No(n)", "Not sure (k)" and "Yes (o)"?
Is it related to keyboard actions? (Selecting n or k or o does nothing indeed.)
"Not sure": I would add "skip": "Not sure, skip". The word "skip" explain next action if I'm not sure. I'm not afraid of selecting "Not sure, skip" because I understand it does nothing, it just skip the product.
What
On a desktop, It would be better to see the form next to the product information like that.
How
Use div
around the product description and the form (corresponding to the red rectangles)
On the parent element, you can use display: flex
. Thanks to a breakpoint you can switch between flex-direction: row
and flex-direction: column
(for more information on flex property: https://css-tricks.com/snippets/css/a-guide-to-flexbox/ )
Rationale
(Robotoff might be responsible but I open the ticket where I observ the problem.)
For that, you can use window.scrollTo(0,0)
(https://stackoverflow.com/questions/1144805/scroll-to-the-top-of-the-page-using-javascript)
I see two possibilities:
Values are not cleared after validation in the nutrition game.
I just successfully edited a product, and the values are still here for the next product.
Would it be possible to detect the language of an ingredient and product? An ingredient white list (the taxonomy) can be used for the detection. If the ingredient language does not match the ingredient list language, the new language can be added to the product. This new language can then be filled by the system, and removed from the other field. I noticed that there are many products that have the wrong language, so this would repair them. Hunger games can offer a way to confirm this.
Many times image size does not allow to answer the question: when hunger game ask to confirm a label for example.
Pictures should have the possibility to be zoomed.
Suggestion: use wheelzoom js. I use it for old manuscripts, it works very well.
https://github.com/jackmoore/wheelzoom
Typo in joining root url and nutrition json
bundle.min.js:1 GET https://world.openfoodfacts.orgstate/photos-validated/state/nutrition-facts-to-be-completed/1.json?fields=null net::ERR_NAME_NOT_RESOLVED
Visible in test at https://world.openfoodfacts.dev/hunger-game?type=nutrition
Access to XMLHttpRequest at 'https://robotoff.openfoodfacts.org/api/v1/insights/annotate' from origin 'https://world.openfoodfacts.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
https://world.openfoodfacts.org/state/product-name-to-be-completed.json
Allow users to select the bounding box containing the product name.
Fill a field with the text inside the box, and ask the user wether he/she wants to save the text as the product name.
Add link to current (and last) product in the nutrition game.
That way, the user can crop, rotate and adjust an image. He/She can also see the product he/she has just edited.
Add a simple little game that takes suspicious nutrition tables and propose them for review.
Empty nutrition tables: https://world.openfoodfacts.org/state/photos-validated/state/nutrition-facts-to-be-completed/1.json?fields=code,images
Dependabot can't update vulnerable dependencies without a lockfile
The currently installed version can't be determined.
To resolve the issue add a supported lockfile (package-lock.json or yarn.lock).
In the readme file, could you explain a little bit how to test the app?
(Sorry I don't know much about react.)
Related #32
Example: https://au.openfoodfacts.org/product/26174921/dairy-fine-peanuts -
I was prompted by an insight with:
Does the product belong to this category? Nuts and their products
It's very tempting to say "well, sort of" if you don't know it has a more precise category on it already.
If I saw the categories:
Categories: Snacks, Sweet snacks, Confectioneries, Chocolate candies, Bonbons, Chocolate covered nuts, Chocolate covered peanuts
I would more accurately apply the insight.
https://world.openfoodfacts.org/product/3077315890760/dijon-senf-original
Those were the values I entered that have been passed on to the next product, but without units. Perhaps the start of an explanation ?
nutriment_energy=1280&%2Cnutriment_fat=23&%2Cnutriment_saturated-fat=13&%2Cnutriment_carbohydrates=20&%2Cnutriment_sugars=18&%2Cnutriment_proteins=5.0&%2Cnutriment_salt=0.3&nutriment_energy_unit=Kj&nutriment_fat_unit=g&nutriment_saturated-fat_unit=g&nutriment_carbohydrates_unit=g&nutriment_sugars_unit=g&nutriment_proteins_unit=g&nutriment_salt_unit=g&code=8718906808232
Describe the bug
Insight filter is only applied after the loaded questions are exhausted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The current question should not be displayed any more. The insight filter should be applied immediately (possibly throttled to not spam robotoff with questions), so that I don't have to answer questions that I currently don't want to answer.
If you open https://ch.openfoodfacts.org/hunger-game, then the game will call the robotoff API with lang=ch
. The language should be de
in that case. There's probably other cases where the country code does not equal the language code. Also, OFF can be called for a country with different language. Due to that, for example, de-ru.openfoodfacts.org
should display products from Germany in Russian language.
Hunger Games hammers the server with queries when there's no insight left to validate
you can reproduce it by going to : https://world.openfoodfacts.org/hunger-game?value_tag=carrefour
and opening the debugging console, and looking at network requests
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003785157.json?fields=product_name HTTP/1.0" 200 142 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003782217.json?fields=product_name HTTP/1.0" 200 72 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003780961.json?fields=product_name HTTP/1.0" 200 114 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003782187.json?fields=product_name HTTP/1.0" 200 129 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003782217.json?fields=product_name HTTP/1.0" 200 72 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
ip - - [21/Jan/2020:11:21:41 +0100] "GET /cgi/display.pl?api/v0/product/3760003780961.json?fields=product_name HTTP/1.0" 200 114 "https://world.openfoodfacts.org/hunger-game?value_tag=la-roumaniere" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
[1/4] ๐ Resolving packages...
warning react-scripts > [email protected]: Way too old
warning react-scripts > react-app-polyfill > [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-scripts > webpack-dev-server > chokidar > [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
warning react-scripts > workbox-webpack-plugin > babel-runtime > [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > eslint > file-entry-cache > flat-cache > [email protected]: CircularJSON is in maintenance only, flatted is its successor.
warning react-scripts > jest > jest-cli > jest-haste-map > sane > [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
warning react-scripts > jest > jest-cli > prompts > [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning react-scripts > jest > jest-cli > jest-config > babel-core > babel-register > [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-scripts > workbox-webpack-plugin > workbox-build > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > workbox-webpack-plugin > workbox-build > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > workbox-webpack-plugin > workbox-build > joi > topo > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning react-scripts > jest > jest-cli > jest-environment-jsdom > jsdom > [email protected]: use String.prototype.padStart()
I'm sure it would greatly improve the addiction -- as in OpenSolarMap (unfortunatly broken at that time, see Google Images).
The counter wouldn't have to store data server side. It could only be provided by a session cookie.
Enable filtering by type of questions
Some users complain that mixed questions about brands/labels/categories make the game less addictive and too complex.
Let them filter the type of questions they want to be asked
https://github.com/openfoodfacts/robotoff/blob/master/doc/api.md
I've noticed mismatches with:
... particularly in the US dataset.
Consider adding some kind of weighting to choose more popular categories, or inline editing for users to override selections?
Edit: Possibly related to openfoodfacts/robotoff#51
The link to the product the user is currently being asked about always sends users to the world
subdomain. It would be better if this link used the original subdomain that the user came from.
Do not reprocess ingredient images (use cached versions)
process=0
instead of process=1
probably
Ex: https://fr.openfoodfacts.org/hunger-game?brands=coraya
status=no_questions
is returned, Hunger games keeps sending request to robotoff and the "loading..." prompt doesn't disappear.
The game always starts with France selected in the select.countrySelect
. Instead, it should use either the country for the domain (ie. Switzerland for ch.openfoodfacts.org
) or none (world.openfoodfacts.org
). Defaulting to France is unexpected behaviour if opened from another countries' OFF subdomain.
Currently, we can fetch questions that we already have in queue. Check question unicity using insight_id
field.
Currently, I only accidentally found this via the mobile app - it's great :)
I'm clever enough to have worked out the URL; however being able to access this from the normal web UI easily would be beneficial
I feel like this is a combination of:
Edit;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.