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

Move the experimental 'category edition' button into the Edit mode #1683

Closed
1 task
teolemon opened this issue Apr 28, 2022 · 26 comments
Closed
1 task

Move the experimental 'category edition' button into the Edit mode #1683

teolemon opened this issue Apr 28, 2022 · 26 comments
Assignees
Labels
✏️ Contribution ✏️ Editing - Categories ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users
Milestone

Comments

@teolemon
Copy link
Member

teolemon commented Apr 28, 2022

What

  • Move the experimental 'category edition' button currently in the product page into the Edit mode

Mockup

image

Part of

@teolemon teolemon added ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users ✏️ Editing - Categories ✏️ Contribution labels Apr 28, 2022
@teolemon teolemon added this to the V1 milestone May 4, 2022
@cli1005 cli1005 moved this from Todo (ready 2 dev) to In Progress in 🤳🥫 The Open Food Facts mobile app (Android & iOS) May 10, 2022
@cli1005
Copy link
Contributor

cli1005 commented May 10, 2022

The button "Edit" which works exactly the same way as the "Additional Button" is added to the page Product edition as following:

The "Edit" button is deactivated if the product has no category tag since the "Additional Button" has no action in the same case

category tag exists category tag missiong
Simulator Screen Shot - iPhone 13 - 2022-05-10 at 14 58 48 Simulator Screen Shot - iPhone 13 - 2022-05-10 at 14 59 00
simulator-screen-recording-iphone-13-2022-05-10-at-144404_iok5lYJX.mp4

@teolemon
Copy link
Member Author

Does the category edit mode work ok if we have no category at all ?

@cli1005
Copy link
Contributor

cli1005 commented May 10, 2022

Does the category edit mode work ok if we have no category at all ?

No, the button "Edit" is deactivated, since nothing happens when the "Additional Button" is clicked in this case.

If we have no category as all, the button "Add missing product category" is shown, but no action has been applied yet.

@monsieurtanuki
Copy link
Contributor

@teolemon @cli1005 Actually the current implementation is more or less OK when you want to slightly fix an existing category.

It does not work when you're starting from scratch, the reason being that we don't really have access to root categories:

Besides, as a user I'm not sure I would bother to climb the category tree step by step, where on the website I can just type "sardines à l'huile" instead of a painful exploration of Conserves, Produits de la mer, Poissons, Poissons en conserve, Poissons et viandes et oeufs, Sardines, Sardines en conserve, Filets de poissons, Sardines à l'huile, Filets de sardines, Sardines à l'huile d'olive, Sardine à l'huile d'olive appertisée

@cli1005
Copy link
Contributor

cli1005 commented May 11, 2022

@teolemon @cli1005 Actually the current implementation is more or less OK when you want to slightly fix an existing category.

It does not work when you're starting from scratch, the reason being that we don't really have access to root categories:

Besides, as a user I'm not sure I would bother to climb the category tree step by step, where on the website I can just type "sardines à l'huile" instead of a painful exploration of Conserves, Produits de la mer, Poissons, Poissons en conserve, Poissons et viandes et oeufs, Sardines, Sardines en conserve, Filets de poissons, Sardines à l'huile, Filets de sardines, Sardines à l'huile d'olive, Sardine à l'huile d'olive appertisée

We just add a button in the Product Edition page which works the same way as the "Additional Button", no change has been made to the Category Edition :)

@teolemon
Copy link
Member Author

Capture d’écran 2022-05-11 à 15 58 45

Capture d’écran 2022-05-11 à 15 58 52

Capture d’écran 2022-05-11 à 15 59 13

@monsieurtanuki
Copy link
Contributor

@teolemon Not sure I follow you: are we supposed to show this to an end-user that clicks on the "No category so far: please select one" button?

@monsieurtanuki
Copy link
Contributor

We just add a button in the Product Edition page which works the same way as the "Additional Button", no change has been made to the Category Edition :)

@cli1005 It's just that in Category Edition there were cases that were not handled (cf. the TODOs).

@cli1005
Copy link
Contributor

cli1005 commented May 11, 2022

We just add a button in the Product Edition page which works the same way as the "Additional Button", no change has been made to the Category Edition :)

@cli1005 It's just that in Category Edition there were cases that were not handled (cf. the TODOs).

Yes, we might need or have already another issue concerning TODOs of Category Edition? the objective of this issue is just to move the button, in my opinion

@monsieurtanuki monsieurtanuki self-assigned this May 11, 2022
@teolemon
Copy link
Member Author

teolemon commented May 11, 2022

@monsieurtanuki
Copy link
Contributor

@teolemon Could also be fixed if 'en:plant-based-foods-and-beverages' had parents (probably the root).

@cli1005
Copy link
Contributor

cli1005 commented May 12, 2022

So... I create a PR juste for the new button or we wait for all the points to reach?

@teolemon
Copy link
Member Author

I've updated my comment with links to the blocking issues. Let's put this one on hold, at least until we clean up server side ?

@cli1005 cli1005 moved this from In Progress to To discuss and validate in 🤳🥫 The Open Food Facts mobile app (Android & iOS) May 12, 2022
@teolemon
Copy link
Member Author

teolemon commented May 12, 2022

Started the clean-up server side @cli1005 @monsieurtanuki @stephanegigandet

@monsieurtanuki
Copy link
Contributor

@teolemon I can start working on the "No category: we start from root" feature, can't I?
Or would we better off (haha) with a "type in/search category" feature?

@teolemon
Copy link
Member Author

Two are equally valid and complementary options.
Search might be slightly more useful in the short term given the wealth of categories

@monsieurtanuki
Copy link
Contributor

@teolemon Have you got some starting point suggestions for the "type in/search category" feature?

@teolemon
Copy link
Member Author

We have the autosuggest API in the Dart package already, and then on click, you could load the partial taxo API matching the selected tag (thus no UI change needed for final validation)

@monsieurtanuki
Copy link
Contributor

@teolemon I know that's not what the mocks said but my brain does not understand the concept of multiple categories on the same tree, UI/UX-wise.

I suggest something similar to the website: the list of the current product categories, and the possibility to add a category with autocomplete.

Something like that:
Capture d’écran 2022-05-14 à 17 43 26

Capture d’écran 2022-05-14 à 17 43 01

@teolemon
Copy link
Member Author

I'm not sure I understand how I'm supposed to interact with this new mockup.
Here's for reference my last version, along with search:
image

At this point of complexity, the solution we have in V1 (field with existing categories as chips, plus the ability to add more thanks to autocomplete) looks more intuitive.

@teolemon
Copy link
Member Author

teolemon commented May 15, 2022

@monsieurtanuki I've made variants with Radio buttons, but I do believe multiple category selection should remain possible. The second one is in line with the idea that you'd have to pick just one category (removing the list of currently existing categories on a product).
image

@teolemon
Copy link
Member Author

Also, in the case of single category selection, I'm not sure how we're supposed to handle the thousands of products who do have multiple categories.

@monsieurtanuki
Copy link
Contributor

@teolemon Would you prefer something like this?
Simulator Screen Shot - iPhone 8 Plus - 2022-05-16 at 09 22 15

@cli1005 cli1005 removed their assignment May 16, 2022
@monsieurtanuki
Copy link
Contributor

According to https://openfoodfacts.github.io/api-documentation/#7Metadata

Important! The categories hierarchy is not a tree but a lattice: each node can have several children, but also several parents.

@teolemon That would tend to plead for "type in keywords/search" rather than "tree search", wouldn't it?

@teolemon
Copy link
Member Author

teolemon commented Jun 1, 2022

Probably.

@teolemon teolemon modified the milestones: V1, V1.1 Jun 18, 2022
@teolemon
Copy link
Member Author

teolemon commented Jul 4, 2022

Closing for now, let's focus on adding autocompletion to the current view.

@teolemon teolemon closed this as completed Jul 4, 2022
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Contribution ✏️ Editing - Categories ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users
Development

No branches or pull requests

3 participants