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: Improve KP tables layout #6080

Merged
merged 5 commits into from
Dec 29, 2024
Merged

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Dec 29, 2024

Hi everyone!

KP tables often seem not well-balanced.
This PR tries to improve them:

1
2
3

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 100 lines in your changes missing coverage. Please review.

Project coverage is 6.42%. Comparing base (4d9c7fc) to head (eab5342).
Report is 590 commits behind head on develop.

Files with missing lines Patch % Lines
...l/knowledge_panels/knowledge_panel_table_card.dart 0.00% 96 Missing ⚠️
...ackages/smooth_app/lib/helpers/html_extension.dart 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #6080      +/-   ##
==========================================
- Coverage     9.54%   6.42%   -3.13%     
==========================================
  Files          325     445     +120     
  Lines        16411   25297    +8886     
==========================================
+ Hits          1567    1625      +58     
- Misses       14844   23672    +8828     

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

@teolemon
Copy link
Member

@g123k do you have a screenshot of the nutrition table (eg for "milumel") ?

@g123k
Copy link
Collaborator Author

g123k commented Dec 29, 2024

Here's what it looks like:
Untitled

I force the content to be centered with percent or per 100g

@teolemon
Copy link
Member

Why not centering deviation to category values as well ? And the 100g title ? @g123k

@g123k
Copy link
Collaborator Author

g123k commented Dec 29, 2024

The problem is that sometimes it's OK to center and sometimes not.
Contrary to per 100g / percent, where I can easily detect the content, it's harder for the last one because the cell text is dynamic (according to the language).

It would be better if the API could provide a % for each column (and not let us guess it) and the same goes for the alignment.

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.

Approved @g123k

@teolemon teolemon merged commit f53938c into openfoodfacts:develop Dec 29, 2024
6 checks passed
@g123k g123k deleted the kp_table branch December 30, 2024 10:50
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