Page MenuHomePhabricator

Special:Block checkboxes should remember checked state
Closed, ResolvedPublic3 Story Points

Description

Widgets on the Special:Block page should remember their default checked state, or if the user has interacted with them, the state that the user set.

Since T212391, checkboxes are enabled/disabled depending on the block parameters entered in the form (previously they were hidden/shown).

If a checkbox is disabled, it is also unchecked, to indicate that the option cannot be chosen for the particular block parameters entered. If the parameters change and it becomes enabled again, it will still be unchecked. However, it should become checked again, if it was checked before.

Note that the checkbox should not just remain checked in the disabled state, since it sends a misleading message that that option will be applied. E.g. it looks as if autoblocks would be applied for this block (and that the admin can't prevent that from happening), but in fact autoblocks would not be applied:

Event Timeline

Restricted Application added subscribers: MGChecker, Aklapper. · View Herald TranscriptApr 16 2019, 5:29 PM

Why can't they be checked in their disabled state?

I think it sends a misleading message that that option will be applied, e.g. that autoblocks would be applied for this block (and you can't prevent that from happening):

Niharika triaged this task as Normal priority.Apr 17 2019, 5:51 PM
Niharika moved this task from Untriaged to Cards ready to be estimated on the Anti-Harassment board.
Niharika added a subscriber: Niharika.

I think it sends a misleading message that that option will be applied, e.g. that autoblocks would be applied for this block (and you can't prevent that from happening):

Completely agree.

Good catch, @Tchanders. We should fix this.

Niharika updated the task description. (Show Details)Apr 18 2019, 6:29 PM
Niharika set the point value for this task to 3.Apr 18 2019, 6:42 PM
Tchanders updated the task description. (Show Details)Jun 20 2019, 1:52 PM
Tchanders updated the task description. (Show Details)Jul 10 2019, 4:06 PM

Change 523267 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Remember checkbox state on Special:Block if checkbox disabled

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

Change 523267 merged by jenkins-bot:
[mediawiki/core@master] Remember checkbox state on Special:Block if checkbox disabled

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

dom_walden added a subscriber: dom_walden.

On Special:Block, I changed the target back and forth between username, ip and range so different checkboxes became enabled/disabled, making sure the previous state was preserved.

Did the same thing for hideuser with the expiry date and "Editing their own talk page" checkbox with the User_talk restriction.

It also preserves state of checkboxes set via URL parameters.

Briefly tested that the Account Creation checkbox behaves like before (i.e. becomes unchecked when selecting partial, unless it has already been interacted with).

I checked that I could actually submit a block and the parameters were saved correctly.

I tried Special:Block/$target where $target was username, IP and range, which affects which checkboxes are initially enabled/disabled. This did not seem to make a difference.

Tested that refreshing the form or submitting an invalid form preserves the state of checkboxes, and that afterwards this state survives when checkboxes are enabled/disabled.

Browsers tested:

  • Firefox 60
  • Safari 10.1
  • IE11

The change only affects JS, so I did not see a need to test without it.

Testing done mainly on beta.

dbarratt closed this task as Resolved.Jul 22 2019, 5:39 PM