Last modified: 2014-09-23 23:08:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25909 - Add a drop-down list for the tags in Recentchanges and Newpages
Add a drop-down list for the tags in Recentchanges and Newpages
Status: NEW
Product: MediaWiki
Classification: Unclassified
Recent changes (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
: 25876 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-13 12:13 UTC by Seb35
Modified: 2014-09-23 23:08 UTC (History)
13 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch against trunk (12.45 KB, patch)
2011-11-04 23:54 UTC, MrBlueSky
Details
Patch against trunk (12.42 KB, patch)
2011-11-06 23:38 UTC, MrBlueSky
Details
Patch against trunk (11.35 KB, patch)
2011-11-09 00:00 UTC, MrBlueSky
Details
Tag against trunk (10.41 KB, patch)
2011-12-17 00:09 UTC, MrBlueSky
Details
jquery.chosen() applied to the tag selector dropdown (6.00 KB, image/png)
2013-09-13 16:51 UTC, Bartosz Dziewoński
Details

Description Seb35 2010-11-13 12:13:31 UTC
After an idea of [[:fr:User:Padawane]]¹ it would be great to add a drop-down list for the tags in Special:Recentchanges and Special:Newpages instead of an edit box. This would help users who don't know what are exactly the tags and users who use intensively the tags.

[[:fr:User:Dr Brains]] proposes to add two system messages to give the ability to the sysops of customizing the tags useful for Newpages and Recentchanges, possibly like the one in Special:Block.

¹ http://fr.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Demande_d%27intervention_sur_un_message_syst%C3%A8me&oldid=59019598#Sp.C3.A9cial:Nouvelles_pages
Comment 1 Bawolff (Brian Wolff) 2011-02-10 03:31:47 UTC
I imagine having a textbox with common suggestions (hardcoded into a mediawiki ns page) would be better then a pure drop down, as the full list might be long (look at the inactive tags on 'pedia), but we still want to enable the user to input any tag they desire.
Comment 2 MrBlueSky 2011-11-04 23:54:33 UTC
Created attachment 9366 [details]
Patch against trunk
Comment 3 MrBlueSky 2011-11-04 23:56:02 UTC
Oke, I had a go at this. A dropdown list is added to RecentChanges, Contributions, History and NewPages. 

*Tags to put in the dropdown for RC, Contribs and History are taken from MediaWiki:tag-filter-dropdown-list 
*Tags to put in the dropdown for NewPages are taken from MediaWiki:tag-filter-newpages-dropdown-list
*Non-existing tags in these messages are excluded from the dropdown
*If there are no (existing) tags listed in the message, the dropdown is not shown
*The textbox is always shown
*When a tag in the dropdown is selected, it is used and the textbox is ignored
*When the 'other'-item in the dropdown is selected, the tag in the textbox is used
*A new GET-parameter is used: 'tagfilterdropdown'
Comment 4 MrBlueSky 2011-11-06 23:38:37 UTC
Created attachment 9367 [details]
Patch against trunk
Comment 5 Niklas Laxström 2011-11-08 12:55:34 UTC
The code looks very good, except for minor detail of using 'or' instead of '||'.

The user interface could perhaps be better, but that can be improved later if necessary.

In testing I see:
 Warning: implode(): Invalid arguments passed in /www/sandwiki/includes/specials/SpecialRecentchanges.php on line 611

My wiki doesn't have any defined tags. It is probably also the reason why I don't see any filtering interface in the first place. 

Anyway, looks like changing return '' to return array() in ChangeTags::buildTagFilterWithDropdown fixes the warning.
Comment 6 Sumana Harihareswara 2011-11-08 12:56:59 UTC
Marking "reviewed."  MrBlueSky, could you revise your patch per Niklas's code review?  Thanks!
Comment 7 Mark A. Hershberger 2011-11-08 15:17:37 UTC
I also found (and fixed) the problem with implode on this patch when I
looked at it.  Also, like Niklas, I didn't have a good way to test it
since I didn't have tags on my wiki.

To fix the implode problem, replace “return '';” on line 201 with
“return array();”
Comment 8 MrBlueSky 2011-11-09 00:00:16 UTC
Created attachment 9390 [details]
Patch against trunk

The only easy way to test tag-related things is AFAIK to create abuse filters which attaches them to changes. Neither the core nor commonly used extensions (besides AbuseFilter) use tags. 

I have revised the patch per Niklas's code review. And I made two other changes:
*I removed the check for valid tags. When all abuse filters which use a certain tag are removed, the tag is no longer in table 'valid_tag'. But there could still be changes which have that tag attached and users might want to look for them. When non-existing tags are specified it probably makes more sense anyway to just put them in the list and have it noticed and fixed than to hide them.
* 'MediaWiki:tag-filter-dropdown-list' and 'MediaWiki:tag-filter-newpages-dropdown-list' simply take one tag per line, because it's possible users want to have tags starting with an asterik.
Comment 9 Krinkle 2011-11-09 00:09:27 UTC
(In reply to comment #8)
> *I removed the check for valid tags. When all abuse filters which use a certain
> tag are removed, the tag is no longer in table 'valid_tag'. But there could
> still be changes which have that tag attached and users might want to look for
> them. When non-existing tags are specified it probably makes more sense anyway
> to just put them in the list and have it noticed and fixed than to hide them.

Yeah, searching for tags that are no longer be used on new edits should be possible.

This won't cause a lit of ancient tags since mw_recentchanges is frequently truncated/shortened.
Comment 10 Krinkle 2011-11-09 00:10:55 UTC
Oh, it doesn't actually query it (prolly not indexed)..
Comment 11 Sumana Harihareswara 2011-11-12 13:33:51 UTC
Changing "reviewed" to "need-review" because MrBlueSky's new patch awaits review.  Thanks for the patch!
Comment 12 Mark A. Hershberger 2011-11-17 00:48:15 UTC
In order to properly review this, I need to find out how to add tags before this change is made.  Clues? point me to some docs?
Comment 13 Bawolff (Brian Wolff) 2011-11-17 01:10:24 UTC
(In reply to comment #12)
> In order to properly review this, I need to find out how to add tags before
> this change is made.  Clues? point me to some docs?

Honestly, direct db manipulation is easiest way ;) . If you don't want to do that you need to install abuse filter, and make some filters that tag stuff (You should be able to steal filters from wikimedia wikis. MW.org has a filter that tags any edit adding ?> for example)

See also [[mw:Manual:Tags]] which isn't exactly high on details
Comment 14 Bawolff (Brian Wolff) 2011-11-17 01:18:35 UTC
btw, another possible way of doing this that comes to mind, is re-use the search drop-down suggestion code, and make suggestions while users type.
Comment 15 Brion Vibber 2011-12-16 21:31:32 UTC
I'm a bit befuddled by this comment:

+	 * @param $msgkey String: message key for the message which contains a (newline delimited)
+	 *        list of tags to put in the dropdown list. If the message contains no valid tags
+	 *        or doesn't exist the dropdown list is omitted and only a text field is created.


however in the function body, it also checks self::listDefinedTags() and if there aren't any in there, the list ends up empty.

Should it be combining these two lists, or filtering one by the other, or something else? It kinda looks like you have to hardcode the set of things that you can select in messages, of which there's at least two to maintain. What's the intention behind this?
Comment 16 MrBlueSky 2011-12-17 00:09:42 UTC
Created attachment 9727 [details]
Tag against trunk

Oh, i'm sorry: that's an old comment which I should have changed. 

If $wgUseTagFilter is false or there are no defined tags, no filter form is returned. Otherwise a textfield is created, and when the specified message contains text, a dropdown is created too.

There are indeed 2 messages for specifying the selectable tags, one for newpages and one for RC, history and contribs. This way admins can choose usefull tags (or to not have a dropdown menu at all). Another possibility would of course be to always put all defined tags in the dropdown but on some wikis (wp-en) this would result in a lot of clutter.
Comment 17 Rob Moen 2012-01-13 21:25:24 UTC
Applied patch in r108850.  Thanks for the patch!
Comment 18 Rob Moen 2012-01-13 22:06:38 UTC
Reverted as trunk is in code freeze for 1.19 release.  Congrats on commit access MrBlueSky.  Please review comments for r108850.
Comment 19 Sumana Harihareswara 2012-05-25 02:55:28 UTC
MrBlueSky: Thanks again for the patch.  Are you interested in updating it and using developer access to directly suggest it into our Git source control system?

https://www.mediawiki.org/wiki/Developer_access

https://www.mediawiki.org/wiki/Git/Workflow#How_to_submit_a_patch
Comment 20 db [inactive,noenotif] 2012-11-08 20:05:45 UTC
*** Bug 25876 has been marked as a duplicate of this bug. ***
Comment 21 MrBlueSky 2012-11-08 21:20:28 UTC
I have submitted a change (and abandoned) in Gerrit: [[gerrit change 4363]].

The problem with that implementation is that configuration has to be done using system messages, which is neither userfriendly nor flexible. It should have a nice GUI instead. But actually I think its better to create this functionally as a Javascript gadget, so the people who create and maintain the gadgets at a project can create something which fits the project. For example: on wp-nl, where I enabled such a gadget [1] we have only 7 labels (which almost never change), so a textfield isn't useful and a simple dropdown suffices.

[1] http://nl.wikipedia.org/wiki/MediaWiki:Gadget-labelfilter.js
Comment 22 MrBlueSky 2012-11-08 21:21:22 UTC
Gerrit change #4363
Comment 23 Sumana Harihareswara 2012-12-09 17:59:58 UTC
The patchset was for "Dropdown for tags in rc, contribs, history and newpages".

Bartosz, would you be interested in taking this issue on?
Comment 24 Bartosz Dziewoński 2012-12-09 22:41:20 UTC
I am currently waiting for somebody to review one of my own patches in gerrit, and nobody seems interested. I'm not sure if I will be able to without overburdening myself.

Anyway, what's the issue about now? Integrating the gadget into core? That seems like a bad idea, as it wouldn't be configurable, and retrieving the tags from the API on each call would be quite inefficient, if it's even possible. Or reviving MrBlueSky's changeset? I'm not the best person to do this, PHP is not my forte.
Comment 25 Andre Klapper 2013-04-11 15:20:33 UTC
MrBlueSky / Seb35 / Krinkle:

(In reply to comment #24 by Matma.Rex)
> Anyway, what's the issue about now? Integrating the gadget into core? That
> seems like a bad idea, as it wouldn't be configurable, and retrieving the
> tags from the API on each call would be quite inefficient, if it's even
> possible. Or reviving MrBlueSky's changeset? I'm not the best person to do
> this, PHP is not my forte.
Comment 26 Bartosz Dziewoński 2013-07-29 23:57:31 UTC
This is a little more important now that VE is in beta – I think people often filter RC by the 'visualeditor' tag to look for breakage. The dropdown list should just use the same data that [[Special:Tags]] uses.

CC'ing James Forrester.
Comment 27 James Forrester 2013-07-30 00:16:49 UTC
Sounds like a nice improvement.
Comment 28 Gerrit Notification Bot 2013-08-24 22:47:58 UTC
Change 80781 had a related patch set uploaded by Matmarex:
Add a dropdown list for the tag selector

https://gerrit.wikimedia.org/r/80781
Comment 29 Jared Zimmerman (WMF) 2013-08-29 17:54:11 UTC
I don't know enough about this feature to weigh in intelligently, If the tag list is short a popup might be a reasonable option, however if it is long enough to require scrolling another solution might need to be arrived at.
Comment 30 Bartosz Dziewoński 2013-08-29 19:00:06 UTC
The list includes all tags "maintained" by extensions (VisualEditor, MobileFrontend and GettingStarted use these, VE 2, the rest 1 each), as well as all active AbuseFilter tags (hopefully not more than a dozen or so, depending on the wiki). Should be acceptable for a dropdown list.
Comment 31 Helder 2013-08-29 19:07:24 UTC
Will this dropdown menu be cluttered by inactive tags and tags from deleted filters (bug 18908)? E.g. the "link vandalism" from English Wikipedia, which is not used anymore:
https://en.wikipedia.org/wiki/Special:Tags
Comment 32 Bartosz Dziewoński 2013-08-29 19:11:07 UTC
Helder, no, assuming I understand how this works. Special:Tags and this would use different methods - the special page shows all tags that were ever used, while the dropdown would only use the ones explicitly defined using the ListDefinedTags hook.

I asked Reedy to check this on en.wp and the total there is 40 active tags - a little long-ish for a dropdown, but manageable. It's surely shorter on saner wikis.
Comment 33 Bartosz Dziewoński 2013-08-29 19:12:56 UTC
(For reference, en.wp's Special:Tags shows 90 tags right now.)
Comment 34 Jared Zimmerman (WMF) 2013-08-29 19:48:02 UTC
90 tags seems like too much for a popup. What about a form field or a combo box with type ahead.
Comment 35 Bartosz Dziewoński 2013-08-29 20:11:55 UTC
It's 40 for the "popup" (actually a dropdown), 90 only on the special page.

HTML form dropdowns (<select>s) also support search-by-typing in all browsers I'm aware of.
Comment 36 Jared Zimmerman (WMF) 2013-08-29 22:15:35 UTC
40 or 90 feels overwhelming in a popup on some browsers that is going to take up the full height of the screen. Scrolling in popup can be very difficult for some users.
Comment 37 MZMcBride 2013-09-13 02:28:29 UTC
I think bug 48243 is almost a duplicate of this bug. A drop-down menu for tags seems silly. I'd suggest autocomplete (suggestions).
Comment 38 James Forrester 2013-09-13 14:29:52 UTC
(In reply to comment #37)
> I think bug 48243 is almost a duplicate of this bug. A drop-down menu for
> tags seems silly. I'd suggest autocomplete (suggestions).

I disagree - autocomplete is great where the search-space is huge and rapidly-changing, but in a restricted (and externally-set, relatively-static) context, it's better to provide some form of latent discoverability than expect users to know what it might be called (or start with).
Comment 39 Bartosz Dziewoński 2013-09-13 16:51:14 UTC
Created attachment 13275 [details]
jquery.chosen() applied to the tag selector dropdown

Maybe we could use jquery.chosen to get the best of both worlds (screenshot attached). The implementation would be trivial (on top of what I proposed it amounts to adding the jquery.chosen ResourceLoader module and calling `$('.mw-tagfilter-input').chosen()`).

I don't think this is used in core already, but it is definitely included and supported (some of the Labs management extensions use it, I believe, and support is integrated in HTMLForm as well).

(I'm leaning towards a simple select box myself, but this could be a compromise.)
Comment 40 Bartosz Dziewoński 2013-09-13 16:53:01 UTC
(The particular graphical elements it adds are almost all configurable, see the gallery at http://harvesthq.github.io/chosen/ .)
Comment 41 MZMcBride 2013-09-13 18:58:19 UTC
(In reply to comment #38)
> I disagree - autocomplete is great where the search-space is huge and
> rapidly-changing, but in a restricted (and externally-set, relatively-static)
> context, it's better to provide some form of latent discoverability than
> expect users to know what it might be called (or start with).

A full index (e.g., [[Special:Tags]]) allows users to browse through all tags (in the same way that [[Special:AllPages]] allows users to browse through all page titles). The solutions being proposed here seem short-sighted. While there may "only" be about 90 tags today (which is an overwhelming number in a drop-down menu), does anyone expect this number to stay relatively low or decrease in the future?

The reason autocomplete (or suggestions) are already used within MediaWiki for page titles apply to this input field as well. We should also note that Bugzilla itself uses an autocomplete/suggestions system for its keywords field. A drop-down menu seems like a non-starter to me.
Comment 42 Niklas Laxström 2013-09-14 00:40:33 UTC
To continue with the best of both worlds idea, why not supply the list of tags for the dropdown if the number of tags is lower than X, otherwise use only auto-completion API?
Comment 43 Nemo 2013-09-20 23:34:31 UTC
(In reply to comment #42)
> To continue with the best of both worlds idea, why not supply the list of
> tags
> for the dropdown if the number of tags is lower than X, otherwise use only
> auto-completion API?

Yes, we only need something to implement it. MatmaRex is right that we already use it successfully elsewhere: Rillke added it to Translate, for instance.
Comment 44 Gerrit Notification Bot 2014-03-28 16:57:34 UTC
Change 80781 abandoned by Bartosz Dziewoński:
Add a dropdown list for the tag selector

Reason:
Needs to be done differently.

https://gerrit.wikimedia.org/r/80781
Comment 45 Nemo 2014-05-19 13:06:54 UTC
More reasons to first use autocompletion where possible: bug 64829 comment 8 on bug 21383.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links