Page MenuHomePhabricator

Admins should be able to apply additional block details to a new block
Closed, ResolvedPublic

Assigned To
Authored By
HMonroy
Mar 27 2024, 7:22 PM
Referenced Files
F57572841: 2024-09-30_10-09-42.mp4.gif
Sep 30 2024, 5:21 PM
F57572836: 2024-09-30_10-04-09.png
Sep 30 2024, 5:21 PM
F57572805: 2024-09-30_10-01-43.png
Sep 30 2024, 5:21 PM
F56316218: 2024-07-09_11-41-35.png
Jul 9 2024, 7:00 PM
F56316196: 2024-07-09_11-41-25.png
Jul 9 2024, 7:00 PM
F47402414: 2024-04-18_14-37-36.png
Apr 18 2024, 9:53 PM
F47402406: 2024-04-18_14-37-50.png
Apr 18 2024, 9:53 PM

Description

Background
Sometime
When admins make a block, they may want to track the target's behavior or limit bad acting from spreading. To mitigate this, we should implement additional options to block users.

user story
As an admin, I want to limit a bad actor's behaviors as best as possible, so that I can maintain the integrity of a project.

requirements / acceptance criteria
Given that I'm an admin making a block, when I create a block, I should see an additional details field, and be able to select the following optional fields:

  • Block the last IP address used by this account, and any subsequent IP addresses they try to edit from. This duration is dependent on the "expiration" set for the given block.
  • Monitor this account’s user page and talk page. This should allow the admin to review the user's activity.
  • Apply block to logged-in users on IP Address. This should block any new user on the IP address trying to make edits.

Implement Additional details field in Codex.

The component should look and feel as defined in Figma file

Derived Requirement

As an admin creating a block, additional options should be available to help manage user behavior. These options include:

Blocking the last IP address used by the account and subsequent IPs based on the block expiration.
Monitoring the user's account page and talk page.
Applying the block to logged-in users on the blocked IP address.

BDD

Feature: Admin block options for managing user behavior

Scenario: Display additional block options for admins when creating a block

Given I am an admin creating a block for a user
When I view the block creation interface
Then I should see an additional details field with the following options:
  - Block the last IP address used by this account and subsequent IPs for the block duration
  - Monitor this account's user page and talk page
  - Apply the block to logged-in users on the blocked IP address

Scenario: Block the last IP address and subsequent IPs used by the account

Given I am an admin creating a block for a user
When I select the option to block the last IP and subsequent IPs used by the account
Then the IP and subsequent IP addresses should be blocked based on the block expiration

Scenario: Monitor the account's user and talk pages

Given I am an admin creating a block for a user
When I select the option to monitor the user's account and talk pages
Then the user’s activity on these pages should be tracked for admin review

Scenario: Apply the block to logged-in users on the blocked IP address

Given I am an admin creating a block for a user
When I select the option to block logged-in users on the same IP
Then any logged-in user on that IP address should be blocked from making edits
Test Steps

Test Case 1: Ensure additional block options are visible for admins

Log in as an admin.
Go to the block creation interface for a user.
✅❓❌⬜ AC1: Confirm that the additional details field is present with the following options:
Block the last IP address used by this account and subsequent IPs for the block duration.
Monitor this account’s user page and talk page.
Apply the block to logged-in users on the same IP.

Test Case 2: Ensure IP block is applied to subsequent IPs

Log in as an admin.
Create a block for a user and select the option to block the last IP and subsequent IPs.
Log in as the blocked user from a different IP address.
✅❓❌⬜ AC2: Confirm that the user is unable to edit from the new IP address.

Test Case 3: Ensure account and talk pages are monitored

Log in as an admin.
Create a block for a user and select the option to monitor the user’s account and talk pages.
Navigate to the blocked user’s account or talk page.
✅❓❌⬜ AC3: Confirm that the user’s activity on these pages is visible for review.

Test Case 4: Ensure the block is applied to logged-in users on the same IP address

Log in as an admin.
Create a block for a user and select the option to block logged-in users on the same IP.
Log in as another user from the same IP address.
✅❓❌⬜ AC4: Confirm that the second user is unable to make edits.

QA Results - Local

Event Timeline

Change #1017350 had a related patch set uploaded (by HMonroy; author: HMonroy):

[mediawiki/core@master] Set up "Block Details" and "Additional details" fields

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

Change #1017350 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.block: Set up "Additional details" fields

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

@HMonroy I'm not sure if this is supposed to match exactly to Figma so I'm just going off the differences unless you tell me otherwise.

Status:❌FAIL
Environment: Local 1.43.0-alpha (01a6c18)17:31, 18 April 2024
OS: macOS Sonoma 14.4.1
Browser: Chrome 123
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://meta.wikimedia.org/wiki/Bot

❌AC1: https://phabricator.wikimedia.org/T361148
Differences in Additional details

FigmaLocal
Additional details (option)Additional options:
description under Additional details(options)Nothing
Starts with "Block"Starts with "Automatically
by this "account"by this "user"
for "a period of" "1" dayfor "one" day
Doesn't have "Hide username from edits and lists"Has "Hide username from edits and lists"
Starts with "Monitor this account'sStarts with "Watch this users's"
user "page" and talk "page"user (no page) and talk "pages"
FigmaLocal
2024-04-18_14-37-50.png (198×618 px, 39 KB)
2024-04-18_14-37-36.png (168×690 px, 29 KB)

Change #1032583 had a related patch set uploaded (by HMonroy; author: HMonroy):

[mediawiki/core@master] mediawiki.special.block: Add hide name option

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

@GMikesell-WMF Thank you for sharing your findings! I submitted a follow up patch to add the "Hide username .." option. It will not enabled/disabled since this is dependent on the expiration option. The period of 1 day language will also apply when we add the expiration field. Currently, we'll see $1 as a placeholder. Thanks again :)

JWheeler-WMF renamed this task from Special:Block form: Add 'Additional details' field in Codex to Admins should be able to apply additional block details to a new block.May 24 2024, 3:11 PM
JWheeler-WMF updated the task description. (Show Details)
JWheeler-WMF updated the task description. (Show Details)

Change #1032583 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.block: Add hide user option

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

@HMonroy I haven't been able to see the hide user option. I can see it on the legacy Special:Block. When I run mw.config.get( 'hideUser' ) in the console it is null for me. Is there a config I need to enable?

George noted some differences in wording in T361148#9728300. We have kept the wording more-or-less the same as the legacy Special:Block rather than the Figma. Perhaps this is OK.

I wonder if we want to be consistent with legacy Special:Block and make Automatically block the last IP address... checked by default.

For the 3 checkboxes I was able to test, the orca screenreader successfully read their labels when they had focus.

I think it has been mentioned before that we don't seem to implement URL parameters, like wpAutoBlock and wpWatch, to preset the checkboxes.

Change #1050066 had a related patch set uploaded (by HMonroy; author: HMonroy):

[mediawiki/core@master] mediawiki.specialblock: Select to block last IP by default

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

@HMonroy I haven't been able to see the hide user option. I can see it on the legacy Special:Block. When I run mw.config.get( 'hideUser' ) in the console it is null for me. Is there a config I need to enable?

Yup, the config is $wgGroupPermissions['sysop']['hideuser'] = true; in your LocalSettings.php

George noted some differences in wording in T361148#9728300. We have kept the wording more-or-less the same as the legacy Special:Block rather than the Figma. Perhaps this is OK.

I wonder if we want to be consistent with legacy Special:Block and make Automatically block the last IP address... checked by default.

Good catch! I added a follow-up patch :)

For the 3 checkboxes I was able to test, the orca screenreader successfully read their labels when they had focus.

Nice!

I think it has been mentioned before that we don't seem to implement URL parameters, like wpAutoBlock and wpWatch, to preset the checkboxes.

I've created a task T368583 to cover presetting the checkboxes.

Thank you @dom_walden

Change #1050066 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.specialblock: Select to block last IP by default

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

@HMonroy Please review the following issues below, thanks!

Test Result - Local

Status: ❌ FAIL
Environment: Local 1.43.0-alpha (be39c16) 17:32, 9 July 2024
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):
Test Links:
http://localhost:8080/wiki/Special:Block

❌AC1: https://phabricator.wikimedia.org/T361148
Differences in Additional details

FigmaLocal
Additional details (optional)Additional options (optional):
description under Additional details(monitor this"user")description under Additional details(monitor this"account")
The first two check boxes wording is different compared to LocalThe first two check boxes wording is different compared to Figma
FigmaLocal
2024-07-09_11-41-25.png (157×516 px, 18 KB)
2024-07-09_11-41-35.png (218×754 px, 34 KB)

Change #1071726 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] mediawiki.special.block [vue]: include $wgAutoblockExpiry in message

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

Change #1071726 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.block [vue]: include $wgAutoblockExpiry in message

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

@HMonroy As you see in AC2 gif, the block feature is not working. You can click on it but it's not doing anything. Also for AC1, what do you want to match with the Figma link you have provided since it's pretty different from what's locally right now?

Test Result - Local

Status: ❓❌
Environment: Local: 1.43.0-alpha (dfd2ffb) 13:36, 26 September 2024; GlobalBlocking: 4c9953a) 13:36, 26 September 2024
OS: macOS Sonoma 15.0
Browser: Chrome 129
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure additional block options are visible for admins

  1. Log in as an admin.
  2. Go to the block creation interface for a user.
  3. ❓ AC1: Confirm that the additional details field is present with the following options:
FigmaLocal
2024-09-30_10-01-43.png (696×640 px, 62 KB)
2024-09-30_10-04-09.png (1×1 px, 199 KB)

Test Case 2: Ensure IP block is applied to subsequent IPs

  1. Log in as an admin.
  2. Create a block for a user and select the option to block the last IP and subsequent IPs.
  3. Log in as the blocked user from a different IP address.
  4. ❌ AC2: Confirm that the user is unable to edit from the new IP address.

2024-09-30_10-09-42.mp4.gif (1×1 px, 1 MB)

Test Case 3: Ensure account and talk pages are monitored

  1. Log in as an admin.
  2. Create a block for a user and select the option to monitor the user’s account and talk pages.
  3. Navigate to the blocked user’s account or talk page.

4.❌ AC3: Confirm that the user’s activity on these pages is visible for review.

See AC2
Test Case 4: Ensure the block is applied to logged-in users on the same IP address

  1. Log in as an admin.
  2. Create a block for a user and select the option to block logged-in users on the same IP.
  3. Log in as another user from the same IP address.
  4. ❌ AC4: Confirm that the second user is unable to make edits.

See AC2

Just click "Custom duration" and form submission will work. The issue is we don't have validations yet, and the form by default has no expiry selected. This is fixed in r1077140.

Also for AC1, what do you want to match with the Figma link you have provided since it's pretty different from what's locally right now?

The designs are a bit outdated and need a full review, but moreover they were written for Multiblocks specifically, while what we're shipping is the Codex facelift of the existing Special:Block. So no, I would not compare against the Figma. Generally speaking, I don't think this is something QA needs to do anyway, as design review is typically done by the designer.