Page MenuHomePhabricator

When user is blocked, update 'Block user' button to read 'Change block' and add an 'Unblock user' button on mobile web
Open, LowPublic5 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.

TextDestinationOOUI icon
Change blockSpecial:Block/USERNAMEblock
Unblock userSpecial:Unblock/USERNAMEunBlock

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 created this task.
Samwalton9 moved this task from Backlog to Overflow menu on the Moderator-Tools-Team board.
Samwalton9 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
Samwalton9 set the point value for this task to 5.May 25 2022, 4:59 PM

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 :)