openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
855 stars 283 forks source link

feat: Photo gallery with tabs #5872

Closed g123k closed 4 days ago

g123k commented 5 days ago

Hi everyone!

Here's the final touch for the photo gallery. 🎥 Video: https://github.com/user-attachments/assets/8308da52-1577-492d-afe6-4d1e35f48e20

There are now tabs for languages on top of the screen: IMG_1375 

And the action button is not a FAB anymore, but a footer button: IMG_1375

codecov-commenter commented 5 days ago

Codecov Report

Attention: Patch coverage is 0.89286% with 444 lines in your changes missing coverage. Please review.

Project coverage is 6.78%. Comparing base (4d9c7fc) to head (154910c). Report is 481 commits behind head on develop.

Files with missing lines Patch % Lines
...oduct/gallery_view/product_image_gallery_view.dart 0.93% 106 Missing :warning:
...oduct/gallery_view/product_image_gallery_tabs.dart 1.86% 105 Missing :warning:
packages/smooth_app/lib/widgets/smooth_tabbar.dart 0.00% 87 Missing :warning:
.../gallery_view/product_image_gallery_photo_row.dart 0.00% 69 Missing :warning:
packages/smooth_app/lib/pages/image_crop_page.dart 0.00% 37 Missing :warning:
.../lib/cards/product_cards/smooth_product_image.dart 0.00% 13 Missing :warning:
packages/smooth_app/lib/helpers/ui_helpers.dart 0.00% 13 Missing :warning:
...s/smooth_app/lib/helpers/border_radius_helper.dart 0.00% 8 Missing :warning:
...app/lib/generic_lib/widgets/language_selector.dart 0.00% 4 Missing :warning:
...pp/lib/cards/product_cards/product_title_card.dart 0.00% 1 Missing :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #5872 +/- ## ========================================== - Coverage 9.54% 6.78% -2.77% ========================================== Files 325 432 +107 Lines 16411 23843 +7432 ========================================== + Hits 1567 1617 +50 - Misses 14844 22226 +7382 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

g123k commented 4 days ago
  • I'd be tempted to have a secret gesture (Long press on the outdated image) or button to directly jump to the camera to refresh the current photo

For this one, I first need to change the product addition flow. Blocked by #5857

  • We will probably have to tweak this widget to have an inline equivalent to the tab system (drop-down, little list of available languages, accordion of available languages) when we insert it into the photos tab. By then anyway, the language shown in the photos tab will be probably good for 99% of viewers.

An alternative would be to show a different layout on the product page, with only the "best pictures". However, if photos are missing, a message will be displayed. The idea would be to keep the advanced view in editing and a simplified view on the product page.

g123k commented 4 days ago

@teolemon I have a doubt about my implementation. It will always open the default language (the current issue with missing photos will disappear).

Is it what we want? Or should I open the tab containing the user language?

teolemon commented 4 days ago

If and only if it has photos already. Otherwise, it's just a tap away to add photos. Let's avoid wrong incentives.

g123k commented 4 days ago

Ok, so I let this PR as is