Page MenuHomePhabricator

AMC mode: No link to delete or move, protect and other admin and non-admin actions in Minerva
Open, MediumPublic5 Estimated Story Points

Description

Admins on mobile devices no have option to delete, protect or move pages. There is no link to non-admin features such as "page move".

With the completion of T274980 all of these pages are now mobile-friendly and should be made available in the UI as part of the overflow menu, to those that can use it as part of the "Advanced Mobile Contributions" mode.

Developer notes

Note: Delete is possible via accessing the URI https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain?action=delete - we just don't link to it.
Moving page on mobile is possible by accessing Special:MovePage/PageName and it is mobile friendly.

Acceptance criteria

  • New icons have been added to the existing skins.minerva.overflow.icons module: trash, lock, unLock and move
  • The DefaultOverflowBuilder and UserNamespaceOverflowBuilder are adapted to add the new actions based on the user and permission manager. For now duplicate the logic in SkinTemplate::buildContentNavigationUrls where necessary into useful helper methods.

e.g. for protection:

if ( $permissionManager->quickUserCan( 'protect', $user, $title ) &&
                                         $title->getRestrictionTypes() &&
                                         $permissionManager->getNamespaceRestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
                                ) {
                                        $mode = $title->isProtected() ? 'unprotect' : 'protect';
                                        $content_navigation['actions'][$mode] = [
                                                'class' => ( $onPage && $action == $mode ) ? 'selected' : false,
                                                'text' => wfMessageFallback( "$skname-action-$mode", $mode )
                                                        ->setContext( $this->getContext() )->text(),
                                                'href' => $title->getLocalURL( "action=$mode" )
                                        ];
                                }

QA steps

For purpose of QA, more menu refers to this element:

1. As anonymous user visiting mobile site.

2. As logged in user on mobile site with AMC disabled.

3. As logged in user on mobile site with AMC enabled WITHOUT permissions.

4. As logged in user on mobile site with AMC enabled WITH permissions.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

There's no special page "Special:Delete" even on the desktop web. Deletion is done with the action=delete parameter.
Rollback is now supported on mobile history/contributions in AMC mode.

Jdlrobson renamed this task from Deleting pages isn't possible on mobile to No link to delete action on mobile.Aug 28 2019, 8:58 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed a project: MobileFrontend.
Jdlrobson renamed this task from No link to delete action on mobile to No link to delete or move action on mobile.Aug 29 2019, 4:37 PM
Jdlrobson updated the task description. (Show Details)
Masumrezarock100 renamed this task from No link to delete or move action on mobile to No link to delete or move, protect and other admin and non-admin action on mobile.Sep 11 2019, 8:26 AM
Masumrezarock100 updated the task description. (Show Details)
Jdlrobson renamed this task from No link to delete or move, protect and other admin and non-admin action on mobile to No link to delete or move, protect and other admin and non-admin actions in Minerva.Jan 17 2020, 10:39 PM
Jdlrobson moved this task from Backlog to New adventures on the MinervaNeue board.
ovasileva triaged this task as Medium priority.Feb 17 2020, 2:12 PM
ovasileva added a subscriber: alexhollender.

@Volker_E out of interest There are delete icons and move icons in OOUI would those be the icons to use here? I assume these actions would go inside the overflow menu?

Actually, users can help themselves by simply using mw.util.addPortletLink. If added to the toolbox, the link will also appear in the overflow menu. Without icon, of course, but better than nothing. I will use that for the moment then ...

@Volker_E out of interest There are delete icons and move icons in OOUI would those be the icons to use here? I assume these actions would go inside the overflow menu?

I can only assume that the overflow menu mentioned here has other links with icons? A screenshot would clarify.
In general, yes, 'trash' and 'move' could probably be sufficient for those links.


Here a screenshot of the overflow menu; I have added the “move” link via addPortletLink.

Thanks @XanonymusX! That “Move” is indented wrongly without icon looks like a bug.
Move would be acceptable, but will say an 'articleMove' icon would be more my choice in an ideal world.

Small usability comment, I'd name the link “Move page”, not just “Move” to be clearer on first sight, what functionality the link brings me to.

Yeah, I just followed the label from the desktop version; as long as it’s just my personal gadget, I know what it means anyway. :D But I doubt that addPortletLink is ultimately the solution here; it means doubling all the links also in the desktop version (have to add it to common.js) and it gives no possibility to do anything about the formatting (as far as I know).

The correct solution would be in PHP per developer instructions. I am happy to help walk through how to do that if someone feels inclined to work on this.

Essentially it's 2 additions to the array based on permissions here:
https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/includes/Menu/PageActions/DefaultOverflowBuilder.php#L55

Zabe added a project: User-Zabe.
Zabe added subscribers: ovasileva, Zabe.

I would like to try this one.

Change 670271 had a related patch set uploaded (by Zabe; owner: Zabe):
[mediawiki/skins/MinervaNeue@master] Allow Users with permissions to do expanded actions in Minerva on mobile

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

@Jdlrobson Hey, I have the problem that I do not know how to determine if the person who is currently on the page has the necessary permissions to delete, protect, move, etc. a page. The problem with what was mentioned in the task description on how to determine this is that I don't have a user object or anything like that available.

Jdlrobson renamed this task from No link to delete or move, protect and other admin and non-admin actions in Minerva to AMC mode: No link to delete or move, protect and other admin and non-admin actions in Minerva.Mar 15 2021, 11:19 PM

Hi @alexhollender. Am looking for a design review on this one as this is close to done. I have setup a patchdemo

You can log in as admi using the password patchdemo1 and username Patch Demo

Remember to enable AMC or use Minerva desktop when testing e.g. https://patchdemo.wmflabs.org/wikis/2ecdde2a6a/wiki/Move_me?useskin=minerva.

You should see the new move, delete, protect admin actions here:

The move icon is a bit unexpected, but otherwise it looks promising!

Hi @alexhollender. Am looking for a design review on this one as this is close to done. I have setup a patchdemo

You can log in as admi using the password patchdemo1 and username Patch Demo

Remember to enable AMC or use Minerva desktop when testing e.g. https://patchdemo.wmflabs.org/wikis/2ecdde2a6a/wiki/Move_me?useskin=minerva.

You should see the new move, delete, protect admin actions here:

Looking great.

@Jdlrobson is there anything else I should check aside from how the menu looks? Do I need to tap on anything, etc?

I agree with @XanonymusX regarding the Move icon (despite the fact that it's the only OOUI icon actually called "move" lol). Two other possibilities might be:

share
redo

any other ideas @RHo @Pginer-WMF?

Hi @alexhollender. Am looking for a design review on this one as this is close to done. I have setup a patchdemo

You can log in as admi using the password patchdemo1 and username Patch Demo

Remember to enable AMC or use Minerva desktop when testing e.g. https://patchdemo.wmflabs.org/wikis/2ecdde2a6a/wiki/Move_me?useskin=minerva.

You should see the new move, delete, protect admin actions here:

Looking great.

@Jdlrobson is there anything else I should check aside from how the menu looks? Do I need to tap on anything, etc?

I agree with @XanonymusX regarding the Move icon (despite the fact that it's the only OOUI icon actually called "move" lol). Two other possibilities might be:

share
redo

any other ideas @RHo @Pginer-WMF?

Hmm, if the limitation is restricted to using existing OOUI icons, my first thought was to use the articleRedirect icon – currently being used in "What links here" – on for move instead, and perhaps use the articles icon for "What links here" instead since that seems less accurate use of the redirect icon?
Ie:

Move
What links here

An alternative might be to have a new icon for What links here that could look something like the following:

I agree with @RHo in the above comment.

the articleRedirect icon seems great for the "Move" action. However that means we also have to update the current icon used for "What links here" (for now we can just use the link icon from OOUI):

move
what links here

I agree with @RHo in the above comment.

the articleRedirect icon seems great for the "Move" action. However that means we also have to update the current icon used for "What links here" (for now we can just use the link icon from OOUI):

move
what links here

hi @alexhollender - I proposed either re-using the articles F34408370 icon earlier but just realised I pasted articleRedirect twice instead, I have amended the above comment. The reason I offered this or a new-link-inside-article icon F34407853 for "What links here" is because it seems the "permanent link" menu item is already using the link icon. Would you propose a different icon for "permanent link" in this case?

@RHo ah yes, thanks for clarifying and catching that detail. @Jdlrobson and I discussed: going to move forward with this as-is, and then I'll create a separate task for icon swapping.

ovasileva set the point value for this task to 5.Tue, Apr 20, 5:26 PM

Change 670271 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Allow Users with permissions to do expanded actions in Minerva on mobile

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

Edtadros added a subscriber: Edtadros.

@Jdlrobson Please take a look at the items marked ❌ . Could still be permissions so I'm leaving it in Needs QA.

Test Result - Beta

Status:
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: As anonymous user visiting mobile site.

✅ I see no more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_Echo_link_test_0.7791232640420875


✅ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson but no protect link

✅ AC2: As logged in user on mobile site with AMC disabled.

✅ I see no more menu on


✅I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson but no protect links.

✅ AC3: As logged in user on mobile site with AMC enabled WITHOUT permissions.

✅ Confirm that https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MovePage/User:Jdlrobson shows a permission error.


✅ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_Echo_link_test_0.7791232640420875 but there are no links to protect, move or delete in the menu.

✅ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson but there are no links to protect, move or delete in the menu.

  1. As logged in user on mobile site with AMC enabled WITH permissions.

❌ AC4:

✅ Confirm that https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MovePage/User:Jdlrobson does not show a permission error. Make sure AMC is enabled. If it shows a permission error, ask Jdlrobson to grant you permission to run this set of tests.


❌ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_Echo_link_test_0.7791232640420875 and there are links to protect, move or delete in the menu. Each of those links should take you to a functional page.

All links work, however, there are no protect or delete links.
❌ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson and there are links to protect, move or delete in the menu. Each of those links should take you to a functional page.

I see a More menu but it doesn't have links for protect, move, or delete"

@Jdlrobson Please take a look at the items marked ❌ above ( T231291#7046396). Could still be permissions so I'm leaving it in Needs QA.

@Jdlrobson Please take a look at the items marked ❌ above ( T231291#7046396). Could still be permissions so I'm leaving it in Needs QA.

I am not @Jdlrobson, but assuming you used this account https://en.wikipedia.beta.wmflabs.org/wiki/Special:CentralAuth/Edtadros-beta1, you have bureaucrat permissions, but not administrator permissions, which explains why you don't see the buttons.

@Edtadros you have admin rights for today. Please can you check now?