Page MenuHomePhabricator

Enable Show IP for temporary account links in content and discussion pages
Open, In Progress, MediumPublic

Description

Motivation

We want to enable Show IP and Auto-reveal features for temporary account links in content and discussion pages.
This work follows up from T392775: Add link color for temporary usernames in content and discussion pages and T347209: Investigate: Grey background for temporary usernames in signatures, mentions etc

Acceptance criteria
  • Enable Show IP and Auto-reveal feature for temporary account links that are highlighted in T392775.
  • The feature should only appear for users who have the ability to view IP addresses.

Event Timeline

Niharika triaged this task as Medium priority.

What IP should be displayed for a given temp user? Should it be simply the last one used or some specific one?

Notably, speaking of a Show IP button next to a signature of a temp. account, it is theoretically possible to connect the user to a specific revision (which is done e.g. for the Thank button in DiscussionTools). It could enable us to show the actual IP that was used when posting the specific message (as opposed to just one of the addresses used by it).

mszwarc changed the task status from Open to In Progress.Nov 25 2025, 10:29 AM
mszwarc claimed this task.

From the engineering point of view I see two approaches to this:

Option 1: Emit data-mw-target on userlinks in parser

In this approach we update the parsers in a way somehow similar to what we did in T392775, so that they emit data-mw-target attribute on all links to userpages and contributions pages (probably with the same conditions about the link text as for mw-tempuserlink class in that task). Then, we can handle content links in a way similar to the ones where we already supported IP Reveal.

Pros:

  • If we ever decide to render "Show IP" server-side, this solution would be needed probably.
    • However, I'm not sure how difficult would it be to render "Show IP" in page content server-side. Caching may bite us.

Cons:

  • There's no framework in parser to specify extra attributes for links in a similar way as link classes. We would need to define it, decide whether to support a hook similar to GetLinkColours/GetLinkClasses and implement all of it in both parsers.
    • It means that we'll need to go through the legacy code, again.
  • We would be adapting core for what's requested by an extension.
  • Most of the work will be in the code that's not owned by PSI.
  • Might result in "Show IP" in unwanted places (e.g. in log entries or edit summaries in the action/comment part).
Option 2: Update IP Reveal to read the target user from link target

Alternatively, we can also process data-mw-target-less links as a special case, where the username is determined based on the link target, so that we don't need to introduce changes to the parser.

Pros:

  • The solution will be scoped solely to CheckUser, which is owned by us.
    • No legacy code to update.
  • Better control over where the "Show IP" links are added.
  • We can reuse the existing queries for temp. account links and extend them to support this use case.

Cons:

  • IPInfo won't be added automatically to content links where "Show IP" is rendered.

From the two options, I believe the second one is a better way to go and I'm going to implement it.

With the second one, I would note that there are issues with just reading the username from the DOM as described in T392522: IP reveal: IP reveal fails if the temporary account is expired. However, I guess reading the link target could avoid that issue?

With the second one, I would note that there are issues with just reading the username from the DOM as described in T392522: IP reveal: IP reveal fails if the temporary account is expired. However, I guess reading the link target could avoid that issue?

I expect that there's much lower chance that something alters the href than the link content (be it the expiration popup or some other on-wiki gadget). Thus, parsing the link target should be rather safe.

Change #1211119 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/CheckUser@master] IP Reveal: Centralize reading the link target

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

Change #1211120 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/CheckUser@master] IP Reveal: Support temp. accounts in page content

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

What IP should be displayed for a given temp user? Should it be simply the last one used or some specific one?

Notably, speaking of a Show IP button next to a signature of a temp. account, it is theoretically possible to connect the user to a specific revision (which is done e.g. for the Thank button in DiscussionTools). It could enable us to show the actual IP that was used when posting the specific message (as opposed to just one of the addresses used by it).

In the event of signatures where we can tie the IP to the revision, let's use the revision IP for the Show IP button.

Change #1211119 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP Reveal: Centralize reading the link target

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

As far as I can tell, the user links in the content area usually won't be possible to tie to a particular revision or log ID, so we'd usually be showing the latest IP used.

@Dreamy_Jazz do you have concerns with this similar to T393572#10995579?

There was a suggestion to add a tooltip (T393572#11002698), but I'm not sure IP viewers will generally expect/want to hover over each IP to find out what it means - e.g. multi-reveal and auto-reveal features were requested so that users could avoid needing to interact with each button.

Thanks for the ping. I do have concerns similar to those detailed at T393572#10995579.

Personally I think just displaying the last IP used in most cases is at best confusing and at worst misleading:

  • I would expect for "Show IP" to show me the IP used for the specific action. There will be places where a user is associating a temporary account username with an action, but we would not have handling to reveal that IP. In those cases a user will understandably think that specific action used the specific IP.
  • There are places where the username is not associated with any action. However, there is no guidance or indicator as to what the IP being shown actually is. Given that this IP could change between each reveal (if the temporary account is still active), users may see a different IP for subsequent IP reveals (so a report of "please block the IP shown by IP reveal on this button" will not be necessarily stable)

To solve this, I think we need a clear indicator for what the revealed IP is. This may just need to be a tooltip to explain what the IP is, maybe just shown if the IP being shown is the last used IP.

next to a signature of a temp. account, it is theoretically possible to connect the user to a specific revision (which is done e.g. for the Thank button in DiscussionTools)

I just checked again and I must have misread the DicussionTools code – they implement their own "thanks", which doesn't require a specific revision to thank for (rather they use the current revision to fetch the comment text)

I agree that a tooltip can help clarify which IP we are using. I also agree that users won't easily discover the hover affordance.
From Thalia's analysis on IPs we know that "Most temporary accounts only use one IP address, and are the only user on that IP address." With that in mind...

  • We should only show this tooltip in the event we are displaying the last used IP and that we know there are multiple IPs associated with the temp account. Can we do this?
  • Can we auto-display the tooltip for a few seconds (say 5 seconds) when the IP is made visible and then auto-hide it?
  • Can we auto-display the tooltip for a few seconds (say 5 seconds) when the IP is made visible and then auto-hide it?

An auto-hide would mean that users using auto-reveal would miss this tooltip if the revealed IP is only shown further down the page

@Niharika What if we made some permanent visual difference between the most recent IPs and IPs associated with the particular action/edit, than also implemented a tooltip to explain what that difference meant?

In the absence of better design, something like (1.2.3.4*)?

@Niharika What if we made some permanent visual difference between the most recent IPs and IPs associated with the particular action/edit, than also implemented a tooltip to explain what that difference meant?

In the absence of better design, something like (1.2.3.4*)?

I thought about this too but decided against proposing this because we are already making temporary accounts quite crowded with the gray background, Show IP, IP Info tooltip and the User Info card icon. I don't want to add to that. Another way to do this is to add a message in the IP Info card (since the IP Info will follow from the IP that is being made visible). We can do this in addition to the tooltip.

Change #1211120 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP Reveal: Support temp. accounts in page content

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

Personally I think just displaying the last IP used in most cases is at best confusing and at worst misleading. [snip]

I wouldn't hate seeing them all, or some number greater than 1 (with a limit on top if desirable).

@Niharika What if we made some permanent visual difference between the most recent IPs and IPs associated with the particular action/edit, than also implemented a tooltip to explain what that difference meant?

In the absence of better design, something like (1.2.3.4*)?

I thought about this too but decided against proposing this because we are already making temporary accounts quite crowded with the gray background, Show IP, IP Info tooltip and the User Info card icon. I don't want to add to that. Another way to do this is to add a message in the IP Info card (since the IP Info will follow from the IP that is being made visible). We can do this in addition to the tooltip.

If an asterisk (or similar symbol) makes the space crowded, maybe rendering the IP in italics would work? It would add additional style to the page, but it wouldn't take any more space (and we don't need to worry about exotic scripts here, as the IP is always displayed using arabic numerals).