Page MenuHomePhabricator

Add HTML classes for links in .mw-usertoollinks
Closed, ResolvedPublic

Description

On Recentchanges, Watchlist, history and other places (I think MediaWiki calls them ChangesList), there are span elements with the class mw-usertoollinks that contain links. These links do not have any classes on them. This makes it unnecessarily difficult for users who want to want to do something with these links with CSS and/or JavaScript. You can't target them by text because users have different user languages. You can't target them by href or title because of different content languages. And finally, you can't target them by index because the contribs link for anonymous users is where the link to the user page is for logged-in users.

Related: T102013

Event Timeline

@Nirmos: This task sounds broad due to "and other places" and not too self-contained. So I'm not sure it fits the criteria of good first task currently?

These links do not have any classes on them.

Do you ask for more classes? Or actually IDs?

https://gerrit.wikimedia.org/r/#/c/328943/ might be example code for adding IDs.

This task sounds broad due to "and other places" and not too self-contained.

As I said, I'm pretty sure these are collectively called ChangesList in MediaWiki, so an edit in only one file should be sufficient.

Do you ask for more classes?

The links currently have 0 classes. I'm asking for 1 class to be added to each link. Looking at similar links, these would probably be called something like mw-changeslist-talklink, mw-changeslist-contribslink and mw-changeslist-blocklink, although what they end up being called is not terribly important to me.

Or actually IDs?

IDs are not applicable here. An HTML ID may only appear once per page. There are by default 50 of these links on Recentchanges, history etc, but it can be changed.

The code that makes userlinks is actually in Linker.

EddieGP triaged this task as Medium priority.

Have a working patch, just trying to also solve T102013 here.
Edit: That didn't work out, links for diff & hist aren't centralised at Linker.php as userlinks are. Submitted a fix for this bug only.

Change 338350 had a related patch set uploaded (by EddieGP):
Adds css classes for userlinks on Specialpages

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

Change 338350 merged by jenkins-bot:
Add CSS classes for userlinks on SpecialPages

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