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: Fully working lifecycle for the Robotoff question in the Product page #4198

Merged

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Jun 17, 2023

Hi everyone,

Currently, when we scroll up/down on the Product page, the Robotoff Widget is reloaded every time.
My PR fixes this with a KeepAlive, but as an improvement over #3326, during the loading time, a Shimmer is shown to prevent the List from being offset when the content is ready.

Better than words, a video: robotoff_lifecycle.webm

EDIT: I've also changed a little bit the animation of the question page (I know it's meaningless from the product page, but may be used elsewhere) Zoom.webm

@g123k g123k self-assigned this Jun 17, 2023
@g123k g123k requested a review from a team as a code owner June 17, 2023 20:32
@github-actions github-actions bot added 🌐 l10n Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. and removed 🤖 Robotoff labels Jun 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2023

Codecov Report

Merging #4198 (e4be8a9) into develop (38b2b8a) will decrease coverage by 0.02%.
The diff coverage is 3.12%.

@@             Coverage Diff             @@
##           develop    #4198      +/-   ##
===========================================
- Coverage    10.88%   10.87%   -0.02%     
===========================================
  Files          277      277              
  Lines        13600    13652      +52     
===========================================
+ Hits          1481     1484       +3     
- Misses       12119    12168      +49     
Impacted Files Coverage Δ
...ooth_app/lib/pages/hunger_games/question_page.dart 0.89% <0.00%> (-0.12%) ⬇️
...smooth_app/lib/pages/product/new_product_page.dart 0.00% <0.00%> (ø)
...pp/lib/pages/product/product_questions_widget.dart 3.44% <4.54%> (+3.44%) ⬆️

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

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.

Looks good 👍

@g123k
Copy link
Collaborator Author

g123k commented Jun 18, 2023

As noted in #4199, this PR is critical as it fixes the performance issue of an infinite redraw

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Code wise looks good to me, but you mentioned the shimmer to not jump when the question is loaded. What happend when there is no question, then the list jumps, doesn't it

Comment on lines +142 to +144
// TODO(jasmeet): Use Material icon or SVG (after consulting UX).
Text(
'🏅 ${appLocalizations.tap_to_answer}',
Copy link
Member

Choose a reason for hiding this comment

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

Guess we can apply that some time, jasmeet0817 no longer is working on the app

@g123k
Copy link
Collaborator Author

g123k commented Jun 18, 2023

Code wise looks good to me, but you mentioned the shimmer to not jump when the question is loaded. What happend when there is no question, then the list jumps, doesn't it

When there is no question, -> the Container is replaced with an EMPTY_WIDGET
NoQuestion.webm

@teolemon teolemon merged commit 9e232c6 into openfoodfacts:develop Jun 18, 2023
6 checks passed
@g123k g123k deleted the keep_alive_robotoff_product_page branch June 20, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 l10n lifecycle Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page 🤖 Robotoff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants