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(DH): Make font-sizes and colors same across the expandable panel #660

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

Angi-Kinas
Copy link
Collaborator

@Angi-Kinas Angi-Kinas commented Oct 24, 2023

Changed the font-size and color as proposed to:
image

Also made opening of the panel faster.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

Affected libs: ui-elements, feature-catalog, feature-record, feature-router, feature-search, feature-map, feature-dataviz, ui-catalog, ui-search, ui-layout,
Affected apps: metadata-editor, datahub, demo, webcomponents, search, map-viewer,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

@coveralls
Copy link

coveralls commented Oct 24, 2023

Coverage Status

coverage: 86.546% (+4.7%) from 81.812% when pulling f6c3fe5 on DH-fix-bug-font-size into f87f421 on main.

@fgravin
Copy link
Member

fgravin commented Oct 24, 2023

Thanks @Angi-Kinas
Some remarks regarding the mockup:

1. D’où viennent ces données ?

  • Margin between labels and values are too big
  • The text, before the grid is not black
    image

2. Licence ou conditions d’utilisation ?

  • Text should be small
  • Would be good to have the label stuff, if possible. Meaning we should be able to categorize the licence into a label.
    image

3. Détails
The right margin after the icon seems too big

Overall, fonts are 14px & 16px, but it's hard to understand strictly the mockup as the font is completely different 😄

@tkohr
Copy link
Collaborator

tkohr commented Oct 24, 2023

Thanks @Angi-Kinas ! I'm wondering if the font sizes are not ok in this PR though @fgravin...

1. D’où viennent ces données ?

* The text, before the grid is not black

I think this will be handled by the theming config, no?

2. Licence ou conditions d’utilisation ?

* Text should be small

Lucile lately proposed in a JIRA comment to put it in primary color (and then same size as primary text in other panels, I guess). It would look more consistent if there was also a label inside the panel I guess. But primary in 14px won't look consistent neither I think.

Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

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

All good on my side, thanks!

@@ -32,27 +35,30 @@
*ngIf="metadata.lineage"
[title]="'record.metadata.origin' | translate"
>
<p class="mb-5 pt-4 whitespace-pre-line break-words" gnUiLinkify>
<p
class="text-gray-900 mb-5 pt-4 whitespace-pre-line break-words"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought, we would let the config set the main color here (as well as in the abstract above), but maybe I'm wrong (cc @fgravin @jahow)

@@ -4,11 +4,12 @@
>
record.metadata.about
</p>
<div class="mb-6 md-description sm:mb-4 sm:pr-16" *ngIf="metadata.abstract">
<div class="text-gray-900 mb-6 md-description sm:mb-4 sm:pr-16">
Copy link
Member

Choose a reason for hiding this comment

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

The text should be the main text color, I think it means that no color class is required.
We should not use text-gray things I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The text should be the main text color, I think it means that no color class is required. We should not use text-gray things I guess.

the gray-900 is derived from the main color, so that should not be a problem. the main color is almost black and here we wanted a lighter color (as you also mentioned in your review).
cc @tkohr

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I thought using the main color would allow more consistence with other components, but looking at the card on the home page we also use the derived text-gray-900, so it seems ok to me, as long as we try to stay consistent with the derived grays ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Why do you remove *ngIf="metadata.abstract" ? Is it the abstract container or not ?

And yes, the abstract should have the main color, and not text-gray-900 I guess.

I think the colors are:

  • Abstract title: black
    Abstract content: main

  • D’où viennent ces données ? title: black
    Text underneath: main
    Property label: grayer
    Property color: primary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ngIf was not removed but just moved to the paragraph. Otherwise the content ghost will not be shown.

Regarding the colors:
main is almost black, so compared to the mockups it would be too dark.
image

Maybe we shouldn't use pure black but main because pure black is apparently bad practice and it's not dependent on the theme.

{{ metadata.lineage }}
</p>
<div
class="py-4 px-6 rounded bg-gray-100 grid grid-cols-2 gap-y-[10px] gap-x-[20px] text-gray-700 info-grid"
>
<div *ngIf="metadata.recordUpdated">
<p class="text-sm" translate>record.metadata.updatedOn</p>
<p class="text-primary font-medium mt-2">
<p class="text-primary font-medium mt-[4px]">
Copy link
Collaborator

Choose a reason for hiding this comment

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

mt-1 should be the same I think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is more explixit to put it in px, because it reflects what is in the mockup. In terms of generated css it's almost the same.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, so far we've privileged the non interpolated values (also for the lightest CSS possible, I think). I don't have a strong opinion on this, but maybe we should agree on a best practice.

@Angi-Kinas
Copy link
Collaborator Author

@fgravin and @tkohr Thanks for the review.
@fgravin I added most of your suggestions (see screenshot).

To point 2:

  • As Lucile mentioned in the ticket that she wanted to change the way this is being displayed so it will be aligned with the other panels (in blue).
  • the badge is only set if the flag is true. It would be too hacky to retrieve it from the text as it is right now.

Also:
Olivia and I discovered that there was another bug. The content ghost for the abstract was not shown. We fixed this as well.

@Angi-Kinas Angi-Kinas merged commit f8b9e53 into main Oct 24, 2023
7 checks passed
@Angi-Kinas Angi-Kinas deleted the DH-fix-bug-font-size branch October 24, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants