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

Fix refresh strategy for the history #796

Closed
4 tasks
teolemon opened this issue Dec 29, 2021 · 2 comments
Closed
4 tasks

Fix refresh strategy for the history #796

teolemon opened this issue Dec 29, 2021 · 2 comments

Comments

@teolemon
Copy link
Member

The refresh strategy for the history is confusing. Beyond the recent schema change, products get completed on a rolling basis.
To 'fix" products in my history, I have to:

  • Open the product
  • Open the menu to refresh
  • See the Eco-Score appear on the summary card
  • Move to the next product.

I would expect a more agressive refresh strategy (attempt to refresh silently on product opening, and refresh on "pull to refresh" in history

Originally posted by @teolemon in #788 (comment)

@monsieurtanuki
Copy link
Contributor

@teolemon We don't have the same problem for the search list, because the local database is queried ("same search already?") and its products are displayed, with a snackbar mentioning the possibility of a refresh (list + product data).

In a first approach, I can add a "refresh" button and method to the history page, that would refresh the products of the history - not the history itself of course. The choice of the most relevant UI/UX for that will come next.

Regarding the product page, the method _refreshProduct is already there in new_product_page.dart, and is triggered by a "refresh" menu item.

@monsieurtanuki monsieurtanuki self-assigned this Dec 30, 2021
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Mar 10, 2022
…y page

Impacted file:
* `product_list_page.dart`: added a "refresh products" button; refactored
monsieurtanuki added a commit that referenced this issue Mar 10, 2022
Impacted file:
* `product_list_page.dart`: added a "refresh products" button; refactored
@monsieurtanuki
Copy link
Contributor

From #1192, just one click from history page updates the history products.

As @M123-dev pointed out, the coded solution will not be good if we have 1000s of products in the history, but neither will the whole app, as one of the 3 preloaded tabs displays the history page that first loads ALL the history products and then displays them in a more elegant way with ListView.builder.

Does it make sense to keep 1000s of products in history? Should we display them page by page? Should we truncate the history to a reasonable (?) size?

If those questions are interesting enough for the project (given its goals), please feel free to create a specific issue or discussion.

Now I close this issue, as it's now possible very easily to refresh the history. @teolemon If you prefer a more automatic process, please create a new issue.

Repository owner moved this from Todo to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants