Page MenuHomePhabricator

Toast: improve design when text is longer
Open, LowPublic

Assigned To
None
Authored By
AnneT
Mar 9 2026, 8:13 PM
Referenced Files
F73658089: Captura de pantalla 2026-03-25 a las 11.39.55.png
Wed, Mar 25, 10:40 AM
F73658028: Captura de pantalla 2026-03-25 a las 11.39.41.png
Wed, Mar 25, 10:40 AM
F72134838: image.png
Wed, Mar 25, 10:40 AM
F73573041: Screenshot 2026-03-24 at 16.39.25.png
Tue, Mar 24, 8:40 PM
F73573039: Screenshot 2026-03-24 at 16.39.01.png
Tue, Mar 24, 8:40 PM
F73572989: Screenshot 2026-03-24 at 16.33.53.png
Tue, Mar 24, 8:40 PM
F73572973: Screenshot 2026-03-24 at 16.31.17.png
Tue, Mar 24, 8:40 PM
F72790232: Screenshot 2026-03-06 at 15.12.48.png
Mar 10 2026, 8:57 AM

Description

When the Toast text is long, the action should stack so both Toast content and button text can be read.

Captura de pantalla 2026-02-16 a las 15.07.18.png (698×572 px, 67 KB)
image.png (212×748 px, 56 KB)
Current behaviorExpected behavior

This is particularly important on mobile. However, it is possible to reproduce on desktop when the action button text is long:

Screenshot 2026-03-05 at 3.39.53 PM.png (466×1 px, 52 KB)

We also need to avoid this, where the icon and text are no longer paired together:

Screenshot 2026-03-06 at 15.12.48.png (258×816 px, 34 KB)

One difficulty is that the most effective solution would be to change the markup of the Message component, used within Toast, to wrap the icon and text in a new element to separate them from the action button. However, changing the Message markup would be a breaking change to the CSS-only version, which is used in several places. We should not do so unless absolutely necessary as it would require a major version update. IMO, we can find a way to improve the Toast UX enough that it's legible and looks decent without a breaking change.

Acceptance criteria

  • Toast message text and action button text are both legible on all viewport sizes even when the text of either/both is long

Event Timeline

Its very important that the icon stays with the text.

So not like this:

Screenshot 2026-03-06 at 15.12.48.png (258×816 px, 34 KB)

We need to see if that is possible without wrapping the icon + content inside a div.

AnneT updated the task description. (Show Details)

@DSmit-WMF @AnneT what if we did something like this?

Screenshot 2026-03-24 at 16.31.17.png (310×1 px, 47 KB)

Screenshot 2026-03-24 at 16.33.53.png (256×1 px, 26 KB)

Screenshot 2026-03-24 at 16.39.01.png (250×1 px, 26 KB)

Screenshot 2026-03-24 at 16.39.25.png (196×1 px, 17 KB)

Design wise, I don't mind this layout, except when there is only the icon and content. It does take up more vertical space, but it is more mobile and long content friendly. It's not terrible with short content. It's not perfect. This is done by changing the display on __message to flow within the Toast, along with some other small margin changes to align the text and button. Some questions if we did this:

  • Would this be the layout all the time?
  • Should this be the layout only if the action is present? Is that too complicated or potentially changing unnecessarily?

What do you think?

I would recommend following the original design sine it's more aligned with other conversational components (e.g. Dialog, Popover) where the actions appear aligned on the right.

image.png (212×748 px, 56 KB)

Captura de pantalla 2026-03-25 a las 11.39.41.png (516×1 px, 69 KB)

Captura de pantalla 2026-03-25 a las 11.39.55.png (440×474 px, 38 KB)

Thanks for weighing in Bárbara. A couple thoughts:

  • I'm not sure the original design is working, and the right alignment feels odd to me.
  • There is also this task reconsidering the position of the buttons in Dialog and Popover, which might be worth doing now.

I agree that right alignment can feel slightly off in some cases. To maintain consistency, I would align this with the rest of the conversational elements. So if we move the buttons to the left in T358359, I would agree on applying this approach to this Toast as well.

Okay, curious what @DSmit-WMF and @AnneT think, and if they agree with this, I'm happy to put some patches together, but might need some help with the Toast one if my above approach is not the right one or if we need to put more dependencies on there to adjust the layout based on props, etc.

DTorsani-WMF moved this task from Backlog to Design Review on the Codex board.