-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Implement a list system (also enabling a scan history) #21
Comments
@teolemon I'm new to openfoodfacts and I may say stupid things:
I haven't had a look at the code yet, so I don't know the kind of db currently used. But it shouldn't be problematic; I guess even shared preferences would do the job. In first approach I can see 2 obvious use-cases for the lists: scan history, and browse history (of course later user-defined lists can be implemented too, but that would involve more UX dev - add, remove, reorder). For the moment we can imagine displaying scan and browse histories in the "Profile" tab. |
A lot of very good points. |
Regarding history, I suggest the following Sembast record structure:
With this we will be able to perform the following actions:
|
Waiting for #55 |
Is the list-system the "Track" area in the navigation bar, or should it serve another purpose |
@M123-dev Actually I'm already working on this issue, on the data-structure / database side, and I'll finish within a week. |
@monsieurtanuki I'll have a look at it when it's finished. I should be done with the dark mode today or tomorrow. I always have a hard time choosing colors. |
Now that we have a brand-new database (#55) I'm ready to work on lists. Which will be a great help while developing other features: for some reasons I work with the products that match "Salmon" to see how the "preferred" lists look like, and I'm fed up with asking the internet the 500 first "salmon"s over and over again just because I want to check the colors ;) |
I've been working on it this morning, and it looks VERY good... |
Well that's some great teasing @monsieurtanuki waiting for the PR to try it out 😄 |
…he database ... and automagically asking the end-user if they want to see the cache New files: * `dao_product.dart` * `dao_product_list.dart` * `database_product_list_supplier.dart` * `product_list.dart` * `product_list_supplier.dart` * `product_query_page_helper.dart` * `query_product_list_supplier.dart` Impacted files: * `choose_page.dart`: now uses `ProductQueryPageHelper` in order to get database or http results; refactored * `continuous_scan_model.dart`: minor refactoring due to DAO * `group_product_query.dart`: now implements new method `getProductList` * `keywords_product_query.dart`: now implements new method `getProductList` * `local_database.dart`: now it's version 2; refactored using the new DAO classes * `product_query.dart`: new method `getProductList` * `product_query_model.dart`: now we use a `ProductListSupplier` instead of a `ProductQuery` * `product_query_page.dart`: now we use a `ProductListSupplier` instead of a `ProductQuery`
feature/#21 - automatically storing keywords and group results into the database
I'll PR the scanned product list this week-end. There'll still be UX questions like:
|
@monsieurtanuki I don't know if that's too much of a hassle, but maybe you could have a number of different views, like you mentioned before. TimeLine View (dublicate on)e.g. for the scan or eaten history. Here we could show the "quality of the food" with the colors on the side: Plain View (Dublicates optional):Like the lists in the categories Summary view / Count view(counted together) e.g. for a shopping list. Delete and ReloadI think a kind of custom dropdown on a LongPress would fit best into the design. This gives the option to update, delete, this could be further extendet, for example when the longpress is on a List not a entry we could also enter maybe future list settings. |
…or its history New file: * `scan_page.dart`: helper class to be used on top of `AlternativeContinuousScanPage` and `ContinuousScanPage` Impacted files: * `alternative_continuous_scan_page.dart`: `ContinuousScanModel` is now initialized upstream by `ScanPage` * `continuous_scan_model.dart`: now a `ChangeNotifier`, uses a `ProductList` and database cache * `continuous_scan_page.dart`: `ContinuousScanModel` is now initialized upstream by `ScanPage` * `contribution_page.dart`: uses the new `ScanPage` widget instead of the 2 scan pages * `local_database.dart`: removed the dummy notify listener method * `main.dart`: uses the new `ScanPage` widget instead of the 2 scan pages * `personalized_ranking_page.dart`: now we use a `ProductList` as input * `product_list.dart`: added a `getProduct` method and a "scan list" identifier * `product_page.dart`: unrelated UI fixes * `product_query_page.dart`: slight refactoring * `smooth_it_model.dart`: now we use `ProductList` * `smooth_product_carousel.dart`: added the new "CACHED" product possibility; fixed an init bug
feature/#21 - scan now uses local database, for product look up and for its history
@monsieurtanuki In Slack in #general there was a question / suggestion, which I think could go well with the lists:
That with defined portions / amounts is difficult to do, but one thing that I think would be very useful is a kind of list summary. So how many calories are in the list, is everything vegetarian / vegan. What do you think of the idea? |
@M123-dev Hi, I've posted this messange on Slack. Part with summary is exactly what I imagined. I'll elaborate on amounts/portions part. I thought about some way to select the portion size from predefined list - spoon, pinch, cup or amount in grams (list might be defined per product category). Sample user story: |
My next steps on this issue are:
I've just had another (brillant?) idea: attach an icon to a list - which seems straightforward for scanned products (barcode icon), favorites (heart), history (history icon). We'll let users select icons from a list for their custom lists. @M123-dev @kosciej That's not exactly an answer to your comments, I know, but I think your comments would deserve a new issue: once we've got custom lists, what do we do with them? |
@monsieurtanuki my proposal looks indeed like out of scope, but related to this one. I'll create separate issue. |
The idea with the icons is great. |
@M123-dev I don't know if it's a problem of_ missing_ data. The OFF server has most of the time all the nutrient data, it's just that we don't extract them when we download the products in smoothie. Should we extract everything? That's an existential question about the purpose of smoothie and the granularity of the data it uses. |
I'm still working on lists:
[Edit] done in #134. |
@teolemon Well, I guess the lists are now naturally embedded in smoothie. |
I think we are save to close this rn since the basics are implemented, a bit work is still to do ref #166 |
Principles
Lists should be:
Lists should be:
The text was updated successfully, but these errors were encountered: