Page MenuHomePhabricator

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

Assigned To
Authored By
Kizule
Aug 27 2019, 10:42 AM
Referenced Files
F34466442: Screen Shot 2021-05-24 at 3.06.59 PM.png
May 24 2021, 10:11 PM
F34466444: Screen Shot 2021-05-24 at 3.07.49 PM.png
May 24 2021, 10:11 PM
F34459338: en.m.wikipedia.org_wiki_User_Jdlrobson(iPhone 11 Pro Max).png
May 18 2021, 11:55 PM
F34459340: en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max) (1).png
May 18 2021, 11:55 PM
F34459348: en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max) (2).png
May 18 2021, 11:55 PM
F34459336: en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max).png
May 18 2021, 11:55 PM

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:

Screen Shot 2021-04-26 at 11.12.04 AM.png (116×306 px, 8 KB)

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.

QA Results - Beta

QA Results -Prod

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
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 TODO on the MinervaNeue board.
ovasileva triaged this task as Medium priority.Feb 17 2020, 2:12 PM
ovasileva added a subscriber: alexhollender_WMF.

@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.

F631F8F1-7E73-4746-AA97-A8751CDF896A.jpeg (1×750 px, 296 KB)

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:

Screen Shot 2021-04-14 at 5.23.29 PM.png (888×2 px, 158 KB)

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:

Screen Shot 2021-04-14 at 5.23.29 PM.png (888×2 px, 158 KB)

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
Screen Shot 2021-04-19 at 1.41.08 PM.png (52×39 px, 1 KB)
redo
Screen Shot 2021-04-19 at 1.41.30 PM.png (45×57 px, 1 KB)

any other ideas @RHo @Pginer-WMF?

In T231291#7015569, @alexhollender wrote:

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:

Screen Shot 2021-04-14 at 5.23.29 PM.png (888×2 px, 158 KB)

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
Screen Shot 2021-04-19 at 1.41.08 PM.png (52×39 px, 1 KB)
redo
Screen Shot 2021-04-19 at 1.41.30 PM.png (45×57 px, 1 KB)

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:

image.png (70×270 px, 3 KB)
Move
image.png (64×184 px, 2 KB)
What links here

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

image.png (448×450 px, 11 KB)

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
Screen Shot 2021-04-19 at 2.58.12 PM.png (47×140 px, 3 KB)
what links here
Screen Shot 2021-04-19 at 2.57.14 PM.png (56×90 px, 1 KB)
In T231291#7015880, @alexhollender wrote:

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
Screen Shot 2021-04-19 at 2.58.12 PM.png (47×140 px, 3 KB)
what links here
Screen Shot 2021-04-19 at 2.57.14 PM.png (56×90 px, 1 KB)

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.Apr 20 2021, 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: ✅ Pass
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

en.m.wikipedia.beta.wmflabs.org_wiki_Selenium_Echo_link_test_0.7791232640420875(iPhone 11 Pro Max).png (2×1 px, 203 KB)

✅ I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson but no protect link
en.m.wikipedia.beta.wmflabs.org_wiki_User_Jdlrobson(iPhone 11 Pro Max).png (2×1 px, 245 KB)

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

✅ I see no more menu on

en.m.wikipedia.beta.wmflabs.org_wiki_Selenium_Echo_link_test_0.7791232640420875(iPhone 11 Pro Max) (1).png (2×1 px, 228 KB)

✅I see a more menu on https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson but no protect links.
en.m.wikipedia.beta.wmflabs.org_wiki_User_Jdlrobson(iPhone 11 Pro Max) (6).png (2×1 px, 247 KB)

✅ 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.

en.m.wikipedia.beta.wmflabs.org_wiki_Special_MovePage_User_Jdlrobson(iPhone 11 Pro Max).png (2×1 px, 249 KB)

✅ 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.
en.m.wikipedia.beta.wmflabs.org_wiki_Selenium_Echo_link_test_0.7791232640420875(iPhone 11 Pro Max) (2).png (2×1 px, 266 KB)

✅ 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.
en.m.wikipedia.beta.wmflabs.org_wiki_User_Jdlrobson(iPhone 11 Pro Max) (4).png (2×1 px, 247 KB)

  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.

en.m.wikipedia.beta.wmflabs.org_wiki_Special_MovePage_User_Jdlrobson(iPhone 11 Pro Max) (2).png (2×1 px, 420 KB)

❌ 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.
en.m.wikipedia.beta.wmflabs.org_wiki_Selenium_Echo_link_test_0.7791232640420875(iPhone 11 Pro Max) (3).png (2×1 px, 269 KB)

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.
en.m.wikipedia.beta.wmflabs.org_wiki_User_Jdlrobson(iPhone 11 Pro Max) (5).png (2×1 px, 246 KB)

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

NOTE: This was already deployed and I missed the window to test in Beta. If an error is found in Prod testing I will revisit AC4.

@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?

Test Result - Prod

Status: ✅ Pass
Environment: enwiki
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.org/wiki/Doge

en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max).png (2×1 px, 1 MB)

✅ I see a more menu on https://en.m.wikipedia.org/wiki/User:Jdlrobson but no protect link
en.m.wikipedia.org_wiki_User_Jdlrobson(iPhone 11 Pro Max).png (2×1 px, 682 KB)

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

✅ I see no more menu on https://en.m.wikipedia.org/wiki/Doge

en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max) (1).png (2×1 px, 1 MB)

✅I see a more menu on https://en.m.wikipedia.org/wiki/User:Jdlrobson but no protect links.
en.m.wikipedia.org_wiki_User_Jdlrobson(iPhone 11 Pro Max) (1).png (2×1 px, 684 KB)

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

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

en.m.wikipedia.org_wiki_Special_MovePage_User_Jdlrobson(iPhone 11 Pro Max).png (2×1 px, 277 KB)

✅ I see a more menu on https://en.m.wikipedia.org/wiki/Doge but there are no links to protect, move or delete in the menu.
en.m.wikipedia.org_wiki_Doge(iPhone 11 Pro Max) (2).png (2×1 px, 1 MB)

✅ I see a more menu on https://en.m.wikipedia.org/wiki/User:Jdlrobson but there are no links to protect, move or delete in the menu.
en.m.wikipedia.org_wiki_User_Jdlrobson(iPhone 11 Pro Max) (2).png (2×1 px, 686 KB)

⬜ AC4: As logged in user on mobile site with AMC enabled WITH permissions.

@ovasileva, This was not tested in production due to account permissions. I suspect you can test this, so I'm leaving this in Needs QA in Prod instead of Ready for Signoff so it doesn't get forgotten.

⬜ Confirm that https://en.m.wikipedia.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.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.

⬜ I see a more menu on https://en.m.wikipedia.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 have QAed in production:

⬜ AC4: As logged in user on mobile site with AMC enabled WITH permissions.

✅ 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.

Screen Shot 2021-05-24 at 3.06.59 PM.png (1×1 px, 261 KB)

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

Screen Shot 2021-05-24 at 3.07.49 PM.png (1×1 px, 484 KB)

⬜ I see a more menu on https://meta.m.wikimedia.org/wiki/User:Jon_(WMF) and there are links to protect, move or delete in the menu. Each of those links should take you to a functional page.

This one is failing. Have set up a new task.
https://phabricator.wikimedia.org/T283549

Test wiki on Patch demo by Jdlrobson using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/2ecdde2a6a/w/