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

Create a button to extend research to world #1343

Closed
teolemon opened this issue Mar 26, 2022 · 15 comments · Fixed by #2718
Closed

Create a button to extend research to world #1343

teolemon opened this issue Mar 26, 2022 · 15 comments · Fixed by #2718

Comments

@teolemon
Copy link
Member

teolemon commented Mar 26, 2022

Surprisingly little amount of results and scored results for lasagne personal search

What

  • Create a button on the search list to extend the research to the entire world.

Part of

Video with audio commentary

screen-20220326-133949.mp4
@monsieurtanuki
Copy link
Contributor

What is your country?

@monsieurtanuki
Copy link
Contributor

What is your quest?
What is the capital of Assyria?
I don't know that, ahh!
Capture d’écran 2022-03-26 à 16 51 05

@teolemon
Copy link
Member Author

Oh, GitHub removed the sound ?

@monsieurtanuki
Copy link
Contributor

@teolemon I managed to hear you. I've just run the "lasagne" test and got 500 products (as France). Then I've refreshed as USA, and got 53 products.

@teolemon
Copy link
Member Author

Ah. Ok, will be mocking up a button to extend to world

@VaiTon VaiTon changed the title Surprisingly little amount of results and scored results for lasagne personal search Create a button to extend research to world Mar 29, 2022
@teolemon teolemon added this to the V2 milestone Apr 11, 2022
@teolemon
Copy link
Member Author

teolemon commented Jul 3, 2022

The problem is for usability reason it should be on top (having to scroll, esp if infinite scrolling is contrarian), but it's a little obnoxious
image

@monsieurtanuki
Copy link
Contributor

Btw, duplicate with #2339.

I'm sure there are other ways in 2022 to alert the user.

E.g. a banner:
Capture d’écran 2022-07-03 à 11 23 43

In flutter it's called a MaterialBanner.

Each time we run a query, we could run the same query for the world with no data (like pageNumber=1, pageSize=1, fields=barcode) just to get the count result.
That would make it possible to say: "hey there are 12 results for your country and 435 for the world, would you like to see the results for the world?". That said, it would be slower (second query with larger data on the server side).

In addition to that, what would trigger this banner? I mean, I'm in France and I'm looking for "pizza", there are 5K results, why would you display a banner about a search at the world level?

@monsieurtanuki monsieurtanuki self-assigned this Jul 3, 2022
@teolemon
Copy link
Member Author

teolemon commented Jul 3, 2022

It's mostly for countries with little to no products yet.

@monsieurtanuki
Copy link
Contributor

Is there a list of such countries?

@monsieurtanuki
Copy link
Contributor

In a first approach we can put a switch item in dev mode: "propose world products yes/no"

@teolemon
Copy link
Member Author

teolemon commented Jul 3, 2022

Not really, it's a gimmick from the web version

@monsieurtanuki
Copy link
Contributor

@teolemon @VaiTon Preview of coming attraction:

France World
Capture d’écran 2022-08-01 à 16 21 32 Capture d’écran 2022-08-01 à 16 21 57
Capture d’écran 2022-08-01 à 16 23 32 Capture d’écran 2022-08-01 à 16 23 58

@VaiTon
Copy link
Member

VaiTon commented Aug 1, 2022

I'm sorry @monsieurtanuki could you please translate the messages? My understanding of French is limited :(((

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Aug 1, 2022

@VaiTon Oops - the same in English [Edited with the new "Search world" label]

France World
Capture d’écran 2022-08-01 à 18 21 39 Capture d’écran 2022-08-01 à 18 11 26

@VaiTon
Copy link
Member

VaiTon commented Aug 1, 2022

@monsieurtanuki thank you! Really like it! Maybe using "Search World" instead of "Entire World" would be more representative of the action? Not a blocker though

monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Aug 3, 2022
…isplay

Deleted file:
* `group_query_filter_view.dart`: old code never used and never changed

Impacted files:
* `app_en.arb`: added 2 labels for "world results"
* `app_fr.arb`: added 2 labels for "world results"
* `category_product_query.dart`: implemented world query
* `keywords_product_query.dart`: implemented world query
* `paged_product_query.dart`: introduced word query parameter and methods
* `paged_search_product_query.dart`: implemented world query
* `paged_to_be_completed_product_query.dart`: implemented world query
* `product_list_supplier.dart`: refactored
* `product_model.dart`: loosely related safer "notifyListeners" method
* `product_query.dart`: now storing here the country, which makes "world" queries possible
* `product_query_model.dart`: removed all the "category filter" code; better management of the "what if the refresh download fails?" case
* `product_query_page.dart`: added "world" queries; removed the "category filter" code; now displays a `MaterialBanner` (more flexibility than a `SnackBar`)
* `smooth_theme.dart`: added a banner theme for `MaterialBanner`
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Aug 3, 2022
monsieurtanuki added a commit that referenced this issue Aug 3, 2022
Deleted file:
* `group_query_filter_view.dart`: old code never used and never changed

Impacted files:
* `app_en.arb`: added 2 labels for "world results"
* `app_fr.arb`: added 2 labels for "world results"
* `category_product_query.dart`: implemented world query
* `keywords_product_query.dart`: implemented world query
* `paged_product_query.dart`: introduced word query parameter and methods
* `paged_search_product_query.dart`: implemented world query
* `paged_to_be_completed_product_query.dart`: implemented world query
* `product_list_supplier.dart`: refactored
* `product_model.dart`: loosely related safer "notifyListeners" method
* `product_query.dart`: now storing here the country, which makes "world" queries possible
* `product_query_model.dart`: removed all the "category filter" code; better management of the "what if the refresh download fails?" case
* `product_query_page.dart`: added "world" queries; removed the "category filter" code; now displays a `MaterialBanner` (more flexibility than a `SnackBar`)
* `smooth_theme.dart`: added a banner theme for `MaterialBanner`
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment