Page MenuHomePhabricator

Update block log snippets for multiblocks
Closed, ResolvedPublic2 Estimated Story Points

Description

Some LogEventsList::showLogExtract() callers need to be updated for multiblocks.

Code review

IntroMessageBuilder::addUserWarnings(), Article::showMissingArticle() and ContributionsSpecialPage::contributionsSub() all show a block log snippet if the relevant user is blocked.

IntroMessageBuilder and showMissingArticle are apparently identical, and suppress display of partial blocks as described in T203171. Whereas contributionsSub tries to show a bit more information in its wrapper message about the kind of block and the kind of user, requiring 4 messages.

All use a limit of 1. For multiblocks, we would like to show log entries for all active blocks.

All are conditional on a "vague target" block query, so a range block relevant to the viewed single IP address will be loaded. The log snippet query uses the target of the loaded block, so it shows a range block snippet.

You might think that IntroMessageBuilder on a user talk page would warn the editor that the user can't reply. But the feature has never been useful for that. For a sitewide block, applicability to the talk page is not checked.

Implementation options

Option 1: Load all active blocks for the user, and show all log entries for those blocks by joining on log_search. Modify existing messages to not specify the number of blocks or entries. The user is considered to be partially blocked if all blocks are partial.

T384916-2.png (477×819 px, 120 KB)

Option 1.1: Suppress log entry proliferation due to reblocks using SQL magic

Option 2: Load all active blocks for the user, and retain current behaviour if there is only one block. Use new messages and log_search behaviour if there is more than one block.

Option 2.1: As for option 2 but suppress log entry proliferation using SQL magic as in option 1.1

Option 3: Show only one log entry but vary the wrapper messages to tell the user that there are multiple blocks. Note the "view full log" link which is pre-existing.

T384916-3.png (327×817 px, 69 KB)

Option 4: Show a BlockListPager table instead of a log snippet

T384916-4.png (681×814 px, 121 KB)

Design as implemented

  • Option 3
  • Show missing and edit intro have Special:BlockList link

block log contribs.png (398×812 px, 74 KB)

block log show missing.png (329×814 px, 60 KB)

Event Timeline

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

Change #1116902 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] On Special:Contributions, show a block list instead of a block log

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

Change #1116897 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] block: In log snippets, show all log entries related to active blocks

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

Change #1116898 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] block: Reduce multiblocks log snippets using a subquery

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

Change #1116899 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] block: In log snippets, show all log entries related to active blocks

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

Change #1116900 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] block: In log snippets, vary the wrapper message for multiblocks

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

WIP patches show unrefactored code. I considered refactoring but I already have a local branch for T382106 so I should probably finish that first.

Minimal refactoring leaves the code in an unsatisfactory state. It really needs aggressive refactoring, but that's probably a week of work.

Hmm, from an administrator standpoint, I think any option that reveals all information is best. But the full log could be quite long and that'd ignore some users. In most cases, I suspect users mainly care if they are blocked at all, and have a link to get more info.

That said, I think option 2 (and preferably 2.1) is best for admins, while option 3 is sufficient for admins but better for most users. Option 3 is also probably the least likely to met with criticism, so I think that sounds best overall.

Option 4 has the same problem we have with Codex Special:Block, where data tables are quite a struggle to fit into an already condensed container. I would definitely expect backlash from users, barring a larger UI overhaul which I assume we want to avoid. (We can't just use the Codex components we built, FYI for anyone who may be wondering).

Change #1116897 abandoned by Tim Starling:

[mediawiki/core@master] block: In log snippets, show all log entries related to active blocks

Reason:

going with option 3

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

Change #1116902 abandoned by Tim Starling:

[mediawiki/core@master] On Special:Contributions, show a block list instead of a block log

Reason:

going with option 3

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

Change #1116899 abandoned by Tim Starling:

[mediawiki/core@master] block: In log snippets, show all log entries related to active blocks

Reason:

going with option 3

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

Change #1116898 abandoned by Tim Starling:

[mediawiki/core@master] block: Reduce multiblocks log snippets using a subquery

Reason:

going with option 3

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

Thanks @MusikAnimal . Option 3 is ready for review.

QA note: if you view a page related to an IP address, and the IP is blocked by multiple targets (say, ranges with multiple sizes), then a random target will be chosen for the purposes of log snippet display, including the "show full log" link which will take you to a page showing only the random target. I believe this is a pre-existing issue not related to multiblocks.

So when multiblocks is enabled and there are >1 blocks, I'm wondering if we should have a link in addition to "View full log", say "View blocklist" that goes to Special:BlockList for the given user? Special:Log/block is acceptable by itself, but hard to parse visually if you're just trying to find the current active blocks. I suggest Special:BlockList in this message since it's shown to non-admins.

So when multiblocks is enabled and there are >1 blocks, I'm wondering if we should have a link in addition to "View full log", say "View blocklist" that goes to Special:BlockList for the given user? Special:Log/block is acceptable by itself, but hard to parse visually if you're just trying to find the current active blocks. I suggest Special:BlockList in this message since it's shown to non-admins.

Sure, can do. Maybe as a new option to showLogExtract()? Do you know exactly where you want to put the link? Any CSS ideas?

So when multiblocks is enabled and there are >1 blocks, I'm wondering if we should have a link in addition to "View full log", say "View blocklist" that goes to Special:BlockList for the given user? Special:Log/block is acceptable by itself, but hard to parse visually if you're just trying to find the current active blocks. I suggest Special:BlockList in this message since it's shown to non-admins.

Sure, can do. Maybe as a new option to showLogExtract()? Do you know exactly where you want to put the link? Any CSS ideas?

An option to showLogExtract() sounds good. I wasn't thinking anything fancy, maybe just View full log • View block list. It could even replace the log link, but I thought some folks may prefer that to stay where it is. (Edit: I guess it only makes sense for a log snippet to include a link to the full log)

Or… if we want to make this an i18n headache, we could change the initial snippet message to include the link, like "This user is currently blocked 3 times."

Change #1116900 merged by jenkins-bot:

[mediawiki/core@master] block: In log snippets, vary the wrapper message for multiblocks

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

Change #1121487 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Factor out block log boxes and add block list link

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

Change #1121487 merged by jenkins-bot:

[mediawiki/core@master] Factor out block log boxes and add block list link

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

tstarling updated the task description. (Show Details)