Page MenuHomePhabricator

CX2: Warning when page title already exists
Closed, ResolvedPublic

Description

As part of the publishing support (T188732), we want to let the user know whether there is a page with the same title used for the translation. This is important since the contents of such page will get overwritten by the translation content when it is published.

We want to inform the user at three different points:

  • Initially when the translation is loaded, if the initial translation title corresponds to an existing page in the target wiki.
  • When the title is modified and the new title corresponds to an existing page in the target wiki.
  • When publishing, as a final confirmation step to avoid accidental overwriting a page.

Proposed solution

The proposed solution is based on the system for communicating issues in CX (T189488). The specific case for this particular issue, is illustrated below:

CX-exists-initial.png (720×1 px, 237 KB)

  • A warning marker will be shown next to the page title indicating there is one issue.
  • The warnings card will show the warning, allowing to access more details about it.

CX-exists-detail.png (720×1 px, 258 KB)

  • When the title gets focused, or the user clicks in the issue card (either in "1 warning" or "view details"), the issue card will show the details.
  • The page name in the message will link to the page in the target wiki.
  • "Mark as resolved" will make the issue to no longer be shown (even if the translation is loaded in future sessions), unless the user edits the title changing it to another existing page (which would be considered another instance of the issue).
  • The "more details" will open a documentation page in a new tab/window with more details on publishing over an existing page.

Confirmation dialog

When the user tries to publish (even if the issue was marked as resolved), we want to remind that the content of the target page will be overwritten. We'll show a dialog asking for confirmation to proceed:

CX-error-publish-warning-confirm.png (720×1 px, 220 KB)

This should be shown if this is the only pending issue or there are no pending issues at all. If there are more issues, there is already a confirmation dialog (T190036) that we may want to adapt to communicate both messages instead of showing two dialogs one after the other:

CX-error-publish-warning-confirm-with-issues.png (720×1 px, 228 KB)


Related ticket: T188982

Event Timeline

Pginer-WMF created this task.
Pginer-WMF raised the priority of this task from Medium to High.Mar 26 2018, 11:45 AM

Change 424153 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Display dialog to confirm overwrite while publishing

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

Patch 424153 only shows the dialog when page with target title already exists, to allow user to publish anyway. Rest of the things this ticket specifies are going to be done separately, because we need more robust warnings and errors system in place.

Currently, when user tries to publish and page with target title exists, JS throws error instead of showing the dialog, which leaves user stuck and clueless about what's happening.

In case it wasn't clear from my above comment, once this ticket goes through QA for "Publish anyway" dialog, it should be moved back to "Priority backlog".
My assignment can be removed, so some other person becomes able to work on rest of the specs.

Change 424153 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Display dialog to confirm overwrite while publishing

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

In T162768#4125869, @Etonkovidova wrote:
(3) A warning to a user looks a little bit unbalanced in terms of space between lines and centering of the text. Also referring to "replacing the existing page" made me think that the source page might be replaced.

Screen Shot 2018-04-11 at 9.10.46 PM.png (383×945 px, 56 KB)

Yes, the dialog title is shown center aligned which is not working well for a longer text. Since we want to use the standard dialogs, I can propose to adjust the messaging to make it a bit better.

I updated the description with a new version for the text to better fit the current dialog format:

For translations without pending issues:

CX-error-publish-warning-confirm.png (720×1 px, 220 KB)

  • Title: Overwrite existing page?
  • Text: Your translation will overwrite the existing page. Please, make sure that it is ok to replace the existing content.

On translations with pending issues:

CX-error-publish-warning-confirm-with-issues.png (720×1 px, 228 KB)

  • Title: Overwrite existing page?
  • Text: Your translation will overwrite the existing page with content that still has potential issues. Please, consider checking the issues before publishing.

Change 425912 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Change publish anyway messages

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

Change 425912 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Change publish anyway messages

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

The warning message's look and functionality seem to be fine.

Screen Shot 2018-04-18 at 8.09.35 PM.png (349×461 px, 31 KB)

Notes for further testing:

Change 436778 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] CX2: Warn for existing titles

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

@Pginer-WMF what if the title translator provided is not a page but a redirect(or even disambiguation)? In that case, I guess we should provide the same warning. But that warning may be confusing since we miss to inform the user that it is a redirect.

@Pginer-WMF what if the title translator provided is not a page but a redirect(or even disambiguation)? In that case, I guess we should provide the same warning. But that warning may be confusing since we miss to inform the user that it is a redirect.

We should provide the same warning. In many cases a redirect represents an alternative name of the same concept. I'd not customize the message, but facilitate the exploration for the user to get the information to make a decision. In that regard, I created T196437 to help with that.

Change 436778 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] CX2: Warn for existing titles

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

This part from description isn't done yet:

"Mark as resolved" will make the issue to no longer be shown (even if the translation is loaded in future sessions), unless the user edits the title changing it to another existing page (which would be considered another instance of the issue).

It will need some storage of issues user marked as "resolved". T189488 already has the section about the same feature, and can be implemented in that ticket.

Also, same ticket is describing when issue card should be showing. Since the card will be more prominent than it is now, we will probably have all issues in one place, not scattered across sections and title. That means determining if there are pending issues when trying to publish will be easier and then we can display that other, customized "Publish anyway" dialog when needed. T190036 seems like a more appropriate place to have the second "Publish anyway" dialog, where such details can be described.

@Pginer-WMF - there are Special:ProtectedPages and

Special:ProtectedTitles. Presently, in cx2-testing it's possible to use protected titles and titles of protected pages to publish translations and only the warning will be given. Wouldn't it be a problem in production?

Checked in cx2-testing - the majority of the specs are done.
@Pginer-WMF - please review the following:

(1) The following spec-

Initially when the translation is loaded, if the initial translation title corresponds to an existing page in the target wiki.

Does it mean this warning - The page already exists in [...] - that users see when they start the translation from the New translation box?
When I click to start a new translation, the article loads with the source and target title identical - and no additional warning will be displayed.

(2) The pipeline indicator in the title and the side warning message/error details (and counter) update asynchronously. e.g. if you start correcting the article title for which "Page already exists" warning is displayed and delete whole title, the vertical yellow pipeline will change to red, but the the warning is still yellow.

Screen Shot 2018-06-18 at 10.20.41 PM.png (352×1 px, 54 KB)

Or if you enter the existing title after the blank title - the blank warning is stuck there.
Screen Shot 2018-06-18 at 10.21.15 PM.png (397×1 px, 83 KB)

To change warning, user needs to do an additional click outside the title - which is non-intuitive.

(1) The following spec-

Initially when the translation is loaded, if the initial translation title corresponds to an existing page in the target wiki.

Does it mean this warning - The page already exists in [...] - that users see when they start the translation from the New translation box?
When I click to start a new translation, the article loads with the source and target title identical - and no additional warning will be displayed.

The spec applies to the start of translation, however the translation was started - either through suggestion, "New translation" dialog or grey interlanguage links.
So, when user starts translating, if target title exists in target wiki, the warning should be shown. What you described with "the article loads with the source and target title identical" does not need to mean that target title exists in target wiki.

(2) The pipeline indicator in the title and the side warning message/error details (and counter) update asynchronously. e.g. if you start correcting the article title for which "Page already exists" warning is displayed and delete whole title, the vertical yellow pipeline will change to red, but the the warning is still yellow.

Screen Shot 2018-06-18 at 10.20.41 PM.png (352×1 px, 54 KB)

Or if you enter the existing title after the blank title - the blank warning is stuck there.
Screen Shot 2018-06-18 at 10.21.15 PM.png (397×1 px, 83 KB)

To change warning, user needs to do an additional click outside the title - which is non-intuitive.

What you have described is known behavior. Indicator ("pipeline" is the word you used) updates almost immediately, but if issue card needs to switch from error to warning or vice-versa, that isn't updated until you lose focus and give it back to the title input field again.

Thanks for the feedback @Etonkovidova.
I think the current ticket can be closed.
I created a couple of follow-up tickets:

I'll also investigate the overlap of different issues that you mentioned, and create separate issues if needed.