Page MenuHomePhabricator

Show a confirmation prompt for rollback link on diff page
Closed, ResolvedPublic1 Estimated Story Points

Description

Motivation
Rollbacks appear in list views (such as history, recent changes), but also in the diff view. In both cases it should be possible to see a confirmation prompt

User story
As an editor for whom the rollback confirmation prompt is enabled
I want to see a rollback confirmation prompt when I click on "rollback X edits" in the diff view
so that I can revoke the action if it was not the one I intended.

Mocks
Before the user clicked on the rollback link:


Bildschirmfoto 2019-01-31 um 13.32.42.png (144×402 px, 38 KB)

Once users who have the confirmation prompt enabled clicked on the link:
Bildschirmfoto 2019-01-31 um 13.32.46.png (92×604 px, 38 KB)

Acceptance Criteria

  • If users with enabled rollback confirmation prompt click on rollback X edits in the header of the diff view, they see a confirmation prompt Rollback of X edits? Rollback Cancel
  • The confirmation prompt should appear in the same position the initial rollback X edits had, with all possible syntax around it staying intact
  • If only one edit is supposed to be rollbacked, the wording should say rollback 1 edit
  • If users click on Rollback of the confirmation prompt, the rollback action should be executed
  • If users click on Cancel, the original state should be retained, i.e. rollback X edits should again be visible

Notes
-The thanks confirmation prompt comes with an animation. At this stage this is not required yet, but if it is easier to realize the story with implementing an animation, that is ok as well.

Event Timeline

Lea_WMDE created this task.
Lea_WMDE set the point value for this task to 5.

Change 488048 had a related patch set uploaded (by Tim Eulitz; owner: Tim Eulitz):
[mediawiki/core@master] Show confirmation prompt on rollback links

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

Tim_WMDE moved this task from Doing to Review on the WMDE-FUN-Sprint-2019-02-04 board.
Tim_WMDE subscribed.
kai.nissen changed the point value for this task from 5 to 3.Feb 18 2019, 11:02 AM

If there's time, it would be nice if this task could also implement using POST for the rollback action T88044: Make rollback use POST instead of GET (use AJAX in GUI).

Hi @kostajh, the plan is to use POST requests wherever we send rollback requests. However, we evaluated it and it is unfortunately too big for the scope of this project to make all rollback requests use POST instead of GET (our project is not changing all of the calls).

@zeljkofilipin we have some failing browser tests in this patch. I ran out of ideas how to fix them.
The thing that fails is setting a user preference to true for the browser test user. The error is here https://integration.wikimedia.org/ci/job/mwgate-npm-node-6-docker/81966/console

Can you please take a look and let us know if something seems odd and/or we're doing it the wrong way? Thank you in advance!

I was able to reproduce the problem on my machine, using mediawiki-vagrant. Looks like the problem is that Show a confirmation prompt when I click on a rollback link setting is not set for Admin at Special:Preferences. The test fail when it's not set, and pass when I set it manually.

zeljkofilipin moved this task from Backlog 🪒 to Deep work 🌊 on the User-zeljkofilipin board.

@Tonina_Zhelyazkova_WMDE I've left a few comments in Gerrit. I think I've found the problem. I ran out of time, so I didn't resolve it. Let me know if you need help with implementing my suggestions.

@zeljkofilipin thank you very much for the feedback! We resolved the major problem for the failing tests :)

@Krinkle I am responding to your gerrit comment here to keep the non-code related discussion in phabricator.

We as WMDE are expecting to do longterm maintenance of our changes, just as we continue to maintain the RevisionSlider, AdvancedSearch or our changes to Wikidiff2.
The decision to add a rollback confirmation prompt, and to do so with a user preference, did not come sudden, but was the result of a 1.5 year long discussion (see the project overview page, where you also find links to the research page and the community consultations).

I should have added the Platform Engineering to the main ticket when starting to write phab tickets (sorry for forgetting that, I will do that in a moment). However, I did share all of my team's projects + plans (among them this one) with @CCicalese_WMF last year.

Tobi_WMDE_SW changed the point value for this task from 3 to 1.Mar 4 2019, 11:12 AM

Change 488048 had a related patch set uploaded (by Tim Eulitz; owner: Tim Eulitz):
[mediawiki/core@master] Show confirmation prompt on rollback links

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

Change 488048 merged by jenkins-bot:
[mediawiki/core@master] Show confirmation prompt on rollback links

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

Thank goodness! As someone who just accidentally clicked that link to see what it did and felt very embarrassed I am so happy to see a patch on the way to fix this.