Page MenuHomePhabricator

Inconsistent/confusing styles for temporary account links
Closed, ResolvedPublic

Description

Firstly, apologies for putting all of this into one Phabricator task - it wasn't clear to me how much of this might be caused by the same underlying issue(s), and it was simpler for me to list each one I found here with a screenshot, than create a new task for each of them. Let me know if you'd like me to split any of these out into their own task :)

Doing some quick testing on Patch demo, there are a few inconsistent/confusing styles regarding how MediaWiki links to temporary accounts. I'm not sure how many of these are by design and how many aren't, so I've listed the ones I've noticed below.


1) Temporary account user/talk pages - the "User page", "Discussion" & "Read" buttons all have a grey background, that (when viewing the talk page) appears shortly after the page loads. IMO this looks a bit out of place compared to the other buttons at the top of the page.

screenshot.png (398×1 px, 52 KB)

2a) History-links to a temporary account without a created talk page - the temporary account's username & contribs links are given a grey background, but the talk link is only given a grey background if the temporary account's talk page has already been created.

screenshot.png (332×670 px, 41 KB)

2b) Other places do add the grey background to a redlinked talkpage, though - e.g. if you link to an uncreated temporary-account talkpage from an edit summary, the grey background is added to it.
(Side note - when links to a temporary account's talk/contributions pages are italicised [e.g. in an edit summary], the links themselves are italicised, but the grey boxes are not, which I feel like could be slightly clashing to look at.)

screenshot.png (79×663 px, 20 KB)
screenshot.png (91×365 px, 6 KB)

3) Diff-links, permalinks & undo-links for temporary account user/talk pages have the grey-background styling applied to them - which seems unexpected, IMO. It doesn't feel like those links are representative of a temporary account itself in the same way that (e.g.) a link to [[Talk:~2025-1]] would be.

screenshot.png (230×670 px, 34 KB)

4) Grey-background link styles are sometimes applied to the new-messages-from-users bubble - on wikis without Notifications (Echo) installed, if you leave a message on a temporary account's talk page, the person behind that temporary account will see the link styling applied to the "a new message" and "last change" links within this bubble when they're on a page history/user contributions page, but (seemingly) not if they're on most other pages.

screenshot.png (309×1 px, 41 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

That is a good guess. It introduces new assumptions about when to add the user link classes, via UserLinkRenderer::getLinkClasses. E.g. now we assume that, if we are making a link to a Special:Contributions page with a temp user target, we are making a temporary user link.

We risk confusing other features by adding the user link classes to non-user-links - e.g. the show IP button is added after user links, so is now added more than once: T398714: "Show IP" appearing twice.

Personally I think we should undo the changes to make the user links grey except for signatures and mentions. Other places should just not use the grey background to avoid them being confusing (i.e. the text itself isn't actually a temporary account username) and because the new link background isn't applied consistently.

Change #1167232 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] Revert "Add user-related link colors to LinkRenderer::getLinkClasses"

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

Change #1167244 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@wmf/1.45.0-wmf.9] Revert "Add user-related link colors to LinkRenderer::getLinkClasses"

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

Change #1167232 merged by jenkins-bot:

[mediawiki/core@master] Revert "Add user-related link colors to LinkRenderer::getLinkClasses"

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

Change #1167244 merged by jenkins-bot:

[mediawiki/core@wmf/1.45.0-wmf.9] Revert "Add user-related link colors to LinkRenderer::getLinkClasses"

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

Mentioned in SAL (#wikimedia-operations) [2025-07-08T16:32:34Z] <mszabo@deploy1003> tchanders, mszabo: Backport for [[gerrit:1167244|Revert "Add user-related link colors to LinkRenderer::getLinkClasses" (T392775 T398714 T398717 T398952)]], [[gerrit:rWFSP1167243d5f96|Revert "UserLinker: remove back compat with old arguments of UserLinkRenderer"]], [[gerrit:1167256|UpdateMessageJobTest: Read expected transver from latest (T398904)]] synced to the testservers (see https://wikitech.wikimedia.org

Mentioned in SAL (#wikimedia-operations) [2025-07-08T16:39:38Z] <mszabo@deploy1003> Finished scap sync-world: Backport for [[gerrit:1167244|Revert "Add user-related link colors to LinkRenderer::getLinkClasses" (T392775 T398714 T398717 T398952)]], [[gerrit:rWFSP1167243d5f96|Revert "UserLinker: remove back compat with old arguments of UserLinkRenderer"]], [[gerrit:1167256|UpdateMessageJobTest: Read expected transver from latest (T398904)]] (duration: 09m 10s)

We should probably test this on patch demo before rolling out again. But fwiw I think the problem is not the link classes themselves, but rather the grey-background CSS styles applied to those classes. Seems like perhaps they should be scoped to the mw-content area and that would address most appearance concerns. Gadgets might also need adjustment, of course.

FTR, something that I only discovered after filing this task is that this change also kinda broke part of talk page displays on MinervaNeue: for some reason, DiscussionTools/VE seems to be loading (Minerva) diff-styles on discussion pages; which then reacted to the mw-userlink classes to insert a Codex avatar icon prior to every linked userpage/user talk page:

screenshot.png (120×333 px, 10 KB)

…this is probably to say that it seems like there might be a lot of unintended side effects from / regressions caused by applying user-link classes as widely as this. It might not only be MW extensions/skins that are looking out for these classes, but potentially also a number of onwiki user-scripts & (as you say) gadgets.
tl;dr, I am worried about breakage that will be caused by this as it currently stands, especially that which won’t be easily detectable prior to deployment.

Codesearch shows a number of uses of .mw-userlink in skins (but not too many), which should probably be examined and properly scoped if we're going to add link colors to user links in content.

It seems like it might also be necessary to be more specific about what "a user link" means. As discussed in T347209#9521215:

Signatures and mentions are both just plain wikitext links:

  • Signatures: [[Special:Contributions:~2024-403|~2024-403]]
  • Mentions: [[User:2024-403|2024-403]]

But as pointed out above, if you are a temporary user yourself, there are links to your user and user talk page in a number of other places. It's possible the grey highlighting could/should be suppressed for "self links", that is, if the link is to the current user?

Generally speaking we only want the grey background for temporary account usernames and not on other links, even if they play a supporting role.

Reviewing the individual cases listed in the task description:

1 "User page", "Discussion" & "Read" buttons all have a grey background -- background is not needed for these buttons
2a History-links to a temporary account without a created talk page - the temporary account's username & contribs links are given a grey background, but the talk link is only given a grey background if the temporary account's talk page has already been created. -- background is only required for the temporary account username and not for the talk or contribs links. The background should appear irrespective of the fact that the temporary account username link is red or blue.
2b Other places do add the grey background to a redlinked talkpage, though - e.g. if you link to an uncreated temporary-account talkpage from an edit summary, the grey background is added to it. -- similar to above: background for temporary account username is OK but not needed for talk page link.
3 Diff-links, permalinks & undo-links for temporary account user/talk pages have the grey-background styling applied to them -- None of these links should have the background.
4 Grey-background link styles are sometimes applied to the new-messages-from-users bubble - on wikis without Notifications (Echo) installed, if you leave a message on a temporary account's talk page, the person behind that temporary account will see the link styling applied to the "a new message" and "last change" links within this bubble when they're on a page history/user contributions page, but (seemingly) not if they're on most other pages. -- "a new message" and "last change" links should not have the grey background.

Question that came to mind: What if a temporary account is pinged by another user in a discussion (e.g. by using @[[User:~2025-3105|~2025-3105]])? Should the temporary account username in the ping have a grey background?

& what if an editor pings them in a way such as Thank [[User:~2025-3105|you]] for the question! [...]? Would/should the word "you" have a grey background in this context?

Question that came to mind: What if a temporary account is pinged by another user in a discussion (e.g. by using @[[User:~2025-3105|~2025-3105]])? Should the temporary account username in the ping have a grey background?
& what if an editor pings them in a way such as Thank [[User:~2025-3105|you]] for the question! [...]? Would/should the word "you" have a grey background in this context?

Good questions. I think it would be good to highlight the background in the first instance to be consistent about highlighting temporary account usernames everywhere but we should not highlight "you" as in the second example. That can get confusing IMO.
What do you think?

For non article content links, we should maintain the status quo before this patch which is to apply the mw-tempuserlink class to anything that currently has mw-userlink and is for a temp user.

In article content, I think we should avoid styling any temporary user links based on their text content:

  • It is impossible to do with pure CSS so would require custom logic inside the parser
  • It seems fragile if the two ever needs to diverge, e.g. for normalisation (e.g. if a temp user contained a space, but the link contained an underscore) or truncation
  • A similar approach would be impossible for regular users as they can set custom signatures.

With regards to content pages (for which we are mostly talking about talk pages):

  • 90%+ of links will be temp users signing a comment (contrib links)
  • Most of the remaining cases will be users mentioning temp users (user page links) - only a small minority will be user talk page links.

If we want to style links on content pages, we probably need to accept that there will be some edge cases where non-signature user links will get styled (such as @-mentions) and so we should style all contrib links (links to [[Special:Contributions/<tempuser>]] with any label) and user page links in the content area, as this will give us a reasonably low false-positive and false-negative rate.

Note that by applying mw-userlink on content pages there is a possibility that some gadgets will break[1]. One could either assume that such breakages will be non-critical and/or easily fixed, or only apply the mw-tempuserlink class for styling, without also applying the mw-userlink class.

The other option is to give up on styling temp user links in the content area completely:

  • Pros:
    • Simpler, no broken edge cases to worry about
    • Consistent with how IP users and regular users are rendered
    • Temp usernames are already pretty distinctive by their format (like IP addresses were)
  • Cons:
    • Inconsistent with other parts of the UI that are already styling tempusers (although these could be removed as well, see below)
    • Slightly less clear who is a temp user

Overall the idea of styling temp users feels a bit transitional, i.e. it may be useful over this next year to introduce existing users to the idea of a new type of account, but in the long term the status quo of not styling anon/temp users differently from regular users will probably be fine to revert to.

  1. https://global-search.toolforge.org/?q=mw%5C-userlink&regex=1&namespaces=2%2C4%2C8&title=%28Gadgets-definition%7C.*%5C.%28js%7Ccss%7Cjson%29%29

@Esanders That makes sense to me.

we should style all contrib links (links to [[Special:Contributions/<tempuser>]] with any label) and user page links in the content area, as this will give us a reasonably low false-positive and false-negative rate.

Noting for @Niharika that this would mean styling links that have the temp user name as text, but link to the user page rather than the contribs page (as happens with @ mentions). Does this sound OK?

@Esanders That makes sense to me.

we should style all contrib links (links to [[Special:Contributions/<tempuser>]] with any label) and user page links in the content area, as this will give us a reasonably low false-positive and false-negative rate.

Noting for @Niharika that this would mean styling links that have the temp user name as text, but link to the user page rather than the contribs page (as happens with @ mentions). Does this sound OK?

Yes, that sounds fine.

4 Grey-background link styles are sometimes applied to the new-messages-from-users bubble - on wikis without Notifications (Echo) installed, if you leave a message on a temporary account's talk page, the person behind that temporary account will see the link styling applied to the "a new message" and "last change" links within this bubble when they're on a page history/user contributions page, but (seemingly) not if they're on most other pages. -- "a new message" and "last change" links should have the grey background.

@Niharika Should this say instead that they should not have the grey background? Just asking because this seems to be the one example of a link having a grey background that isn't a user link.

4 Grey-background link styles are sometimes applied to the new-messages-from-users bubble - on wikis without Notifications (Echo) installed, if you leave a message on a temporary account's talk page, the person behind that temporary account will see the link styling applied to the "a new message" and "last change" links within this bubble when they're on a page history/user contributions page, but (seemingly) not if they're on most other pages. -- "a new message" and "last change" links should have the grey background.

@Niharika Should this say instead that they should not have the grey background? Just asking because this seems to be the one example of a link having a grey background that isn't a user link.

Yes, sorry! I miswrote. I'll update my comment. Thanks for catching this.

Djackson-ctr subscribed.

I have verified that the code changes have been reverted (User-related link colors have been removed).
QA was completed for this ticket using Test wiki 1.45.0-wmf.9 (a9e4ca5) and 1.45.0-wmf.10 (06dce30), and localhost 1.45.0-alpha (1ba8f04).
Thank you @Tchanders.