Page MenuHomePhabricator

Unify mw.widgets.CategorySelector and ve.ui.MWCategoryWidget
Open, LowPublic8 Story Points

Description

We currently have two different widgets for editing a list of categories, with different but largely overlapping functionalities. We should only have one.

ve.ui.MWCategoryWidget is used by VisualEditor, in the Page options → Categories dialog. mw.widgets.CategorySelector is used by UploadWizard on the "Describe" step, and in the file upload dialog (mw.ForeignStructuredUpload.BookletLayout, which is used by VisualEditor and WikiEditor).

mw.widgets.CategorySelectorve.ui.MWCategoryWidget
Screenshot
Widgets usedCapsuleMultiSelectWidgetButtonWidgets+TextInputWidget+Popup
APIaction=opensearchaction=query/allcategories
Can set sort key for category
Can reorder categories (requested T108490: Let you drag items in a CapsuleMultiselectWidget to re-order them)
Can edit (not just delete) (requested T67518: VisualEditor: Allow editing of a category link (not just add/remove))
Can view category page (requested T56656: VisualEditor: Category editing tool should preview or at least link to the input categories)
Cross-wiki (hacky)

Event Timeline

matmarex created this task.Oct 10 2016, 7:50 PM
Restricted Application added projects: VisualEditor, Multimedia. · View Herald TranscriptOct 10 2016, 7:50 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Restricted Application added a subscriber: Matanya. · View Herald TranscriptOct 10 2016, 7:51 PM

(Adding a bunch of people who might be interested in working on this. Feel free to unsubscribe yourselves if not.)

Krenair edited subscribers, added: AlexMonk-WMF; removed: Krenair.Oct 10 2016, 8:05 PM

There's a couple dozen tasks filed about both of those, which might be interesting to look at before doing this, and which will need to be re-triaged after this is done: https://phabricator.wikimedia.org/maniphest/query/qF.d66bx9OEb/#R

Prtksxna updated the task description. (Show Details)Oct 11 2016, 12:29 AM
Jdforrester-WMF triaged this task as Low priority.Oct 11 2016, 7:05 PM
Jdforrester-WMF set the point value for this task to 8.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.
AlexMonk-WMF updated the task description. (Show Details)
AlexMonk-WMF added a comment.EditedOct 12 2016, 2:56 AM

The cross-wiki thing - that's just for uploading to foreign wikis, right? It doesn't sound like something we'd find useful in VE.

The two things that the VE code doesn't have, T67518: VisualEditor: Allow editing of a category link (not just add/remove) and T56656: VisualEditor: Category editing tool should preview or at least link to the input categories, don't sound very difficult to implement.

The two things that the MW code doesn't have don't sound very difficult to implement either, but I'd prefer it if we managed to unify the widgets instead. I guess it's mostly a question of deciding which design we want to go with.

Prtksxna added subscribers: MarkTraceur, Krenair.EditedOct 18 2016, 6:55 PM

I spoke with @Esanders and @matmarex about this and we feel that it'll be better to get mw.widgets.CategorySelector on par with ve.ui.MWCategoryWidget, and then use it on the Page Settings dialog too. We'll have to-

@Krenair @MarkTraceur would that be alright for your use cases too?

Krenair removed a subscriber: Krenair.Oct 18 2016, 7:29 PM
MarkTraceur moved this task from Untriaged to Tracking on the Multimedia board.Nov 16 2016, 7:25 PM

I think that would be fine for our use cases, yeah.

@Pginer-WMF, could you also take a look at this from the perpective of mw.widgets.CategorySelector. Its requirements are listed on T147811: Unify mw.widgets.CategorySelector and ve.ui.MWCategoryWidget, and specifically in my comment.

For tags we may want to keep interactions simple to encourage people to quickly add and change them. Having the triangle indicator makes tags heavier, making them look like a list of drop-down menus which users may not perceive as content elements they can create/remove. I see a couple of options to deal with complexity:

  • Avoid it. Ideally tags should be used for very simple list of concepts without complex interactions. In the case of page categories, maybe a user-defined list where each item has more room for manipulation actions could be more appropriate.
  • Keep it secondary. If we want tags to have associated actions, I think we can still do so without turning them into explicit menus. We can provide related information in a separate area when an item is selected or even use a popover menu without the need of an indicator (as it happens with links in VE).