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

fix: 4231 - "new product" scan card with display flexibility #4232

Merged
merged 2 commits into from
Jun 25, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Added flexibility so that the texts of the "new product" scan card always fit in the remaining space of the card after you put the "x" button (top) and the action button (bottom). Therefore no overflow on small screens.
  • Just using AutoSizeText and Expanded

Screenshot

before after larger screen
Screenshot_2023-06-25-08-47-07 Screenshot_2023-06-25-09-24-01 Screenshot_2023-06-25-09-29-52

Fixes bug(s)

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2023

Codecov Report

Merging #4232 (2b53f68) into develop (95c3a67) will decrease coverage by 0.07%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #4232      +/-   ##
===========================================
- Coverage    11.00%   10.94%   -0.07%     
===========================================
  Files          282      282              
  Lines        14015    14092      +77     
===========================================
- Hits          1543     1542       -1     
- Misses       12472    12550      +78     
Impacted Files Coverage Δ
.../cards/product_cards/smooth_product_base_card.dart 0.00% <0.00%> (ø)
...s/product_cards/smooth_product_card_not_found.dart 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

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

@teolemon
Copy link
Member

Can we circle the close cross ?
https://link.medium.com/nA5CBbWIUAb

@teolemon
Copy link
Member

Screenshot_20230625-102411.png

Impacted files:
* `smooth_product_base_card.dart`: added an optional `iconData` parameter
* `smooth_product_card_not_found.dart`: specific "circled cross" icon parameter
@monsieurtanuki
Copy link
Contributor Author

Can we circle the close cross ?

Done.

@teolemon
Copy link
Member

Would you have a screenshot of how it looks @monsieurtanuki ?

@monsieurtanuki
Copy link
Contributor Author

Would you have a screenshot of how it looks @monsieurtanuki ?

Not for the moment: I just quickly changed the code and used a different icon:
Capture d’écran 2023-06-25 à 15 04 16

"My" icon does not have the "strong X and light circle" effect mentioned in your link, and I don't know how relevant it is to you.
Beyond that, the same "close header with strong X" is used in other places in the code (in the full size product page and the question card), and it leads to other questions:

  • should we use the same "X" icon in all places?
  • if not, which icons where?
  • in general, should we have a unique "X" icon in the app for similar actions? (e.g. remove a product from a list)

Which goes beyond the purpose of the PR - and I have a limited access to my computer.

@teolemon
Copy link
Member

Ok, let's try as is.

@monsieurtanuki monsieurtanuki merged commit a281b6c into openfoodfacts:develop Jun 25, 2023
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

Don't hesitate to create an issue regarding the consistency of "X" icons if relevant.

@teolemon teolemon added Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. scan card labels Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. scan card
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overflow of new product scan card on small devices
3 participants