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: Add infos about the photo in the modal sheet (gallery) #6229

Merged
merged 3 commits into from
Jan 19, 2025

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Jan 17, 2025

Hi everyone!

My initial goal was to display the contributor's name and the date in the modal sheet.
Unfortunately, and correct me if I'm wrong, but the contributor's name is unavailable for the 4 main photos in the API.

Instead, I better show the date (+ outdated) and if the creator is the producer.

Video: user-attachments/assets/d24cb623-38f7-429c-a312-b0b31e6efab3

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 0.85470% with 116 lines in your changes missing coverage. Please review.

Project coverage is 6.12%. Comparing base (4d9c7fc) to head (99534a7).
Report is 685 commits behind head on develop.

Files with missing lines Patch % Lines
...ery_view/product_image_gallery_details_banner.dart 0.00% 101 Missing ⚠️
...generic_lib/bottom_sheets/smooth_bottom_sheet.dart 0.00% 12 Missing ⚠️
..._app/lib/pages/image/product_image_other_page.dart 0.00% 2 Missing ⚠️
...smooth_app/lib/pages/product/owner_field_info.dart 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #6229      +/-   ##
==========================================
- Coverage     9.54%   6.12%   -3.43%     
==========================================
  Files          325     462     +137     
  Lines        16411   27070   +10659     
==========================================
+ Hits          1567    1657      +90     
- Misses       14844   25413   +10569     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 have some reservations about the scalability of putting it into the bottom sheet, regarding nutri-patrol

@teolemon
Copy link
Member

@g123k You can get the source photo id, and then get the contributor

@g123k
Copy link
Collaborator Author

g123k commented Jan 18, 2025

There are links between photos and contributors.
But the 4 main have a different name.

If you find how, please give an example.

For the size of this change, this is similar to when we have an outdated picture + from producer. I can change the layout to to make this part only available after a second scroll

@teolemon
Copy link
Member

teolemon commented Jan 18, 2025

https://world.openfoodfacts.org/api/v3/product/2174616005501.json?fields=images

"nutrition_fr": {
"angle": null,
"geometry": "0x0-0-0",
"imgid": "2",

  "2": {
    "sizes": {
      "100": {
        "h": 77,
        "w": 100
      },
      "400": {
        "h": 309,
        "w": 400
      },
      "full": {
        "h": 1360,
        "w": 1759
      }
    },
    "uploaded_t": "1518262012",
    "uploader": "kiliweb"
  },

@g123k
Copy link
Collaborator Author

g123k commented Jan 18, 2025

world.openfoodfacts.org/api/v3/product/2174616005501.json?fields=images

Okay, my two examples didn't have the information.
I'll change the behavior

@g123k
Copy link
Collaborator Author

g123k commented Jan 18, 2025

I've changed the behavior to have an expandable container.
However, items will be directly visible if the photo is outdated and/or the contributor is the owner.

Video: https://github.com/user-attachments/assets/d24cb623-38f7-429c-a312-b0b31e6efab3

@teolemon
Copy link
Member

@g123k merge conflicts

@teolemon teolemon merged commit 0020264 into openfoodfacts:develop Jan 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants