Page MenuHomePhabricator

AbuseFilter needs a better tag selection UI
Open, LowPublic

Description

AbuseFilter provides a textarea for selecting the tags you want, which is seriously primitive. It isn't so bad now that erroneous tags can be deleted, but we could still do with something a lot nicer:

  • Users could select the tag(s) they want from a jQuery.chosen type list (or the OOUI equivalent). This list would contain existing tags used by AbuseFilter.
  • A new tag could be created using a custom input field. When an "Add" button is clicked, the tag gets added as an option to the tag selection list.
  • Tag names would be validated properly (T92956). The current system allows users to create broken tags, like invalid,tag.
  • Instead of exposing raw tag names, the "decoded stripped tag description" added in https://gerrit.wikimedia.org/r/211497 would be used to provide friendlier names.

Details

Related Gerrit Patches:
mediawiki/extensions/AbuseFilter : masterImprove the tag selector
mediawiki/extensions/AbuseFilter : masterSwitch editing interface to OOUI & improve NoJS usability

Event Timeline

TTO created this task.Jan 6 2017, 6:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 6 2017, 6:50 AM
Huji awarded a token.Jan 6 2017, 2:05 PM
Huji added a subscriber: Huji.Mar 10 2018, 8:05 PM
Daimona triaged this task as Low priority.Mar 11 2018, 10:01 AM
Daimona added a subscriber: Daimona.

This would surely be useful (and give some modernity as well), but the involved work isn't negligible and it'd be better to do everything all at once.

Huji added a comment.Mar 11 2018, 2:35 PM

I am not sure that I agree with how much work it takes. Some of the work that has gone into the new RecentChanges (where tags and everything else is handled through a much nicer interface) can be reused here.

But I do agree with the low priority.

The low priority wasn't for the involved work :-) Or at least, not only. I didn't check about reusing newly introduced code, but (if I'm right) we would need to:

  • Add a selector which retrieves existing tags (basically like the one for warnings)
  • Add an "add" button with JS validation

It's not that much work, but yet it's more than what you would need for a simple switch to OOUI. I would also love to see this implemented (since the textarea is really primitive), but unfortunately I'm not planning to work on this in the short period.

RecentChanges uses a flavor of TagMultiselectWidget – that's possibly an appropriate solution here.

Huji added a comment.Mar 19 2018, 12:33 AM

RecentChanges uses a flavor of TagMultiselectWidget – that's possibly an appropriate solution here.

Exactly my thoughts.

@Volker_E, @Huji Yeah, such kind of widget would be perfect. However, it can't be created directly in PHP, and I'll probably need sone time to see what's better to do.

Change 421487 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Switch editing interface to OOUI

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

Huji added a comment.EditedMar 30 2018, 3:01 PM

@Daimona can you please expand the feature such that it also provides autocomplete support for the tags? Any tag that is already in Special:Tags should be suggested as you type in the tags section.

Also, the placeholder should be changed. Currently it reads "Add tags (one by one or comma separated)" and the part in parentheses does not apply anymore.

@Huji Sure! I'll take a look in a few days, it should be feasible. As for the placeholder, when I submitted the patch it actually was like this, has something changed since then?

@Huji for the autocomplete part, I can't find an "autocomplete" option for tagmultiselect. The only way might (can't test right now) be to add a dropdown with existing tags, more or less like we do for warnings, and make it interact with tagmultiselect. Is it fine to proceed in this way?

Huji added a comment.Mar 31 2018, 12:13 AM

It is easy. Just specify the options parameter for the MenuTagMultiselectWidget (here is an example, search for options: finallList)

Oh, nice, I'll go for it.

Daimona moved this task from Backlog to Management UI on the AbuseFilter board.Apr 3 2018, 12:13 PM
Daimona claimed this task.Apr 10 2018, 5:38 PM
Daimona added a comment.EditedMay 2 2018, 7:10 AM

@Huji Lately I've been thinking about this patch. At the moment we have 2 scenarios:
Don't show the list of used tags
This doesn't need a major change to tag management and it's achievable with a simple OOUI widget from PHP.
Show the list of used tags
This requires a big change: adding a table to the database and accordingly change tag handling; plus, the JS widget is a little buggy.

Given the above facts, could we just provide the first solution for the moment, and eventually improve that in the future when we'll have clearly defined a new tag management system? There's much more to do to achieve this relatively little result of a list of available tags.

Change 430359 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Improve the tag selector

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

Change 421487 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Switch editing interface to OOUI & improve NoJS usability

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