Page MenuHomePhabricator

InfoChip, InputChip: Update max-width to @size-full
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

At the moment, both InfoChip and the InputChips used within ChipInput are 512px max-width. InfoChip is intended to display brief, informative content, but we can rely on guidelines to recommend keeping the text short. InputChips, however, often include user-generated content (like long names entered in ChipInput or selected from MultiselectLookup) so allowing longer text makes more sense.

In addition, the InputChip in ChipInput overflows the input when the text exceeds the available space:

Captura de pantalla 2025-03-20 a las 12.09.30.png (408×202 px, 26 KB)

This task is to update the max-width from both of them to use @size-full so they can adapt to the width of their container.

Acceptance criteria (or Done)

  • Update InfoChip and InputChip max-width to @size-full
  • Update the Figma component accordingly

Event Timeline

Change #1128407 had a related patch set uploaded (by Bmartinezcalvo; author: Bmartinezcalvo):

[design/codex@main] docs: update InfoChip max-width

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

Change #1128468 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] InfoChip, styles: Reduce `max-width` to 256px

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

Change #1128468 abandoned by VolkerE:

[design/codex@main] InfoChip, styles: Reduce `max-width` to 256px

Reason:

abandoned for I8545ec37d9039afbcbdd84ef4eb0a0e63ef5dd1d

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

From the insights @AAlhazwani-WMF gave us, Abstract Wikipedia is dealing with real long InfoChips but would be open to reconsider if these chips are the correct component usage.
One thing is even clearer than before. While we can easily reduce the max-width we also have no current way of exposing the full value of an ellipsed chip besides being a developer and inspecting the chip :/
By reducing the max width, more chips could be running into this cut-off. Having any handle to help in this situation, even though the recommendations are pointing at short descriptions might be worth a follow-up task.

Volker_E renamed this task from InfoChip: update max-width to InfoChip: Reduce `max-width` to `256px` from current `512px`.Mar 17 2025, 7:12 PM
Volker_E added a project: Design.
Volker_E set the point value for this task to 1.

To ensure consistency between InfoChip and the InputChips used within ChipInput and avoid issues with text length, we've decided on removing the current 512px max-width from both components. This will allow them to expand as needed based on the text length.

For InfoChip which is intended to display brief, informative content, we will rely on guidelines to recommend keeping the text short without enforcing a strict limit. InputChips, however, often include user-generated content (like long names entered in ChipInput or selected from MultiselectLookup) so allowing longer text makes more sense.

I will update the patch to include these changes in InfoChip and InputChip.

bmartinezcalvo renamed this task from InfoChip: Reduce `max-width` to `256px` from current `512px` to InfoChip and InputChip: Remove max-width.Mar 19 2025, 6:08 PM
bmartinezcalvo updated the task description. (Show Details)

To ensure consistency between InfoChip and the InputChips used within ChipInput and avoid issues with text length, we've decided on removing the current 512px max-width from both components. This will allow them to expand as needed based on the text length.

For InfoChip which is intended to display brief, informative content, we will rely on guidelines to recommend keeping the text short without enforcing a strict limit. InputChips, however, often include user-generated content (like long names entered in ChipInput or selected from MultiselectLookup) so allowing longer text makes more sense.

I will update the patch to include these changes in InfoChip and InputChip.

Can we make sure to test what will happen if the chips are wider than the parent container? If we're removing the max width entirely instead of doing something like applying a max width of 100% (with ellipses truncation), wouldn't really long chips overflow the inputs / parent containers? I thought that's something we wanted to avoid, like in T310158.

@CCiufo-WMF The plan is actually to replace the current max-width value with @size-full instead. Additionally, regarding T310158: Button, ButtonGroup: solve max-width and text issues, I wonder if we should update Buttons to use @size-full for max-width as well?

I've updated the max-width of both InfoChip and InputChip to @size-full to adapt to the width of their container. This will address the issue highlighted in this task T373747: ChipInput: Chips with long aliases overflow from the border input box. Check the demo.

Additionally, I've created this task T389475 to use a Tooltip when the text of these chips exceeds the available space.

bmartinezcalvo renamed this task from InfoChip and InputChip: Remove max-width to InfoChip and InputChip: Update max-width to @size-full.Mar 20 2025, 11:06 AM
bmartinezcalvo updated the task description. (Show Details)
bmartinezcalvo added subscribers: Amire80, GrounderUK.

Additionally, regarding T310158: Button, ButtonGroup: solve max-width and text issues, I wonder if we should update Buttons to use @size-full for max-width as well?

Yes, definitely! I believe @bmartinezcalvo already did that in her Button/ButtonGroup patch.

CCiufo-WMF renamed this task from InfoChip and InputChip: Update max-width to @size-full to InfoChip, InputChip: Update max-width to @size-full.Mar 21 2025, 2:53 PM

Change #1128407 merged by jenkins-bot:

[design/codex@main] styles: update InfoChip and InputChip `max-width`

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

Change #1133258 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/core@master] Update Codex from v1.21.1 to v1.22.0

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

Test wiki created on Patch demo by Eric C Gardner using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/59d55f2723/w/

Change #1133258 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.21.1 to v1.22.0

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

Test wiki on Patch demo by Eric C Gardner using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/59d55f2723/w/