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: Please increase character limit on GCDS card badge #688

Open
3 tasks done
CraigClark opened this issue Nov 14, 2024 · 1 comment
Open
3 tasks done

feat: Please increase character limit on GCDS card badge #688

CraigClark opened this issue Nov 14, 2024 · 1 comment

Comments

@CraigClark
Copy link

CraigClark commented Nov 14, 2024

Prerequisites | Prérequis

Describe the feature request. | Décrivez la fonctionnalité demandée

This feature would allow more than 20 characters in the badge on a card.

Describe the use case. | Décrivez les cas d’utilisation

We are working on using GCDS in a Drupal site. We have cards that summarize the content behind them.
At the top of the rows of cards is a filter users can use to refine the list of available cards by category.

The names of categories is determined by business, not the design system.

If a category has more than 20 characters, nothing appears. This can be confusing to users as other cards do have badges.

Here is an example:

The card "World leading marine safety system" belongs to the category "Oceans protection plan". Since that exceeds the 20 character limit, no category displays.

Screenshot 2024-11-14 14-41-21

In some of our tests, the English label appears because it is under 20 characters, however the French label won't appear.

We tried a test where we added another field to the authoring interface where a user could add an abbreviated category. Shortening "Oceans protection plan" to "Oceans protection" works, " plan de protection des océan" doesn't.

Describe the preferred solution. | Décrivez la solution souhaitée

The badge prop will allow for more than 20 characters. The design will support this by allowing the blue bar to expand to more than one line if necessary, pushing down the rest of the content.

Describe all alternatives. | Décrivez toutes les solutions possibles

Write our own component

This would work as we could control what goes in the badge area. However it goes against the purpose of a component based design system.

Don't use the badge prop

We could choose not to use the badge and stick the category in the slot. Ideally though the category is more obvious to the user that that.

Shorten badge text

We tried this, it failed for reasons previously explained.

Programmatically truncate categories so they don't display more that 20 characters

We tried this, there were unpredictable results, especially in French.

Provide related code or examples. | Fournissez du code ou des exemples pertinents

This is what we would like to see

extra-characters

Add other relevant resources. | Ajoutez toute autre ressource utile

I understand the desire to have a concise badge. However the use states:

The badge (optional) is a visual indicator to inform users of the card's status or category. Badge text should be no more than 20 characters.

Many categories for things are going to exceed 20 characters.

@melaniebmn
Copy link
Collaborator

@CraigClark Thanks for reaching out and submitting this issue. We have started discussions around this as a team and while we don't have an easy fix for now, it surfaces some of the use cases lacking support around character limits and text overflow. We will look into increasing the character limit and get back to you once we have released a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants