Page MenuHomePhabricator

Preview and publish: Support additional options for publishing destination conflicts
Open, In Progress, MediumPublic4 Estimated Story Points

Description

As part of the "Preview and publish" step (T252542) of the mobile editor for Section Translation, users can publish their translation contents after previewing them.

For the specific case where there may be publishing conflicts, we want to expand the basic publishing options (T260130) with some additional ones for the user to deal with the conflict.

Publish - Conflicts.png (768×1 px, 184 KB)

Two additional options are provided: "Add contents to existing section" and "Replace existing section". The complete list of options provided when there is a publishing conflict will be:

Publish as a new section
Add a new section to the article.

Add contents to existing section
Expand the existing section preserving their contents.

Replace existing section
Delete the existing section, adding your translation instead.

Publish to your Sandbox
Publish in your personal space for you to review and copy them elsewhere.

More details in the parent task: T252542: Section Translation Editor: Preview and publish


Derived Requirement

Ensure that during the "Preview and publish" step of the Section Translation mobile editor, when a publishing destination conflict occurs, the system displays an expanded list of publishing options that allow the user to handle the conflict appropriately. The available options should include:

  • Publish as a new section
  • Add contents to existing section
  • Replace existing section
  • Publish to your Sandbox

Each option should execute the corresponding publishing behavior and resolve the conflict without breaking the publishing flow.

Test Steps

Test Case 1: Verify visibility of expanded publishing options during conflict

  1. Open the Section Translation mobile editor on beta wiki.
  2. Translate a section of an article that already exists in the target article.
  3. Proceed to the Preview and publish step.
  4. ✅❓❌⬜ AC1: Confirm that a publishing conflict message appears when a section with the same title exists.
  5. ✅❓❌⬜ AC2: Confirm that all four publishing options are visible:
    • Publish as a new section
    • Add contents to existing section
    • Replace existing section
    • Publish to your Sandbox

Test Case 2: Verify functionality of “Add contents to existing section” option

  1. Select Add contents to existing section when the conflict message appears.
  2. Complete the publish flow.
  3. Navigate to the target article.
  4. ✅❓❌⬜ AC3: Confirm that the translated contents are appended to the existing section while preserving the original section text.

Test Case 3: Verify functionality of “Replace existing section” option

  1. Return to the translation screen and repeat the translation of the same section.
  2. This time, select Replace existing section.
  3. Publish the translation.
  4. ✅❓❌⬜ AC4: Confirm that the existing section in the target article is completely replaced with the new translation content.

Test Case 4: Verify functionality of “Publish as a new section” option

  1. Select Publish as a new section from the available options.
  2. Publish the translation.
  3. ✅❓❌⬜ AC5: Confirm that a new section with the translated content is added to the article, leaving existing sections unchanged.

Test Case 5: Verify functionality of “Publish to your Sandbox” option

  1. Select Publish to your Sandbox from the options.
  2. Publish the translation.
  3. Navigate to your user sandbox page.
  4. ✅❓❌⬜ AC6: Confirm that the translated content appears correctly in the user’s sandbox and is not published to the main article.

QA Results - Meta Beta

ACStatusDetails
1T260131#11321296
2T260131#11321296
3Pass per T260131#11324772
4T260131#11321296
5Pass per T260131#11324772
6T260131#11321296

Event Timeline

Change #1166771 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX: Add usePublishTarget composable

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

Change #1166772 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SXPublisher: Add existing section title link if it exists

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

Change #1167584 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SXPublisher: Properly support "expand" publishing target

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

Change #1167584 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SXPublisher: Properly support "expand" publishing target

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

Change #1166772 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SXPublisher: Add existing section title link if it exists

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

Change #1171255 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250721

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

Change #1171255 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250721

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

Change #1183156 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX: Add support for replacing existing target section

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

SBisson moved this task from Backlog to Needs Code Review on the LPL Hypothesis board.
SBisson subscribed.

Putting this on the board for visibility since there's a patch waiting for review

Nikerabbit set the point value for this task to 4.

Change #1183156 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Add support for replacing existing target section

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

Change #1197335 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20251020

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

Change #1197335 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20251020

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

@ngkountas Please Review AC3 and AC5, thanks!

Test Result - Test Wiki

Status: ✅ PASS ❌ FAIL
Environment: Test Wiki
OS: macOS Tahoe 26.0.1
Browser: Chrome 141
Device: MBA
Emulated Device: iPhone SE

Test Artifact(s):
English -> Spanish: Athletics ; Cope de la Liga

Test Steps

Test Case 1: Verify visibility of expanded publishing options during conflict

  1. Open the Section Translation mobile editor on test wiki.
  2. Translate a section of an article that already exists in the target article.
  3. Proceed to the Preview and publish step.
  4. AC1: Confirm that a publishing conflict message appears when a section with the same title exists.

2025-10-28_08-55-51.png (809×855 px, 74 KB)

  1. AC2: Confirm that all four publishing options are visible:
    • Publish as a new section
    • Add contents to existing section
    • Replace existing section
    • Publish to your Sandbox

2025-10-28_08-55-44.png (875×857 px, 107 KB)

Test Case 2: Verify functionality of “Add contents to existing section” option

  1. Select Add contents to existing section when the conflict message appears.
  2. Complete the publish flow.
  3. Navigate to the target article.
  4. AC3: Confirm that the translated contents are appended to the existing section while preserving the original section text.

I replaced the first sentence in Format as seen in the video but it kept it and added what I had at the bottom of the section of "Format"

Test Case 3: Verify functionality of “Replace existing section” option

  1. Return to the translation screen and repeat the translation of the same section.
  2. This time, select Replace existing section.
  3. Publish the translation.
  4. AC4: Confirm that the existing section in the target article is completely replaced with the new translation content.

Test Case 4: Verify functionality of “Publish as a new section” option

  1. Select Publish as a new section from the available options.
  2. Publish the translation.
  3. AC5: Confirm that a new section with the translated content is added to the article, leaving existing sections unchanged.

I only changed one sentence in the 2nd paragraph and it replaced everything in "History"

Test Case 5: Verify functionality of “Publish to your Sandbox” option

  1. Select Publish to your Sandbox from the options.
  2. Publish the translation.
  3. Navigate to your user sandbox page.
  4. AC6: Confirm that the translated content appears correctly in the user’s sandbox and is not published to the main article.

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF changed the task status from Open to In Progress.Oct 28 2025, 9:34 PM
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

@GMikesell-WMF thank you for all the work! I watched your screencasts for the failed test cases, and I feel that both of them should be considered successful.

  1. Regarding AC3 the expected result is that the translated contents are appended to the existing section while preserving the original section text. Checking the screencast I see the following:
    • You translated the "Format" section from the source article, and there is already a similar target section named "Formato"
    • You skipped translating the section title, and thus the original source section title is used ("Format").
    • You selected to expand the existing section ("Formato") with the published translation.
    • After publishing, the "Formato" target section has been renamed to "Format" (since this was the published section title), and the test content ("burgers burgers burgers") is appended to the contents of the existing target section in Spanish, which is the expected result. Thus, I believe the test was successful.
  1. Regarding AC5 the expected result is that a new section with the translated content is added to the article, leaving existing sections unchanged. Again, checking the screencast I see the following:
    • You translated the "History" section from the source article, and there is already a similar target section named "Historia"
    • You skipped translating the section title, and thus the original source section title is used ("History").
    • You selected to publish the translation as a new section with section title "History".
    • After publishing, a new section named "History" has been created, just above the already existing "Historia" section. The contents of the new section ("History") are exactly the contents that have been published ("This is just a test and only a test"). Thus, I believe that this test was also successful.

Please let me know if I am missing anything or if I can help in any other way.

Change #1202056 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX desktop editor: Fetch section mappings for all section translations

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

Change #1202056 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX desktop editor: Fetch section mappings for all section translations

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

@GMikesell-WMF thank you for all the work! I watched your screencasts for the failed test cases, and I feel that both of them should be considered successful.

  1. Regarding AC3 the expected result is that the translated contents are appended to the existing section while preserving the original section text. Checking the screencast I see the following:
    • You translated the "Format" section from the source article, and there is already a similar target section named "Formato"
    • You skipped translating the section title, and thus the original source section title is used ("Format").
    • You selected to expand the existing section ("Formato") with the published translation.
    • After publishing, the "Formato" target section has been renamed to "Format" (since this was the published section title), and the test content ("burgers burgers burgers") is appended to the contents of the existing target section in Spanish, which is the expected result. Thus, I believe the test was successful.
  1. Regarding AC5 the expected result is that a new section with the translated content is added to the article, leaving existing sections unchanged. Again, checking the screencast I see the following:
    • You translated the "History" section from the source article, and there is already a similar target section named "Historia"
    • You skipped translating the section title, and thus the original source section title is used ("History").
    • You selected to publish the translation as a new section with section title "History".
    • After publishing, a new section named "History" has been created, just above the already existing "Historia" section. The contents of the new section ("History") are exactly the contents that have been published ("This is just a test and only a test"). Thus, I believe that this test was also successful.

Please let me know if I am missing anything or if I can help in any other way.

@ngkountas I see what you are saying now. I guess I got a little confused on the "Format" vs "Formato" part. Thanks for the explanations and I will move them to Sign-off.

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.
Pginer-WMF added a subscriber: SGautam_WMF.

As illustrated by @SGautam_WMF in T392474#11439214, the option to "Publish as a new section" was not showing on mobile. This ticket proposes to support 4 options, but only three seem supported right now on mobile:

  • Publish as a new section (pending)
  • Add contents to existing section (supported)
  • Replace existing section (supported)
  • Publish to your Sandbox (supported)
ProposedCurrent
Publish - Conflicts.png (768×1 px, 184 KB)
test.wikipedia.org_w_index.php_title=Special_ContentTranslation&from=en&to=hi&sourcesection=References&targetsection=%E0%A4%B8%E0%A4%A8%E0%A5%8D%E0%A4%A6%E0%A4%B0%E0%A5%8D%E0%A4%AD&publishtarget=EXPAND&page=England%20women%27s%20cricket%20t.png (1×750 px, 184 KB)

@Pginer-WMF the "Publish as a new section" option is available on mobile for non-lead sections. The screenshot you shared above is for a present lead section. For lead sections, we do not include the "Publish as a new section" option, because we do not have any target section title that we can use for such publishing. If we want to support the "Publish as a new section" option, too, what target section title do you think we should use?

@Pginer-WMF the "Publish as a new section" option is available on mobile for non-lead sections. The screenshot you shared above is for a present lead section. For lead sections, we do not include the "Publish as a new section" option, because we do not have any target section title that we can use for such publishing. If we want to support the "Publish as a new section" option, too, what target section title do you think we should use?

For lead sections, it makes sense not to show an option to "publish as new section". Translating a lead section makes the most sense when starting a new article or replacing/complementing the existing lead section if the existing one is lacking information. So not showing the "publish as new section" in this case is totally fine.

I don't know of relevant use cases that suggest it is worth making the effort to provide custom support for this (allow user to provide a section title, or giving a default one that users need to change anyways). So we can just let users reorganize content after publishing in this case.

Thanks @Pginer-WMF! I think in this case everything in this task is resolved, and we can move the task to "Product Signoff" column.