Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
22 stars 12 forks source link

[Task] Update the challenge card to display the entire headline #2320

Closed tschaffter closed 10 months ago

tschaffter commented 10 months ago

What product(s) is this story for?

OpenChallenges

As a user, I want

NA

Description

The currently AI-generated headlines should have ten words or less. Depending on the number of characters in the headlines, it may not be entirely visible as in the example shown below.

The goal of the ticket is to increase the space for headlines from 2 to 3 lines on the challenge cards. If this is still not enough for a headline to be fully visible, the headline should be modified. Meanwhile, keeping the code that truncate headlines and adds "..." should be kept.

Acceptance criteria

No response

Tasks

No response

Anything else?

No response

Have you linked this story to a GitHub Project?

tschaffter commented 10 months ago

I tried to set in _general.scss:

.mat-caption {
  @include line-clamp(3);
}

but the headlines are still truncated. I now remember that the headlines are truncated when data are exported from the OC spreasheet.

Here is the data/API schema for the headline:

description: The headline of the challenge.
type: string
minLength: 0
maxLength: 80
example: Example challenge headline

Using the browser tools, I counted that we can fit 49 chars per line on the default size of the card. Do all character take the same width? Of course, depending on the size of the words in a given sentence, it's unlikely that the entire size will be used.

We could increase the headline length from 80 to 120, the remaining (3*49 - 120 chars) could be used as buffer. The spreadsheet should be updated to prevent headlines from being longer than 120 chars if that's the size we agree upon.

vpchung commented 10 months ago

Spreadsheet has been updated to include data validation on the headline (120 characters or less). For the currently existing headlines that are longer than this limit, should they be removed?

Any headlines that are over 120 characters will also be highlighted red. We should eventually revisit the highlighted headlines to further truncate the summary.

tschaffter commented 10 months ago

Sounds like a plan!

vpchung commented 10 months ago

After looking at the proposed design, we have decided to stick with 80 characters as the max limit.

Can this ticket be closed? @tschaffter