Page MenuHomePhabricator

Function editor: Aliases component improvements
Closed, DeclinedPublic

Description

Preamble

While fixing a couple of bugs related to function name aliases, we raised a series of interesting questions on this specific component:

  • How might we edit existing aliases?
  • What if an alias already exists?
  • What if we end up with a long list of aliases?

Design proposal

This proposal tries to address these exact questions, and explores potential improvements to the aliases component.

The linked Figma file includes the following scenarios (on both mobile web and desktop):

  • A1 Add Alias
  • B1 Add alias to an existing list
  • C1 Display numerous aliases
  • D1 Add existing alias

Notes on design

  • For the time being is not possible to edit an existing alias, but editors can remove the existing alias, and add a new one to substitute it.
  • The visual design of the pills (or chips/tags) component is not final yet (aka Codex approved)
  • With time, if we notice that the aliases component is heavily used, we will explore better solutions to display numerous items, maybe off page instead of in page.

Event Timeline

AAlhazwani-WMF renamed this task from Funtion editor: Aliases component improvments to Function editor: Aliases component improvements.Sep 20 2022, 11:11 AM
AAlhazwani-WMF updated the task description. (Show Details)

@JKieserman JFYI I updated the existing alias flow D1 to make it less red, aka less worring.

IMG_1859AC14C03D-1.jpeg (964×1 px, 465 KB)

Change 833452 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/extensions/WikiLambda@master] update alias styles

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

I see some issues with current field

Style - Desktop

  1. Not sure what's the cross icon inside of the input field for. I would imagine that clears the field, but it doesn't do any action, and also there's a "Cancel" button on the right so adding a button to clear the field seems a bit unnecessary.
  2. When there's many alias and we show the hide+add buttons, they are pushed to the right so the texts don't show. There's definitely space to show the whole buttons, but if there's not, the figma designs show how we should push the buttons to a new line similarly to the design on mobile.

Screenshot from 2022-10-05 16-26-13.png (535×1 px, 63 KB)

Style - Mobile

  1. According to the mobile designs in figma, the input fields should go on a new line under the input labels, so that the fields occupy 100% of the screen. This is not happening for any field. In the case of the aliases, this is compressing the label "Aliases (optional)", the alias collection, and the buttons, on the same row, when it should be a line jump between label-aliases and another between aliases-buttons.
  2. This also means that when showing the input field, the buttons are out of screen.

Screenshot from 2022-10-05 16-18-05.png (826×448 px, 61 KB)

Screenshot from 2022-10-05 16-17-44.png (826×460 px, 59 KB)

Screenshot from 2022-10-05 16-17-01.png (821×443 px, 50 KB)

Behavioral

  1. The only way to accept an input is to press the "Add" button. While I believe that's good to have a visually explicit CTA instead of implicit hidden behaviors, it would be useful to provide other ways of input "E.g. when pressing the ENTER key"
  2. I feel that adding a collection of aliases has become more time taking, more accessible and less comfortable. Instead of write a series of strings in an input field, now I need to do:
    • click a button to see the field
    • go to keyboard and write a string
    • go to mouse and click a button to add
    • click another button to add another one
    • etc. Can we think again how to make this process more dynamic? For example, do we need to click "Add alias" to see the input field? Does the input field need to disappear every time I add an alias making me have to click "Add alias" again?

cc @AAlhazwani-WMF

Hi all! Here's a proposal for the alias component

Screen Shot 2022-10-19 at 5.02.06 PM.png (704×1 px, 134 KB)

If you try to enter a tag that’s already entered, it will be removed (like in this video)

YAY, thank you so much @SWoodruff-WMF for quickly taking care of this. I have a couple of follow up questions, just wanted to make sure I understand this correctly:

  1. Is the "x" highlighted in the screenshot below for clearing the "sum" string? If yes, we could use the style defined by the Codex design system. I wondering if it's clear that you're going to clear just "sum" instead of the whole input field. I'm not sure about this. What do you think?

CleanShot 2022-10-20 at 12.37.44@2x.png (1×610 px, 152 KB)

  1. How do you enter an alias? Let's say I type "addition, summatory, plus", what should I do next? Maybe press the return key on your keyboard? Also, something that Edmund notice while watching this recording is that an alias is not added if you simply move focus to another field. Maybe is it worth to specify also this scenario?
  1. Is the "x" highlighted in the screenshot below for clearing the whole input field? If yes, might this go in conflict with the previous case for clearing a single string?

CleanShot 2022-10-20 at 12.45.52@2x.png (1×628 px, 166 KB)

  1. JFYI the style of the alias chip/pill/tag is not coming directly from the Codex design system, I quickly put something together to move this forward as there was no component available. Feel free to change it as you see fit, and/or reach out to the design system folks for support, you can find them here.
  1. (But also 3.) Ah, I missed that, will use that instead!

Screen Shot 2022-10-20 at 11.04.05 AM.png (1×1 px, 145 KB)

I think this should be used to clear the whole input field? If you want to clear the partially typed item, you could use the delete key, seems like it would be more of a hassle to press each and every x if you wanted to clear all aliases.

  1. I think hitting comma again, or hitting enter should both be supported. Moving focus to another field should also create it.
  1. Sounds good, I'll reach out on slack

JFYI GitHub Primer design system features the same exact component :) https://primer.style/react/TextInputWithTokens cc @bmartinezcalvo

Thank you @AAlhazwani-WMF. Added this example in the "References" section in Figma so we take it into account for the Chip MVP T323524

DVrandecic added a subscriber: SWoodruff-WMF.
DVrandecic subscribed.

See also T323030 which was merged into this for more information.

Change 833452 abandoned by Jkieserman:

[mediawiki/extensions/WikiLambda@master] update alias styles

Reason:

abandoning in favor of using the codex chip component

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

@AAlhazwani-WMF - do you think we should close this ticket and open a new one for the filter chip component in codex? I think that's the only remaining plan we have here, but let me know if I'm mistaken!