Page MenuHomePhabricator

Fix display of description (when long)
Closed, ResolvedPublic2 Estimated Story Points


At the moment, template descriptions are truncated to one line (with ellipsis added) and the whole description is displayed when the user hovers anywhere in the title box area.

This should be changed to show one line (with ellipsis when appropriate), and no hover effect (with the only way to see the full description being to click on the link). See mock for where the description goes. The current work is up on commtech wiki.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 27 2018, 9:40 AM
Niharika updated the task description. (Show Details)Jun 28 2018, 8:22 PM
Niharika added a subscriber: Niharika.

@Samwilson I've clarified the description - we should only have one line with ellipsis to truncate text. And no hover effect.

There is an issue with the no-templatedata message:

If there's no hover, then there's no way to view the rest of the orange message.

We could do an approximation of truncating to two lines by making it wrap, and setting the height of the box to be just right so that it falls between the 2nd and 3rd lines. That might be slightly fragile across devices, and wouldn't give the ellipsis. Or we could do that fading out thing that some sites do, with an opacity gradient.

@Samwilson I'm wondering what's the worst case length if we show the entire description. I'm gonna look for some examples but if you know of any, lemme know.

We could add a "read more" link under (or at the end) of the template description that sends people to the template page, and with that, get rid of the need to show long descriptions anyways?

The distribution of description lengths on enwiki:

description length (in characters)template count

The longest description is for Template:Version and has 993 characters.

Our no-templatedata message has 130 characters.

Should I run the same thing for other languages?

Thanks for all the info, Sam. I think that gives us plenty to work with but it would be nice to have the same data for a couple more languages too, maybe German and Hebrew. Is this a database query? Can you dump the query here, in that case?

No it's a hacky PHP script that uses the API. I'll get it online soon. The raw data is:

I'm not sure if there are dewiki and hewiki subpages that should be excluded. In enwiki, I'm ignoring /doc and /sandbox, as these both often have templatedata but we don't care about it.

Anyway, including all templatedata:


Looking at the data - It seems like most templates on English have ~300 characters in the template description. Looking at the German and Hebrew data, I think we can safely say that for most other sites, most template descriptions would be fall well under 300 characters.

Besides, it seems like we haven't yet quite come down to the perfect dimensions for the dialog. Here's what I see on commtech:

which seems wider than what Sam sees: T198291#4323393

Currently, for me, one full line fits ~120 characters (random characters, non-monospace font). Our message for missing descriptions (Due to missing TemplateData, parameters for this template have been auto-generated. Please be aware that they may not be accurate.) is 131 characters.

Based on this info, it seems like we should go with the simplest solution for now - show the entire description without any clipping. We can come back to this ticket later if we feel like we need to explore other design options based on our experience and user feedback.

@cmadeo thoughts?

@Niharika, can we extend the grey header without the hover animation or without covering text in the two columns below it?

@Niharika, can we extend the grey header without the hover animation or without covering text in the two columns below it?

Yes, that's what I meant. Let's expand the header to show the full description. It'll typically be around 3 lines for English wikipedia but less for others.

@Niharika that works for me!

kaldari set the point value for this task to 2.Jul 3 2018, 11:39 PM
Samwilson claimed this task.Jul 9 2018, 6:07 AM
Samwilson edited projects, added Community-Tech-Sprint; removed Community-Tech.

Change 444794 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Set max-height for description and remove hover effect

Change 444794 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Set max-height for description and remove hover effect

Niharika closed this task as Resolved.Jul 27 2018, 12:47 AM
Niharika moved this task from QA to Q1 2018-19 on the Community-Tech-Sprint board.