Page MenuHomePhabricator

Option to ignore targets that exist in MoveTranslatableBundle
Closed, ResolvedPublic2 Estimated Story Points

Description

Seen in T322486#8376843...

It could be useful to have an option to skip pages that the target exists. This can help where some subpages may have been moved already, but some haven't. Or just some targets exist, and as such, need more specific handling

Event Timeline

Note it is a bug, not a feature request, since you can’t move the page even if “Move all subpages” could be unchecked (actually, you can’t reach the step where you would uncheck this option).

EDIT: the bug is at T325817. This task is a feature request to allow moving movable subpages.

adding a checkbox, the blocked subpages are non-movable, so the checkbox is use for skipping non-blocked subpages

Move all subpages (Skip blocked subpages)

image.png (844×1 px, 90 KB)

Are blocked subpages listed somewhere? It’s important to know if there are only one or two subpages to be cleaned up manually, or dozens of them (and which subpages are blocked).

Are blocked subpages listed somewhere? It’s important to know if there are only one or two subpages to be cleaned up manually, or dozens of them (and which subpages are blocked).

Yes, you will see the information of "Pages blocking move of sub-pages" after the ticket T325817: Translatable page fails to move when one subpage target already exist merge, note that the copy text is still TBC.

image.png (370×1 px, 80 KB)

Change #1056512 had a related patch set uploaded (by Huei Tan; author: Huei Tan):

[mediawiki/extensions/Translate@master] Option to ignore targets that exist in MoveTranslatableBundle

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

abi_ set the point value for this task to 2.Jul 26 2024, 2:37 PM

Change #1056512 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MoveTranslatableBundle: Allow moving of non-blocked subpages

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

Allowing sub-pages to be moved make the script trying to move immovable sub-pages, so the log is populated with entries like this:
[USER] encountered a problem while moving page Foo/sub to Bar/sub
I wonder if it is acceptable.


We should also fix interface messages from T325817:
Pages blocking move of sub-pages → they do not block the move any more.
Proposal: “Non-movable sub-pages”

Since the following sub-pages cannot be moved for various reasons, no sub-page will be moved along.
Proposal: “The following sub-pages cannot be moved.”


Since the script is already costly, should we cache non-movable pages instead of checking again whether they can be moved? Is it safe to assume the movable-state will not change between the first check and applying move? Someone else may move a sub-page, but this is unlikely.

Change #1059079 had a related patch set uploaded (by Huei Tan; author: Huei Tan):

[mediawiki/extensions/Translate@master] Update the copy text for non movable subpages

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

Allowing sub-pages to be moved make the script trying to move immovable sub-pages, so the log is populated with entries like this:
[USER] encountered a problem while moving page Foo/sub to Bar/sub
I wonder if it is acceptable.

agree, we should not log it because we are not moving them.

image.png (142×1 px, 76 KB)

Change #1059102 had a related patch set uploaded (by Pols12; author: Pols12):

[mediawiki/extensions/Translate@master] [WIP] Cache page collection in session while moving

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

My patch saves pageCollection data in Session to solve the aforementioned log issue. I don’t know whether it is a good way to stash such data.

If we keep the caching way:
using cache prevents additional configuration from confirm page to be used (the 3 checkboxes).
My proposal is to add those checkboxes to first form.
If they are edited in second form, we invalidate cache and re-evaluate all pages which need to be moved.
Else, since no config is changed in confirmation page, we can use cached pageCollection data.

My patch saves pageCollection data in Session to solve the aforementioned log issue. I don’t know whether it is a good way to stash such data.

If we keep the caching way:
using cache prevents additional configuration from confirm page to be used (the 3 checkboxes).
My proposal is to add those checkboxes to first form.
If they are edited in second form, we invalidate cache and re-evaluate all pages which need to be moved.
Else, since no config is changed in confirmation page, we can use cached pageCollection data.

I'd create a separate task and discuss the benefits of doing this before we actually start working on this.

So, I would revert the last patch, because it will introduce wrong fails in log.
EDIT: I did not see hueitan’s WIP patch attempts to fix this issue removing non-movable subpages from list. That’s fine.

adding a checkbox, the blocked subpages are non-movable, so the checkbox is use for skipping non-blocked subpages

Move all subpages (Skip blocked subpages)

image.png (844×1 px, 90 KB)

Regarding the "Move all subpages (Skip blocked subpages)" option it seems to convey that all subpages will be moved except for the few that cannot be moved. However, the UI in T322582#10009874 seems to suggest that a single sub-page that cannot be moved would prevent any page from moving. If the behaviour is he later, maybe a message along the lines "Move all subpages (only if all can be moved)" or "Move all subpages (only if none is blocked)".

adding a checkbox, the blocked subpages are non-movable, so the checkbox is use for skipping non-blocked subpages

Move all subpages (Skip blocked subpages)

image.png (844×1 px, 90 KB)

Regarding the "Move all subpages (Skip blocked subpages)" option it seems to convey that all subpages will be moved except for the few that cannot be moved. However, the UI in T322582#10009874 seems to suggest that a single sub-page that cannot be moved would prevent any page from moving. If the behaviour is he later, maybe a message along the lines "Move all subpages (only if all can be moved)" or "Move all subpages (only if none is blocked)".

The UI text matches with T325817 behavior. It will be fixed for this task through https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/1059079 :

image.png (701×936 px, 83 KB)

Change #1059079 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MoveTranslatableBundle: Fix issues with non movable subpages

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

Change #1059102 abandoned by Pols12:

[mediawiki/extensions/Translate@master] [WIP] Cache page collection in session while moving

Reason:

Fix superseded by e6e1a8dd without stashing.

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