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: Hunger games: a better loading view + we finally support errors… #4448

Merged
merged 2 commits into from
Aug 5, 2023

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Aug 4, 2023

Hi everyone,

I've reworked a bit the Hunger game page, with:

  • A loading view with some Text instead of a vague Progress Bar
  • We now catch errors 💥
  • … and we can even retry the request 👍
  • There are some minor tweaks for the question page and the congrats Widget
  • With the need to retry requests, there's no more a FutureBuilder, hence needing a bit more code
  • Some Dart 3 code (sealed classes, enhanced switch)

Some screenshots:

Loading:
Screenshot 2023-08-04 at 21 45 56

Question card:
Screenshot 2023-08-04 at 23 12 39

Error:
Screenshot 2023-08-04 at 23 11 45

@g123k g123k self-assigned this Aug 4, 2023
@g123k g123k requested a review from a team as a code owner August 4, 2023 21:14
@g123k g123k changed the title feat: Hunger games: better loading view + support errors… feat: Hunger games: a better loading view + we finally support errors… Aug 4, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #4448 (569226f) into develop (13e6d54) will decrease coverage by 0.03%.
Report is 1 commits behind head on develop.
The diff coverage is 2.91%.

@@             Coverage Diff             @@
##           develop    #4448      +/-   ##
===========================================
- Coverage    10.17%   10.14%   -0.03%     
===========================================
  Files          295      295              
  Lines        15087    15154      +67     
===========================================
+ Hits          1535     1538       +3     
- Misses       13552    13616      +64     
Files Changed Coverage Δ
...pp/lib/cards/product_cards/product_title_card.dart 0.00% <0.00%> (ø)
...ric_lib/buttons/smooth_large_button_with_icon.dart 0.00% <0.00%> (ø)
...es/smooth_app/lib/pages/hunger_games/congrats.dart 1.44% <0.00%> (-0.03%) ⬇️
...ooth_app/lib/pages/hunger_games/question_card.dart 0.00% <ø> (ø)
...ooth_app/lib/pages/hunger_games/question_page.dart 2.28% <3.14%> (+1.39%) ⬆️

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

You can test this PR on: Android

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.

I wonder why we try to make Hunger Games an overlay vs a dedicated screen. (I do understand it when the widget is shown on a product)

@@ -2392,5 +2392,9 @@
"nova_group_2": "NOVA Group 2",
"nova_group_3": "NOVA Group 3",
"nova_group_4": "NOVA Group 4",
"nova_group_unknown": "Unknown NOVA Group"
"nova_group_unknown": "Unknown NOVA Group",
"hunger_games_loading_line1": "Please let us a few seconds…",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"hunger_games_loading_line1": "Please let us a few seconds…",
"hunger_games_loading_line1": "Just a few seconds…",

"nova_group_unknown": "Unknown NOVA Group"
"nova_group_unknown": "Unknown NOVA Group",
"hunger_games_loading_line1": "Please let us a few seconds…",
"hunger_games_loading_line2": "We're downloading the questions!",
Copy link
Member

Choose a reason for hiding this comment

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

Do we want a We/You wording?

Copy link
Collaborator Author

@g123k g123k Aug 5, 2023

Choose a reason for hiding this comment

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

As it's a game, that why I've switched to a more familiar language, but feel free to revert this change

@g123k
Copy link
Collaborator Author

g123k commented Aug 5, 2023

I wonder why we try to make Hunger Games an overlay vs a dedicated screen. (I do understand it when the widget is shown on a product)

You're totally right and would be interesting to also use the onboarding from the website, to clarify that's another feature from the main app. I note this for next "sprint".

@teolemon teolemon merged commit 01ae1fa into openfoodfacts:develop Aug 5, 2023
9 checks passed
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