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: 3332 - crop page title now reflects image field #3366

Merged
merged 6 commits into from
Nov 28, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • confirm_and_upload_picture.dart: minor refactoring
  • crop_helper.dart: added a pageTitle parameter
  • edit_ingredients_page.dart: minor refactoring
  • image_crop_page.dart: added imageField parameters, so that we can compute the correct label on crop page
  • image_upload_card.dart: now we explicitly use getProductImageButtonText as label
  • new_crop_page.dart: added a page title parameter
  • product_cards_helper.dart: new label method getImagePageTitle; minor refactoring
  • product_image_carousel.dart: minor refactoring
  • product_image_data.dart: removed label fields - now we have more flexibility, computing labels from imageField with product_cards_helper.dart methods
  • product_image_gallery_view.dart: minor refactoring
  • product_image_swipeable_view.dart: now we explicitly use getImagePageTitle as label
  • product_image_viewer.dart: minor refactoring
  • smooth_images_sliver_list.dart: now we explicitly use getProductImageTitle as label
  • smooth_product_image.dart: minor refactoring

What

Screenshot

Capture d’écran 2022-11-27 à 11 50 27

Part of

Impacted files:
* `confirm_and_upload_picture.dart`: minor refactoring
* `crop_helper.dart`: added a `pageTitle` parameter
* `edit_ingredients_page.dart`: minor refactoring
* `image_crop_page.dart`: added `imageField` parameters, so that we can compute the correct label on crop page
* `image_upload_card.dart`: now we explicitly use `getProductImageButtonText` as label
* `new_crop_page.dart`: added a page title parameter
* `product_cards_helper.dart`: new label method `getImagePageTitle`; minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_data.dart`: removed label fields - now we have more flexibility, computing labels from `imageField` with `product_cards_helper.dart` methods
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_swipeable_view.dart`: now we explicitly use `getImagePageTitle` as label
* `product_image_viewer.dart`: minor refactoring
* `smooth_images_sliver_list.dart`: now we explicitly use `getProductImageTitle` as label
* `smooth_product_image.dart`: minor refactoring
@monsieurtanuki
Copy link
Contributor Author

Possible variations:

"edit" before "edit" after
Capture d’écran 2022-11-27 à 11 57 00 Capture d’écran 2022-11-27 à 11 56 15

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2022

Codecov Report

Merging #3366 (f430035) into develop (5fe74ca) will increase coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head f430035 differs from pull request most recent head 1977488. Consider uploading reports for the commit 1977488 to get more accurate results

@@           Coverage Diff            @@
##           develop    #3366   +/-   ##
========================================
  Coverage    10.41%   10.41%           
========================================
  Files          258      258           
  Lines        12494    12492    -2     
========================================
  Hits          1301     1301           
+ Misses       11193    11191    -2     
Impacted Files Coverage Δ
...th_app/lib/cards/data_cards/image_upload_card.dart 0.00% <0.00%> (ø)
...ib/cards/product_cards/product_image_carousel.dart 0.00% <0.00%> (ø)
...smooth_app/lib/data_models/product_image_data.dart 0.00% <ø> (ø)
..._lib/widgets/images/smooth_images_sliver_list.dart 0.00% <0.00%> (ø)
.../lib/generic_lib/widgets/smooth_product_image.dart 0.00% <0.00%> (ø)
...s/smooth_app/lib/helpers/product_cards_helper.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/pages/crop_helper.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/pages/image_crop_page.dart 1.35% <0.00%> (-0.04%) ⬇️
.../lib/pages/product/confirm_and_upload_picture.dart 0.00% <0.00%> (ø)
...h_app/lib/pages/product/edit_ingredients_page.dart 0.00% <0.00%> (ø)
... and 4 more

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

@monsieurtanuki
Copy link
Contributor Author

@omkarChend1kar ping

@omkarChend1kar
Copy link
Contributor

@omkarChend1kar ping

Hii @monsieurtanuki ,I didn't get you.

@AshAman999
Copy link
Member

@omkarChend1kar ping

Hii @monsieurtanuki ,I didn't get you.

I think it's time you review this PR!!

@@ -65,11 +65,7 @@ class _ProductImageSwipeableViewState extends State<ProductImageSwipeableView> {
context.watch<LocalDatabase>();
_product = _localDatabase.upToDate.getLocalUpToDate(_initialProduct);
final List<ProductImageData> allProductImagesData =
getProductMainImagesData(
_product,
appLocalizations,
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything looks good!!

Though ,If instance of AppLocalizations is not required anymore to get the list of ProductImagesData, Then it's declaration can be removed, Since not required anywhere else on this page.

@monsieurtanuki
Copy link
Contributor Author

Thank you @omkarChend1kar for your review!
Actually you're wrong, we still use it there: getImagePageTitle(appLocalizations, _imageDataList[index].imageField)
There would have been a warning if useless anyway.

@M123-dev @AshAman999 May you approve too? Not that I don't trust @omkarChend1kar, but for some reason I'm not able to merge even with one approval. Not enough seniority on this project maybe...

@omkarChend1kar
Copy link
Contributor

Thank you @omkarChend1kar for your review! Actually you're wrong, we still use it there: getImagePageTitle(appLocalizations, _imageDataList[index].imageField) There would have been a warning if useless anyway.

@M123-dev @AshAman999 May you approve too? Not that I don't trust @omkarChend1kar, but for some reason I'm not able to merge even with one approval. Not enough seniority on this project maybe...

Yeah, Right missed it completely.

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.

The first option looks like a good improvement. Does it degrade gracefully if translated texts are longer ?
Were translations already handled, I don't see any additional translated strings.

@monsieurtanuki
Copy link
Contributor Author

The first option looks like a good improvement. Does it degrade gracefully if translated texts are longer ?

You mean "edit before", right?
I'll check with lorem ipsum.

@teolemon
Copy link
Member

Nothing special, 1 review needed to merge.
image

@monsieurtanuki
Copy link
Contributor Author

Nothing special, 1 review needed to merge.

There seems to be different review colors, and the concept of "reviewer with write access":

  • Capture d’écran 2022-11-28 à 18 57 11
  • Capture d’écran 2022-11-28 à 18 58 26
  • Capture d’écran 2022-11-28 à 18 59 10
  • Capture d’écran 2022-11-28 à 18 59 34

@monsieurtanuki
Copy link
Contributor Author

We cannot display more than 2 lines in the title, but the overflow can be handled "in fade mode":
Capture d’écran 2022-11-28 à 20 21 56

@monsieurtanuki monsieurtanuki merged commit 8831337 into openfoodfacts:develop Nov 28, 2022
@monsieurtanuki
Copy link
Contributor Author

Thank you @omkarChend1kar @teolemon @AshAman999 for your help!

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.

None yet

5 participants