Page MenuHomePhabricator

Add Block button to Overflow menu
Closed, ResolvedPublic3 Estimated Story Points

Description

As an administrator, I want to block a user from editing my Wikimedia project from my mobile device, so that I can stop them vandalising pages.

There are a number of administrator tools which are accessible from dropdown menus in the top right of a page in desktop view, or in the left sidebar. Functionality like Delete and Protect, and changing user groups have been made available via the overflow menu on mobile web. Usually this overflow menu is only visible when Advanced Mobile Contributions is turned on, but on user pages it was made visible to all users (T232653).

When on a user page, administrators expect to find a link to Block this user in the overflow menu, but this isn't currently present.

Spike: T306175

Design

The menu item should be styled in the same way as the other elements. In terms of menu order, the Block button should be placed between User Groups and Logs.

OOUI icon name: block

Acceptance criteria

These are all in the context of users using Minerva Neue via the mobile site. The desktop experience should be unchanged.

  • Logged-in users with the block user right (including sysops) see a Block link in the Overflow menu on user and user talk namespace pages
  • The block link should take users to Special:Block/USERNAME where USERNAME is the username of the user whose user page is being viewed
  • Logged-in users without the block user right do not see a Block link in the Overflow menu
  • Logged out users see no change
  • The Block link should not show in the Overflow menu on pages which are not in the user or user talk namespaces

Event Timeline

Samwalton9-WMF updated the task description. (Show Details)

Update: I've got all the bits and pieces installed and hopefully configured correctly. I've got the mobilefrontend extension installed along with the minervanue skin. Vector is the configured desktop skin, and minerva is the mobile skin. I think I've read through things well enough to begin actual work tomorrow.

Something that occurred to us today, which is still an open question:

  • Once a user is blocked, should we change this list item at all? What is the workflow for a user unblocking another editor?

The Protect button changes to Unprotect (with a different icon) when a page is protected. How easy is it to replicate this for Block / Unblock?

update: I was able to add the references to the block action to the menu builder and the standard block icon to skin.json and then access it as expected

localhost_8080_w_index.php_title=User_Docker1&mobileaction=toggle_view_mobile(iPhone SE) (1).png (1×750 px, 116 KB)

Once a user is blocked, should we change this list item at all? What is the workflow for a user unblocking another editor?

I took a look at Special:Block and Special:Unblock and found that while Block contains a link to Unblock, the reverse isn't true. As such we definitely shouldn't simply replace the block button with the unblock button, because mobile users will lose the ability to change a user's block parameters.

Another option we considered was, if the user is blocked, update the Block text to 'Change block', and add a second button for Unblock. This is something we should discuss and revisit as a separate task.

Change 788749 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/skins/MinervaNeue@master] Add block btn to scndry page menu for user pages

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

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

patchdemo here:
https://patchdemo.wmflabs.org/wikis/6143acd80d/w/

You can log in as the following users using the password patchdemo1

  • Patch Demo (admin)
  • Alice
  • Bob
  • Mallory (blocked)

This all behaves just as I'd expect! I tested each of the acceptance criteria and this is looking good to me.

Update, I:

  • checked to see if I needed to add tests; the existing user group stuff isn't tested in the skin, I'm guessing because so much of the functionality is provided elsewhere that it's out of scope to worry about here
  • made the commit message more concise
  • added the MinervaNeue tag to the task
  • requested a review in gerrit

so we're just waiting on code review now.

Also, I realized I didn't have the order as specified; I just updated the pr to place block between move and delete as requested.

Also, I realized I didn't have the order as specified; I just updated the pr to place block between move and delete as requested.

Agh I meant to update the task description. On seeing where you placed it I actually thought that might make more sense - so that the actions relating to the user were together, and the actions relating to the page were together, rather than bundling by admin vs not admin.

No worries, it's easy to put it back where it was! Doing so now.

so we're just waiting on code review now.

@jsn.sherman clarifying question - are you requesting a code review from the web team (us) if so can you please tag this ticket with Web-Team-Backlog (Kanbanana-FY-2021-22) to make this formal [1]. If not, please ignore me :-)

[1] https://www.mediawiki.org/wiki/Readers/Web/Working_with_us

jsn.sherman added a subscriber: ovasileva.

so we're just waiting on code review now.

@jsn.sherman clarifying question - are you requesting a code review from the web team (us) if so can you please tag this ticket with Web-Team-Backlog (Kanbanana-FY-2021-22) to make this formal [1]. If not, please ignore me :-)

[1] https://www.mediawiki.org/wiki/Readers/Web/Working_with_us

Thanks for the process info! I can see that I didn't follow procedure here.
Pinging @ovasileva to request review on this.

so we're just waiting on code review now.

@jsn.sherman clarifying question - are you requesting a code review from the web team (us) if so can you please tag this ticket with Web-Team-Backlog (Kanbanana-FY-2021-22) to make this formal [1]. If not, please ignore me :-)

[1] https://www.mediawiki.org/wiki/Readers/Web/Working_with_us

Thanks for the process info! I can see that I didn't follow procedure here.
Pinging @ovasileva to request review on this.

@jsn.sherman - thanks for flagging this! We were able to estimate it today and hope to have the review ready for you within the next two weeks.

This task says that the Blocked button should only appear when AMC is enabled similar to move, protect, delete. However I'm seeing that all of those buttons are available when AMC is off. @Jdlrobson Is that expected and should the task just be updated?

̶@̶b̶w̶a̶n̶g̶ ̶t̶h̶i̶s̶ ̶w̶a̶s̶ ̶a̶n̶ ̶o̶v̶e̶r̶s̶i̶g̶h̶t̶ ̶o̶n̶ ̶m̶y̶ ̶p̶a̶r̶t̶.̶ ̶T̶h̶e̶ ̶m̶o̶d̶e̶r̶a̶t̶o̶r̶ ̶t̶o̶o̶l̶s̶ ̶t̶e̶a̶m̶ ̶h̶a̶s̶ ̶a̶l̶s̶o̶ ̶t̶a̶l̶k̶e̶d̶ ̶a̶b̶o̶u̶t̶ ̶a̶d̶d̶i̶n̶g̶ ̶f̶e̶a̶t̶u̶r̶e̶s̶ ̶f̶o̶r̶ ̶n̶o̶n̶-̶a̶m̶c̶ ̶u̶s̶e̶r̶s̶,̶ ̶a̶n̶d̶ ̶I̶ ̶s̶i̶m̶p̶l̶y̶ ̶m̶i̶s̶-̶r̶e̶m̶e̶m̶b̶e̶r̶e̶d̶ ̶t̶h̶i̶s̶ ̶t̶a̶s̶k̶ ̶f̶o̶r̶ ̶o̶n̶e̶ ̶o̶f̶ ̶t̶h̶o̶s̶e̶ ̶w̶h̶e̶n̶ ̶I̶ ̶w̶o̶r̶k̶e̶d̶ ̶o̶n̶ ̶i̶t̶.̶ ̶I̶ ̶s̶h̶o̶u̶l̶d̶ ̶h̶a̶v̶e̶ ̶d̶o̶u̶b̶l̶e̶-̶c̶h̶e̶c̶k̶e̶d̶ ̶b̶e̶f̶o̶r̶e̶ ̶r̶e̶q̶u̶e̶s̶t̶i̶n̶g̶ ̶a̶ ̶r̶e̶v̶i̶e̶w̶.̶

It looks like my confusion was a happy accident. See followup by @Samwalton9

This task says that the Blocked button should only appear when AMC is enabled similar to move, protect, delete. However I'm seeing that all of those buttons are available when AMC is off. @Jdlrobson Is that expected and should the task just be updated?

Thanks for catching that, when I wrote this ticket I thought the overflow menu was an AMC-exclusive feature, but after chatting with Jon I discovered that on user pages it was made available to all users (T232653). I should have come back to update the ticket description to remove references to AMC, which I've now done.

bwang moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
bwang subscribed.

Change 788749 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Add block button to user namespace overflow

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

@Samwalton9 would your team be able to QA this or do you need web team to do that?

@Samwalton9 would your team be able to QA this or do you need web team to do that?

We unfortunately have no QA so if the web team has capacity that would be great.

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

https://patchdemo.wmflabs.org/wikis/6143acd80d/w/