openfoodfacts / hunger-games Goto Github PK
View Code? Open in Web Editor NEWOne click Mini-Games for Open Food Facts
Home Page: https://hunger.openfoodfacts.org
One click Mini-Games for Open Food Facts
Home Page: https://hunger.openfoodfacts.org
For now, the home page is far from being interesting. It's empty if you have no saved filters. And if you have some saved filters, they are... factual (to not say uggly)
Proposed improvement
Important
Less important
When doing debugging, we should not be considered in matomo
Pressing "o", "k" or "n" does not do anything.
Part of #70
The idea is to do the table that takes two props data
and onDataChange
the format of the data could be an array of objects
[{
off_nutriment_id: "energy_kj",
label: "Energie (kJ)",
value: '25.3',
unit: null,
quantification: '=',
robotoffPrediction: null
},
{
off_nutriment_id: "energy_kcal",
label: "Energie (kCal)",
value: '',
unit: null,
quantification: '<',
robotoffPrediction: null
}
]
Here is how it looked liked in the previous version (not perfect design)
Here is a list of nutrients key and their usual units
https://github.com/openfoodfacts/openfoodfacts-hungergames/blob/master/src/data/nutritions.json
To avoid having too much information on the main interface, the buttons to report an image could be added in the image gallery only.
For example a flag IconButton
in the right top corner of each image
To discuss with @teolemon :
If needed I have a workaround to test the feature:
On my personal server (amathjourney.com/api), I have an API do save flagged images:
https://amathjourney.com/api/off-annotation/flag-image/[code]
with body containing {imgid, url}
. The imgid
must contain a number (the id of the image) and url
is the image srchttps://amathjourney.com/api/off-annotation/flag-image/[code]
will return all the data you put for a given code
https://amathjourney.com/api/off-annotation/flag-image/[code]
with body containing {imgid}
Basically, it saves all that in a database whit the primary key code + imgid
While trying the logo game, I noticed an issue with the website.
The issue is that the Update
button on the game page seems unresponsive.
It gives no feedback on the button being pressed or the button action being completed.
The functionality of the button is fine as it is able to assign the label to images, but the user/player won't get feedback on the task being completed.
About the implementation aspect: reactour seems to provide an out of the box component that could be customized later
Maybe @teolemon @alexgarel or @CharlesNepote will have an opinion on the top
Long introductions are most of the time boring, so maybe a short one on the first opening and allow a longer one if the user asks for help
Here is the PR that introduced it first time. All the useful information can be found here
The easiest way seems to save favorites filters on the user computer thanks to locale storage. It's already done to save settings with localeStorageManager
You can copy-paste the localSettings
to create a localeFavorite
which would save favorite filters in a JSON format
There is already a component QuestionCard
to display a link to the correct question page. This component fetch data from robotoff during the first render to know how many questions are available
You only have to specify the following props: filterState
, imageSrc
, and title
.
Maybe imageSrc
could be a default value (for example the OFF logo)
The user should specify the title
property, such that with multiple favorites they can know whet do they are
Adding a small button in the filter resume could be an easy way to add filterstate to the favorites
For letting user set a title, maybe a simple dialogue
Step to reproduce:
I think it is useful when you want to open an issue or check if it's already open.
Also there are several Hunger Games github repositories and one could create an issue in an old repo.
I don't think it's necessary to create a new menu, putting this into "settings" would be ok.
A version number of the Hunger Game code would be also great but it's probably bigger work.
For a better alignement and take full width, the images in the question game could be organized with a Grid
Possibly better to use Grid? Stack is good when the thing is either vertical or horizontal, so maybe better to change
Originally posted by @nobeeakon in #78 (comment)
To add a page, you need to:
index.jsx
returning a React component that will be the nutrition page (see other other pages are made)src/pages/index.js
src/App.js
) the route /nutrition
sounds goodNow you should have access to localhost:3000/nutrition that displays your page
Do not add it to the app bar until the page is finished such that it can not be found by users
Could be a good starting point to fetch some products that have a nutrition picture but no data with getNutritionToFillUrl
method
Display the picture, and add a button to go to the next image
Make logo search deep-linkable using tags so that we can link from facets on the website, using the Power User Script
https://hunger.openfoodfacts.org/logos?logo_tag=en:eu-organic
Epic: Nutrition Game
Make an easy-to-use interface for filling nutrition data table
The first idea is something very simple: one side of the screen for the picture, the second for the table to fill
Some edge case we will face: the table needs to include a quantification (is the value equal, an upper or a lower bound) and the unit
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.