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

feat: #944 - added a category picker page to the temporary product button #1148

Merged
merged 6 commits into from
Feb 20, 2022

Conversation

monsieurtanuki
Copy link
Contributor

@monsieurtanuki monsieurtanuki commented Feb 17, 2022

What

  • added a category picker page to the temporary product button

New files

  • category_cache.dart: Cache where we download and store category data.
  • category_picker_page.dart: Category picker page.
  • product_refresher.dart: Refreshes a product on the BE then on the local database.

Impacted files

  • new_product_page.dart: now the temporary button opens the category picker page.
  • nutrition_page_loaded.dart: refactored using new class ProductRefresher.

Several points pending

  1. manage the roots
  2. manage the multi-category (e.g. green tea being considered in French as "thé" and "tisane")
  3. make the "save to BE" work

Screenshot

Simulator Screen Shot - iPhone 8 Plus - 2022-02-17 at 11 12 11

Fixes bug(s)

Part of

(please be as granular as possible)

…ry product button

New files:
* `category_cache.dart`: Cache where we download and store category data.
* `category_picker_page.dart`: Category picker page.
* `product_refresher.dart`: Refreshes a product on the BE then on the local database.

Impacted files:
* `new_product_page.dart`: now the temporary button opens the category picker page.
* `nutrition_page_loaded.dart`: refactored using new class `ProductRefresher`.
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner February 17, 2022 10:14
@teolemon
Copy link
Member

teolemon commented Feb 18, 2022

Are the different icons voluntary @monsieurtanuki , compared to the initial implem for search refinement ?
image

@monsieurtanuki
Copy link
Contributor Author

As far as I know the implementation you're referring to 1. is still a draft 2. is on the search page ("let's filter all results even more by categories") and not on the product page ("let me set a more appropriate category for this product").
My choice of icons (radio buttons instead of check boxes) matches the need I understood: select one category for a product.
Regarding arrows, sure I can replace up-left and down-right arrows with left and right arrows.

@teolemon
Copy link
Member

  • You're right, it's 2 different uses of the same codes, with some variations
  • Potentially, we'll have several categories, which checkbox carry slightly better.
  • The division lines are helpful to convey hierarchy and the ability to deep dive (like in a File Explorer)
  • The tags on top (with the already selected cats), and the ability to search within the full tree are useful for power users and people like @stephanegigandet who don't like delving progressively within 12 levels of hierarchy (I'm not sure if this one was already implemented)

@monsieurtanuki
Copy link
Contributor Author

  1. I understand the use-case of "category search" by string for power-users, but it's not going to be implemented in this PR - and I don't know if on the BE there's a query for that.
  2. I don't know people that can understand browsing the same hierarchy in order to set several values: my assumption is that human beings can perform that one category at a time (hence the radio buttons). In the worst case scenario of several categories I guess we can use several category buttons - I have to look again at products with several categories (which is the minority I presume)
  3. My understanding of the needs was to browse a hierarchy to fix the pre-defined category - e.g. maybe 2 steps deeper, maybe a sibling, maybe a cousin. I was thinking about a Unix ls / DOS dir command.
  4. If you want I can add division lines, and print the full path in the .. line.

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monsieurtanuki I guess since it's dev mode, and unless @M123-dev has some feedback, that's good with me (with the possibility to fix later)

@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review: of course UI and features can be fixed later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants