Page MenuHomePhabricator

SX: Move section positioning logic from client-side to server-side
Closed, ResolvedPublic

Description

During Section Translation publishing, new sections should be positioned before the first appendix section of the target article (if such appendix sections exist). However, this positioning is not natively supported by the "edit" API action, as this API action only supports replacing a section in a given position, not adding a new section to the position.

For this reason, in order to properly add a section to the desired position, we had to implement our own logic for this functionality. Currently, this logic resides in the client-side of the application, meaning that the contents of the new section that is being published are concatenated with the contents of the first appendix section, and this concatenated HTML string is published to the server.

Unfortunately, this client-side implementation has some side-effects that cannot easily be fixed using the current approach (e.g. T311470). This is why, we need to move this logic from the client to the server side, in order to fix the related issues and increase the stability and the predictability of the publishing functionality, since both the section handling and the publishing will happen in the same environment.

Event Timeline

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

[mediawiki/extensions/ContentTranslation@master] SX: Move section position before appendix sections to server-side

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

Change 819601 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Move section position before appendix sections to server-side

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

Change 823521 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220816

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

Change 823521 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220816

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

I tested successfully the section positioning functionality in the greek wikipedia, leaving this to QA to verify.

Notes to QA: Create a translation of a non-lead section that should be positioned before the first appendix section in the target (you can check the expected position of the published section inside the "Full article in target language" tab inside the "Compare contents" step of SX), and publish it. The expected result is that the published section is positioned just before the first appendix section inside the target article.

@ngkountas thanks for the clarification, I do believe similar was performed in T321671. If otherwise, you can put his back to the QA column. Marking this done