Page MenuHomePhabricator

Prevent jump on log and history pages when IPInfo popup button loads
Closed, ResolvedPublic

Description

Currently there is a visible jump when the button loads in the middle of a log row or a history row. The addition of the button causes the text around it to move.

We can prevent this jump by adding some extra padding after IP address links before the JS loads, then removing this padding once the JS loads.

Caveat: IP address links are recognised by the presence of the class mw-anonuserlink. However, this class is also added for IP range links, which do not get a popup button. So if we make this change, we will instead get a jump for rows with IP range links. They will initially have padding, then the padding will go away when the JS loads (but no button will be added).

To distinguish the IP address and IP range links we'd have to manipulate the HTML using PHP, which is fiddly and I think not worth it.

@Prtksxna If we do this task, we will no longer have a jump on IP address rows, but we will have jumps on IP range rows. If we don't do this task, it'll be the other way round. What do you think we should do?

Event Timeline

Change 651792 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/IPInfo@master] Prevent jump when popup button widget added on log and history pages

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

@Prtksxna We already have a patch - it's a simple fix - we're just wondering whether to merge or abandon.

From the description

@Prtksxna If we do this task, we will no longer have a jump on IP address rows

@Tchanders would this only be on the History and Recent Changes pages?

but we will have jumps on IP range rows. If we don't do this task, it'll be the other way round. What do you think we should do?

On which pages do we see IP ranges? I don't think I've ever seen one on RC/History.

(kind of related T264033, if IP ranges are going to get IP info at some point then it might be ok to say that they'll have a jump for now, which'll get removed eventually)

@Tchanders would this only be on the History and Recent Changes pages?

This would also be on Special:Log (actually it won't be on Special:RecentChanges until T263636)

On which pages do we see IP ranges? I don't think I've ever seen one on RC/History.

We see them on Special:Log when they're the target of a log action, e.g. if someone has blocked an IP range.

Thanks @Tchanders! Yep, I think its an alright trade-off to have a jump on IP ranges.

There'll be no ranges on history pages and I am guessing ranges will be fewer than IPs on log pages too. Plus, if we add the pop-up to ranges (eventually/maybe) then this problem will go away too.

Thanks @Prtksxna - we'll go ahead and merge this then.

Change 651792 merged by jenkins-bot:
[mediawiki/extensions/IPInfo@master] Prevent jump when popup button widget added on log and history pages

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