Page MenuHomePhabricator

Add dropdown options for the reason in Special:InvestigateBlock (like Special:Block has)
Closed, ResolvedPublic2 Estimated Story PointsFeature

Description

Feature summary (what you would like to be able to do and where):
Soon to be implemented into Special:CheckUser, Special:InvestigateBlock should allow options in a dropdown that can be chosen to either prefix the reason or be the reason for the block. This makes blocking faster as in the case of using generic block reasons the CheckUser can use the dropdown.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
CheckUser selects the "Abusing multiple accounts" dropdown option and then means they do not need to type this text when making the block. On enwiki, the CheckUser could use a custom dropdown option (definable through a MediaWiki interface page) to have the block reason as "{{CheckUserBlock}}".

Benefits (why should this be implemented?):
Would decrease the time spent typing for common block reasons.

Event Timeline

Change #1020210 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Add dropdown options for reason in Special:InvestigateBlock

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

Change #1020210 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add dropdown options for reason in Special:InvestigateBlock

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

Suggested QA steps:

  1. Load Special:InvestigateBlock while logged in to a user with the checkuser and sysop groups
  2. Verify that a dropdown menu appears under the Reason section along with a text input
  3. Select an option from this dropdown
  4. Verify that the * icon disappears from the text input
  5. Select the Other option
  6. Verify that the * icon re-appears in the text input
  7. Select an option from the dropdown
  8. Put some text in the text input
  9. Enter some testing targets and use the form to block a user
  10. Verify that the reason is the option from the dropdown combined with the reason you entered

What the Reason section should look like is shown below. The "text input" is the input underneath the dropdown menu.

image.png (117×712 px, 2 KB)

You may wish to repeat steps 7-10 with a variety of options (including leaving the dropdown menu selected just on Other). If the option is Other, then the intended behaviour is for some text to be required in the text input. If any other option is chosen, then no text is required in that text input.

@Dreamy_Jazz On Vector and Vector 2022 the text input does not appear below the dropdown:

reason_overflow.png (820×1 px, 50 KB)

@Dreamy_Jazz On Vector and Vector 2022 the text input does not appear below the dropdown:

reason_overflow.png (820×1 px, 50 KB)

That's strange. I was testing using Vector 2022 on my local wiki and it was below the drop down menu.

I will try and see if I can reproduce this.

Does the textbox appear on the right of the dropdown on Special:Block for you? The reason I ask is that the dropdown and textbox were largely copied from the Special:Block code (with some modifications), so I am wondering if this also occurs for that page.

Does the textbox appear on the right of the dropdown on Special:Block for you? The reason I ask is that the dropdown and textbox were largely copied from the Special:Block code (with some modifications), so I am wondering if this also occurs for that page.

It does, but I believe it has always behaved like that.

specialblock_reason.png (875×1 px, 75 KB)

I can reproduce this when not in limited width mode of Vector 2022. Looking into a fix.

Change #1024384 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Ensure 'other' checkbox is under dropdown in InvestigateBlock

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

Change #1024384 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Ensure 'other' checkbox is under dropdown in InvestigateBlock

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

I no longer see the issue in T318458#9743648. The text input always appeared below the dropdown during testing.

I see the dropdown in Special:InvestigateBlock.

I can customise this by modifying the page MediaWiki:Checkuser-block-reason-dropdown, including reasons with templates.

The text input underneath the dropdown is only required if "Other" is selected.

I used the form to create some blocks and checked that the block reason was correctly set in Special:BlockList. I did this for creating multiple blocks simultaneously and for overriding blocks.

The form appears fine on Vector, Vector 2022 and Minerva.

I tested on Firefox and Chromium.

I did not test the no-JS experience.

Test environment: local docker CheckUser 2.5 (7af16e7) 07:20, 30 April 2024.