Page MenuHomePhabricator

Special:Block should use mediawiki ui destructive
Closed, ResolvedPublic


Block this user

The Block this user button is not a constructive/destructive button. See screenshot in mobile (also effects desktop but is less obvious).

Version: 1.24rc
Severity: enhancement


Screen_Shot_2014-06-04_at_3.39.37_PM.png (507×911 px, 53 KB)



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:13 AM
bzimport set Reference to bz66145.

akanshgulati2009 wrote:

I am new to open source, I need to know are you looking for css styling of this form?
If that`s the case can I attach a css style file?

akansh: Welcome! In short, the button should correctly use existing CSS (mw-ui- prefix). In general, please check - Fixes (as patches) are welcome in the code review tool at

Update: With $wgUseMediaWikiUIEverywhere = true MediaWiki UI is applied but the button is constructive rather than destructive.

Solution in should make this an easy fix.

Do we still want the block button to be destructive? This bug was originally about it not having any style at all -- it now has a constructive style.

According to the style guide, destructive should be used for "actions which result in the destruction of data". However, no data is destroyed when a user is blocked: it is merely a "final action in the process that results in a change of state", which is what constructive is used for.

Another thing to think about: if the "block" button should be destructive, what about the "amend" button? Is it still destructive, even if we're shortening a block? Is it still constructive, even if we're lengthening it?

For reference, the style guide is located at

I would argue that it is destructive, when it comes to a user's (the target of the block) ability to interact with the site. You're right that it isn't destroying data, but clearly applies to the larger sense of a "destructive action"

I can't see the Amend UI can you include a screen shot? my guess (without seeing it) would be that it is neutral.

Created attachment 16698
screenshot of reblock user interface

It is identical to the block user interface, except (in the English localization) instead of "Block this user", it states "Re-block the user with these settings".


2014-10-07-233132_661x427_scrot.png (427×661 px, 37 KB)

Thanks Douglas, is this interface mostly used to increase, or decrease the block timespan? if it is to increase I would suggest Destructive, otherwise, I'd suggest Neutral

(In reply to Jared Zimmerman (WMF) from comment #8)

[I]s this interface mostly used to increase, or decrease the
block timespan?

That would presumably depend on the wiki, or indeed the blocking user. I'm not sure we can really make assumptions on how the interface is used. I suppose one /could/ make some JavaScript to change the button as the user edits the fields, but that's probably taking it rather too far.

Thinking about it, having the button change color suddenly might be jarring: it is literally the same form, so an admin could feasibly:

  1. Visit [[Special:Unblock]]
  2. Type in the name of an already blocked user, and other details
  3. Click the destructive "block user" button (page reloads)
  4. Check the newly-appearing "confirm block" checkbox
  5. Click the now constructive/neutral "amend user" button

[Although: there are other, perhaps more common, ways to access the "amend" form directly (e.g. [[Special:Block/]], through the toolbox on user pages), in which case the button would be the second color from the get-go.]

Neutral feels like the wrong choice though, it *is* submitting data and performing an action; it's not something passive.

Douglas, we already have the concept of a button that changes color and style based on input validation, e.g. in Flow the submit button is disabled and grey until valid input is entered then the button changes to Constructive.

Given what you described, weather the amount of time is changed it is still a block, and that is still destructive (for the target of the actions, the blocked user) So I'm going to recommend we always use Destructive for this.

How about we make it destructive for now, and gather feedback to see if this aligns with how people use the form via feedback?

Change 165392 had a related patch set uploaded by Microchip08:
change [[Special:Block]] to destructive

Thanks Doug for this input. Jared, Doug is right that if we refer to the current style guide we only advise using destructive when destroying data. If we want to change this to destructive we should also update the usage instructions.

We update the style guide usage instructions to change the wording. What should we change it to?

See bug 71856 for the documentation concern.

Change 165392 merged by jenkins-bot:
change [[Special:Block]] to destructive