Page MenuHomePhabricator

Removing templates: Prevent accidental template removal
Closed, ResolvedPublic

Description

Workflows

There are many different ways that templates may be accidentally deleted. This ticket documents the different workflows and marks which ones need warnings (and follow-up tickets).

Where/WhenWhat contentHowWarning?
VE article editing screenAny existing template or multi-part template contentClick on template and click delete button OR click on template and press backspace[ ] Confirm want to delete whole template T297788 will not be implemented - see comment T292979#7615852 below
VE template dialogInserting a new template, at least one parameter has a valueClick on back button[x] Confirm lose data and template T272355
VE template dialogEditing an existing template, at least one edit is madeClick on close button[ ] Confirm lose changes T297792
VE template dialogEditing a multi-part template, existing or newDelete one part (template or wikitext with values/content) with trashcan in toolbar or with shortcut Ctrl+DelDeprioritized, not implementing now

Background

Onwiki feedback
Reported on ​​https://meta.wikimedia.org/wiki/Talk:WMDE_Technical_Wishes/Removing_a_template_from_a_page_using_the_VisualEditor

"It is sometimes too easy to remove large templates without any confirmation. This is a frequent problem in Russian Wikipedia, for example, where the new users would delete the filled infobox template, for example, and not notice that they’ve done this because the shortcuts for template deletion are extremely common in VE.

My uneducated guess would be that the newcomers editing the lead section press Backspace, since infoboxes are placed before the article text, and do not notice that a large template was just removed by them, and then (usually) get reverted. It’s a common problem for any non-inline template (meaning templates that use block-level HTML elements, not "format": "block" in TD), with editors also inadvertently deleting navboxes etc., but I’m not sure how to formalise the generic solution for it other than ‘stop deletion of big templates without a confirmation’.
Some edits that might illustrate that:

Event Timeline

awight updated the task description. (Show Details)

@JStrodt_WMDE There was a change in plans about when we are adding warnings and I wanted to provide a detailed explanation here as the request originally came from some user feedback.

I looked into the best practices for confirmation dialogs (this article is a good overview) and it's not 100% straightforward for every case but the general guidelines are:

  • do not use for routine actions. Users then get used to them popping up and just try to quickly move through them without reading, ignoring the content
  • only use for actions with serious consequences, which cannot be undone

In this case, it is a pretty routine action which can be easily undone (with Ctrl+Z or with the undo button in the toolbar). The user can also exit the editing session without saving, or if they save the information is still there from a previous revision and can be copy+pasted. Or the entire edit can be reverted.

While adding this warning might help stop some accidental edits, it would also be creating a new roadblock for editors doing this intentionally and create a habit of ignoring these warnings all together. Since there are ways back, we decided not to implement for removing templates while in the article editing mode. We are implementing them in the dialog because there the edits really will be lost, with no way to get them back.

Lena_WMDE claimed this task.