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: Better suggestions in product edition (UI/UX) + debounce feature #4351

Merged
merged 4 commits into from
Jul 29, 2023

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Jul 21, 2023

Hi everyone,

In a product edition, we provide some suggestions for categories, labels…
The current implementation triggers a request for every single letter.
To improve this, the app will now show a loader because the results will appear with a delay.

A video of the change: Video.webm

Just in case it's not clear, let's say you write "ABC" : you will see the suggestions for "A", then "B", then "C".
To be less confusing for the user, I have added a ProgressBar which is visible until the correct suggestions are visible (here "C").

Also, in some cases, the request may take a really long time, and in that case, if that's an intermediate case (eg: A or B), it won't be displayed.

Furthermore, I have added a cache, which may require fewer requests to the server.

Clearly, this is just a UI improvement, but we should implement a debounce-like mechanism to minimize the number of requests to the server.

EDIT: The debounce feature is implemented! (@see #4351 (comment))

@g123k g123k requested a review from a team as a code owner July 21, 2023 17:57
@github-actions github-actions bot added 🥫 Product page 🤗 Onboarding We need to onboard users on how the app works, but also on content like Nutri-Score, Eco-Score… labels Jul 21, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2023

You can test this PR on: Android

@g123k
Copy link
Collaborator Author

g123k commented Jul 21, 2023

Good news!
There is now a debounce feature, which may require way fewer requests.

Here is a video: Search2.webm

(The server is really slow tonight)

@g123k g123k changed the title feat: Better suggestions in product edition (UI/UX) feat: Better suggestions in product edition (UI/UX) + debounce feature Jul 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2023

Codecov Report

Merging #4351 (fce5291) into develop (a08a2f9) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #4351      +/-   ##
===========================================
- Coverage    10.29%   10.24%   -0.05%     
===========================================
  Files          293      293              
  Lines        14757    14826      +69     
===========================================
  Hits          1519     1519              
- Misses       13238    13307      +69     
Files Changed Coverage Δ
...ges/smooth_app/lib/pages/product/autocomplete.dart 0.00% <0.00%> (ø)
...app/lib/pages/product/simple_input_text_field.dart 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@g123k g123k force-pushed the autocomplete_loader branch from 71755ba to fce5291 Compare July 28, 2023 23:15
@github-actions github-actions bot removed PR: needs rebase 🤗 Onboarding We need to onboard users on how the app works, but also on content like Nutri-Score, Eco-Score… labels Jul 28, 2023
@teolemon teolemon merged commit 5fdbc12 into openfoodfacts:develop Jul 29, 2023
@g123k g123k deleted the autocomplete_loader branch December 30, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants