Page MenuHomePhabricator

Reposition Community Updates text when too long
Closed, ResolvedPublic2 Estimated Story Points

Description

Context
GrowthExperiments, Newcomer homepage, Community Updates

Current situation

image.png (434×545 px, 42 KB)

When text is too long, it will go to a new line.

Solution:

obraz.png (176×485 px, 16 KB)
obraz.png (220×296 px, 15 KB)

Potentially solvable by using CSS property float.

T386844#10615818

Acceptance Criteria:

The Community Updates Body text should align with the Title. If the text is long, it should wrap beneath the image, aligning with both the left edge of the image and the Call to Action text.

Event Timeline

KStoller-WMF moved this task from Inbox to Backlog on the Growth-Team board.

Thanks for filing this task, @valcio!

I agree that we should fix this layout.
FYI: @JFernandez-WMF

KStoller-WMF set the point value for this task to 2.
KStoller-WMF moved this task from Backlog to Estimated tasks backlog on the Growth-Team board.

thanks for filing this :)

I'd suggest we keep the text to the right. If it exceeds the space available on that side, then truncate the text - and to show the full version of it we can use the Tooltip component. thoughts?

If it exceeds the space available on that side, then truncate the text - and to show the full version of it we can use the Tooltip component.

Is truncation needed, I thought we already limit the characters via the CC form?

Correct me if I'm wrong, having only now looked closer into this, but isn't the issue that we always put the text below the image instead of next to it? This rather seems like a direct bug to me.

That being said, we do limit the text to 150 characters. Though if browser window is small, then we might still have not much space for those.

If it exceeds the space available on that side, then truncate the text - and to show the full version of it we can use the Tooltip component.

Is truncation needed, I thought we already limit the characters via the CC form?

I am assuming the number of lines varies depending on the screen size (e.g. a wider screen allows more characters per line)?

Note that the way this box is laid out, it would be hard to control it. I made some attempts using grid, but that didn't work well. Once I let go and just used a good old float, it just works. The text flows nicely, and you don't need to truncate it. See my layout proposal:

obraz.png (176×485 px, 16 KB)
obraz.png (220×296 px, 15 KB)

Also note that using "Read more" / "Learn more" is complicated in terms of doing it correctly in terms of UX/accessibility. Some articles on that:

Note that the way this box is laid out, it would be hard to control it. I made some attempts using grid, but that didn't work well. Once I let go and just used a good old float, it just works. The text flows nicely, and you don't need to truncate it. See my layout proposal:

obraz.png (176×485 px, 16 KB)
obraz.png (220×296 px, 15 KB)

Nice. This is exactly what I envisioned for this module. It looks better and uses the available space much better than the current layout.

Note that the way this box is laid out, it would be hard to control it. I made some attempts using grid, but that didn't work well. Once I let go and just used a good old float, it just works. The text flows nicely, and you don't need to truncate it. See my layout proposal:

obraz.png (176×485 px, 16 KB)
obraz.png (220×296 px, 15 KB)

that looks great, thanks so much! I think this is a great layout and can move forward with it.

Also note that using "Read more" / "Learn more" is complicated in terms of doing it correctly in terms of UX/accessibility. Some articles on that:

hm, good catch — thanks for pointing this out. since the label of the CTA is community configurable, I wonder if we can add a description on the field that advises to not use this language. what do you think @KStoller-WMF ?

In T386844#10625925, @JFernandez-WMF wrote:
hm, good catch — thanks for pointing this out. since the label of the CTA is community configurable, I wonder if we can add a description on the field that advises to not use this language. what do you think @KStoller-WMF ?

I assume the note about "Learn More" relates more to the fact that we currently use that as the example design in this task and also on related help pages: https://www.mediawiki.org/wiki/Help:Growth/Tools/Community_updates_module

Maybe we should just update the design on the help page?

Regarding the Community Configuration copy: we should aim to keep it concise, but I'm open to suggestions for improvement. While we don't want to be too specific, there’s definitely room to enhance clarity. For example, I'm unsure if terms like "Destination page" and "Label" are intuitive for admins completing the form. If you have any ideas for improving the copy, please add a task.

Change #1130566 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] fix(CommunityUpdates): avoid line break on long text

https://gerrit.wikimedia.org/r/1130566

Sgs moved this task from Incoming to Doing on the Growth-Team (Current Sprint) board.
Sgs added subscribers: AAlhazwani-WMF, Sgs.

Thanks for the suggestion @Nux, I've posted a change to apply it.

Screenshot 2025-03-24 at 12.46.53.png (484×930 px, 82 KB)
Screenshot 2025-03-24 at 12.47.04.png (486×942 px, 82 KB)
no justifyjustify

Should the text alignment be "justified"? cc @AAlhazwani-WMF

Screenshot 2025-03-24 at 12.46.53.png (484×930 px, 82 KB)
Screenshot 2025-03-24 at 12.47.04.png (486×942 px, 82 KB)
no justifyjustify

Should the text alignment be "justified"? cc @AAlhazwani-WMF

non-justified. for shorter texts, better to lean on left-/right-aligned text.

for context: justified text works okay for longer paragraphs of text, when hyphenation CSS rules are active, eg. word-wrap, overflow-wrap, and hyphens. such rules help in avoiding inconsistent spacing between words, which can lower legibility. it's even better when we can specify language-specific hyphenate-limit-chars, which is non-trivial for us, and the tech is not available yet.

Change #1130566 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] fix(CommunityUpdates): avoid line break on long text

https://gerrit.wikimedia.org/r/1130566

Etonkovidova subscribed.

Tested on enwiki beta

maxed out all fields - Title, Body text, and Call to action-Labelmaxed out all fields - no image
Screen Shot 2025-03-28 at 4.36.36 PM.png (534×908 px, 94 KB)
Screen Shot 2025-03-28 at 4.35.07 PM.png (528×932 px, 68 KB)
Light modeDark mode
Screen Shot 2025-03-28 at 4.29.34 PM.png (638×980 px, 98 KB)
Screen Shot 2025-03-28 at 4.33.01 PM.png (500×940 px, 90 KB)
Sidebar expandedSidebar hidden
Screen Shot 2025-03-28 at 5.00.43 PM.png (692×1 px, 163 KB)
Screen Shot 2025-03-28 at 5.00.54 PM.png (1×1 px, 236 KB)

Checked on wmf.23 - the screenshot below are from eswiki.

Before the fix (wmf.22)After the fix (wmf.23)
Screen Shot 2025-04-03 at 10.05.42 AM.png (1×1 px, 195 KB)
Screen Shot 2025-04-03 at 10.05.32 AM.png (864×2 px, 254 KB)
Screen Shot 2025-04-03 at 4.12.27 PM.png (658×2 px, 211 KB)

Works great on plwiki too. Thank you.

Works great on plwiki too. Thank you.

@Nux - thank you so much for confirming!