Page MenuHomePhabricator

AbuseFilter needs a better tag selection UI
Open, LowPublic


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 would be used to provide friendlier names.

Event Timeline

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.

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.

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

@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?

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

@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

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

Removing task assignee due to inactivity, as this open task has been assigned to the same person for more than two years (see the emails sent to the task assignee on Oct27 and Nov23). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.
(See for tips how to best manage your individual work in Phabricator.)