Page MenuHomePhabricator

When user is blocked, update 'Block user' button to read 'Change block' and add an 'Unblock user' button
Closed, ResolvedPublic5 Estimated Story Points

Description

As an administrator I want to change the block status for a blocked user from my mobile device, so that I can allow the user to continue editing.

In the overflow menu on mobile web, users with the block user right see a 'Block user' button on user pages (T307341). If the user is blocked, this button still says 'Block user' and still navigates only to Special:Block. This means that while editors can change that user's block status, they cannot easily access Special:Unblock except through a small link on the block page.

We could contextually show a link to Special:Unblock with the text 'Unblock user', and change the 'Block user' text to 'Change block'.

Design

These items should replace the location of the 'Block user' button in the current list.

Text Destination OOUI icon
Change block Special:Block/USERNAME block
Unblock user Special:Unblock/USERNAME unBlock

Acceptance criteria

  • When a user who has the block user right visits a user page for a blocked user, the Overflow menu should have a 'Change block' item which links to Special:Block and a 'Unblock user' item which links to Special:Unblock.
  • The 'Block user' list item should no longer be shown
  • For users without the block user right, no block-related items should be shown in this menu
  • For users with the block user right, on user pages for users who are not blocked, no change should take place in this menu

Event Timeline

Samwalton9-WMF created this task.
Samwalton9-WMF moved this task from Inbox to Overflow menu on the Moderator-Tools-Team board.
Samwalton9-WMF renamed this task from When user is blocked, change 'Block user' button to read 'Change block' and add an 'Unblock user' button on mobile web to When user is blocked, update 'Block user' button to read 'Change block' and add an 'Unblock user' button on mobile web.May 20 2022, 8:34 AM

to get to the necessary state to see this in docker:

  • register a new account
  • sign in as Admin in another session
  • block the new account
  • see the current state where the block button is still shown for blocked users

Change 809315 had a related patch set uploaded (by Scardenasmolinar; author: Scardenasmolinar):

[mediawiki/core@master] Skin.php: Add change and unblock navigation URLs

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

Change 809317 had a related patch set uploaded (by Scardenasmolinar; author: Scardenasmolinar):

[mediawiki/skins/MinervaNeue@master] User menu overflow: add change block and unblock

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

Test wiki created on Patch demo by SCardenas (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/c08cc0531e/w/

This is ready for review! I created a patch demo to check that everything is working correctly.

In desktop Vector I see <changeblockip> in the sidebar when on a blocked user's user page:

Screenshot 2022-06-29 at 12.49.32.png (302×151 px, 25 KB)

I think it's OK that we're also changing this behaviour for desktop (Like on mobile, "Block user" shows in the sidebar regardless of the user's block status which isn't tremendously helpful), but it seems like this isn't displaying correctly right now.

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/c08cc0531e/w/

Test wiki created on Patch demo by SCardenas (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/870fd56ab8/w/

This new patch demo has the updated version of the MediaWiki core patch. I have verified it's working correctly in Vector, Monobook, and Timeless. Let me know if you see anything else :)

Change 809315 merged by jenkins-bot:

[mediawiki/core@master] Skin.php: Add change and unblock navigation URLs

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

Samwalton9-WMF renamed this task from When user is blocked, update 'Block user' button to read 'Change block' and add an 'Unblock user' button on mobile web to When user is blocked, update 'Block user' button to read 'Change block' and add an 'Unblock user' button.Jul 5 2022, 2:56 PM
Samwalton9-WMF moved this task from Code review to Done on the Moderator-Tools-Team (Kanban) board.

After last weeks talk with @Jdlrobson, I want to make sure we're looping in readers web.

@ovasileva this is a fairly small followup to T307341: Add Block button to Overflow menu that touches Minerva
https://gerrit.wikimedia.org/r/c/809315

Is this something y'all can take a look at? Or is this a small enough change for us to qa and +2?

For tech news:

Administrators will now see 'Change block' and 'Unblock user' buttons instead of 'Block user' on user pages if the user is already blocked.

Re: Tech News - Thanks for the draft, that helps immensely!
If I understand correctly, this is not available yet. I.e. It is not currently in translatewiki, and thus not live on the wikis.
(I checked by looking at the gerrit commits, and trying to search for the two new strings, but minerva-page-actions-change-block and minerva-page-actions-unblock are not there yet. But changeblockip is there.)

Question: Is this just a change in the mobile web? I believe so (it looks like desktop handles this via change-blocklink and unblocklink), but I'm not certain. Please correct me if I'm wrong.

Therefore, I suggest postponing this Tech News item until the week after next, and at that time, writing the entry (in the "Recent changes" section) like so:

On the mobile web site, Administrators will now see buttons for 'Change block' and 'Unblock user' instead of 'Block user' on user pages if the user is already blocked.

Therefore, I suggest postponing this Tech News item until the week after next

That's correct, this will go out in the train next week.

Question: Is this just a change in the mobile web? I believe so (it looks like desktop handles this via change-blocklink and unblocklink), but I'm not certain. Please correct me if I'm wrong.

This will impact both the mobile and desktop sites.

There is still one patch that has not been merged yet, but if the +2 it on Friday or Monday, it will make next week's train.

Change 809317 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] User menu overflow: add change block and unblock

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

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/870fd56ab8/w/

Looking good, tested with my personal account on en.wiki :)