Page MenuHomePhabricator

Message: icons can get cut off depending on message text length
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
matmarex
Jul 3 2025, 3:53 AM
Referenced Files
F65693957: image.png
Jul 30 2025, 7:04 PM
F65686785: image.png
Jul 28 2025, 6:20 PM
F65686780: image.png
Jul 28 2025, 6:20 PM
F65686782: image.png
Jul 28 2025, 6:20 PM
F65686778: image.png
Jul 28 2025, 6:20 PM
F65678050: image.png
Jul 26 2025, 9:21 PM
F65677620: Screenshot 2025-07-26 at 9.06.27 PM.png
Jul 26 2025, 5:08 PM
F65677617: Screenshot 2025-07-26 at 9.05.47 PM.png
Jul 26 2025, 5:08 PM

Description

Icons on mw.notification popups are cut off. The "i" should be in a circle. For example on https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?useparsoid=1:

Steps to replicate the issue (include links if applicable):

What happens?:

The info icon is cut off because it's too narrow to show the entire mask image. Note that the mask-size is 20px and the width is 16.55px.

Screen Shot 2025-07-03 at 05.51.47.png (138×256 px, 5 KB)

Screenshot 2025-07-07 at 9.21.46 AM.png (228×628 px, 24 KB)

Screenshot 2025-07-07 at 9.21.40 AM.png (772×1 px, 129 KB)

What should have happened instead?:

The entire icon should display. The icon span's width and the mask-size should be the same (20px):

image.png (238×602 px, 25 KB)

Software version: Codex 2.2.0

This is happening because the icon is shrinking to accommodate the message text. We need to ensure the icon never shrinks in the flex layout.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Izno added subscribers: ekrem, A_smart_kitten.
Izno subscribed.

This is happening in other messages, as indicated in the merged task.

Izno changed the subtype of this task from "Task" to "Bug Report".Jul 3 2025, 9:12 PM

fwiw, this could be a temporary solution :3

AnneT updated the task description. (Show Details)
AnneT renamed this task from Icons on mw.notification popups are cut off to Message: icons can get cut off depending on message text length.Jul 7 2025, 4:29 PM

Change #1166868 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Message, styles: Ensure icon never shrinks

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

Thanks everyone for reporting this and @ekrem for the workaround - I've applied that fix in the Codex Message component.

To reproduce on localhost:

image.png (558×810 px, 66 KB)

AnneT changed the task status from Open to In Progress.Jul 8 2025, 12:30 PM

Change #1166868 merged by jenkins-bot:

[design/codex@main] Message, styles: Ensure icon never shrinks

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

Change #1171718 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v2.2.0 to v2.2.1

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

Change #1171718 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.2.0 to v2.2.1

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

Despite the Codex patch, this does not seem to be fixed.

The above update will have missed the train for this week. Did you check the live wikis?

i'm sorry for not reporting this earlier, but on azwiki, where the change resides in common.css, the fix doesn't affect the minerva skin (see fig. 1). it just doesn't get loaded, and it doesn't appear in the computed styles section in the devtools of the browser (see fig. 1); i don't know why. such an issue isn't present on my local wiki (see fig. 2 and 3).

Screenshot 2025-07-26 at 9.07.31 PM.png (1×1 px, 437 KB)
Screenshot 2025-07-26 at 9.05.47 PM.png (806×784 px, 126 KB)
Screenshot 2025-07-26 at 9.06.27 PM.png (444×628 px, 50 KB)
fig. 1fig. 2fig. 3

i'm sorry for not reporting this earlier, but on azwiki, where the change resides in common.css, the fix doesn't affect the minerva skin (see fig. 1).

The mobile website does not load Common.css. Minerva on the desktop website is fine.

image.png (362×882 px, 39 KB)

i'm sorry for not reporting this earlier, but on azwiki, where the change resides in common.css, the fix doesn't affect the minerva skin (see fig. 1).

The mobile website does not load Common.css. Minerva on the desktop website is fine.

image.png (362×882 px, 39 KB)

yeah i just realized that it says «except for mobilefrontend» on mediawiki.org, thanks!

matmarex added a subscriber: gengh.

Despite the Codex patch, this does not seem to be fixed.

The above update will have missed the train for this week. Did you check the live wikis?

I guess I did, thanks. It seems to be fixed on the beta cluster:

This fix now breaks icon height, because Vue icon styles override message styles:

.cdx-message .cdx-message__icon, .cdx-message .cdx-message__icon--vue {
  height: var(--line-height-medium,1.625rem);
}
.cdx-message--warning .cdx-message__icon {
  min-width: 10px;
  min-height: 10px;
  width: calc(var(--font-size-medium,1rem) + 4px);
  height: calc(var(--font-size-medium,1rem) + 4px);
  display: inline-block;
  vertical-align: text-bottom;
}

For example, see warning message in the hidden diff.

image.png (69×128 px, 1 KB)

(boldly moving back to the Codex inbox given the above)

For example, see warning message in the hidden diff.

image.png (69×128 px, 1 KB)

I was able to reproduce. But FYI, this new bug is only in Vector 2022. The old bug was also in other skins.

Bisecting/testing locally, it looks like the new issue might be a separate regression from 8aafb2a333. I'll let the Codex maintainers decide whether it should be split into a new bug report or not :)

@AnneT do you mind taking a look at this and determining what needs to be done?

There's a number of things slightly off here, that lead to this weird vertical icon sizing

  1. The min-sizes of the icons are off. That is not fixing the issue but adds to the confusion. They should be set alongside the font mode values and aligned to the icon sizes. This would not fix the issue though
  2. In 'css-icon.less' mixin the calculated min-size is wrong. It should not be 10px at medium icon size. This would not fix the issue though.
  3. In T396519 a use of line-height was introduced to vertically align the icon with the surrounding text. This override is now shrinking the Message icon in certain contexts.

We should fix all three things in order for the code to be simpler readable. Next I will file tasks around this.

matmarex added a subscriber: Catrope.

@AnneT do you mind taking a look at this and determining what needs to be done?

It looks like Anne is on leave until end of year. Her profile says to contact @Catrope for Codex stuff.

This should be fixed by the changes made in the subtask. Some of the changes are live already, the rest will be deployed next week, on the usual schedule (Tuesday-Thursday).