Page MenuHomePhabricator

Persistent contribution entry point on the mobile navigation menu
Closed, ResolvedPublic5 Estimated Story Points

Assigned To
Authored By
Pginer-WMF
Jul 12 2021, 12:04 PM
Referenced Files
F35547559: Persistent - Create.png
Oct 5 2022, 10:13 AM
F35545176: image.png
Oct 3 2022, 11:20 AM
F35494478: Persistent - Contrib list.png
Aug 29 2022, 3:14 PM
F35494476: Persistent - Create.png
Aug 29 2022, 3:14 PM
F35316410: Screen Shot 2022-07-13 at 2.57.57 PM.png
Jul 13 2022, 10:01 PM
F35316408: Screen Shot 2022-07-13 at 2.56.56 PM.png
Jul 13 2022, 10:01 PM
F35316406: Screen Shot 2022-07-13 at 2.56.23 PM.png
Jul 13 2022, 10:01 PM

Description

NOTE: Currently no skins render the new menu. You will need to checkout https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/816209 prior to working on this (patch allows testing on Vector skin)

On mobile there is no clear way to find Section Translation. Although users may discover the tool by following a link to it or accepting an invite, they may have no clue on how to find the tool again. This ticket proposes to expand the menu options available on mobile to provide access to an area where new contributions (including translations can be made):

  • A "contribute" option will replace the current "Contributions" option, using the "pencil" icon and leading to a new tab on the Contributions page.
    • Subtitle. The menu option will have a sub-title listing some of the ways to contribute in order to anticipate to users what they will find after selecting the option. This message (in the future) can be customized based on the user to show the most relevant options for them.
  • The Contributions page will be updated to incorporate a tab selector providing access to two views: (a) "Create" will list options to start a new contribution, (b) "View contributions" will list the user contributions in the same they are shown now. The new view on the Contributions page will be only visible on the own user's contributions page (not when viewing someone else page).
    • Options to contribute. The initial options provided will be the same shown at the Contributions page on desktop by Content Translation (example) with the addition of "suggested edits". This will evolve in the future as more options are available.
    • Default view. The view to create a new contribution should be the default when reaching the page from the "Contribute" option. However, when reaching the page from the user page (where there is an option to access the user contributions) the list of existing contributions will be shown by default.

The proposed idea is illustrated in this prototype and in the mockups below:

Navigation menu with the new optionContributions page (new contributions)Contributions page (list of contributions)
sx-entry-persistent-menu.png (667×375 px, 46 KB)
Persistent - Create.png (903×375 px, 48 KB)
Persistent - Contrib list.png (1×375 px, 93 KB)

This approach is intended to increase visibility to translation in a scalable way (more contribution options can be incorporated in the future).

Design details

Navigation menu with the new option

"Contribute" option will be replace the existing "Contributions" one, using the pencil icon and the same text style as other options in the menu. Additional description text will be shown below the option. The description will use a smaller font (13px) in regular weight (not bold) and the same color.

Contribute
Translations, suggested edits…

  • The subtitle will be limited to one line of text using ellipsis to cut the sentence before it wraps.

Contributions page update

The Contributions page will be extended for the current user in order to incorporate a new view to start contributing. A tab selector will support switching to the list of contributions (which will be represented in the same way they are now).

Another small change proposed is to align the user name to the left (right on RTL languages) for a cleaner layout.

The whole cards are tappable, providing access to a page where a type of contribution can be made:

  • "Translations" links to Special:ContentTranslation in the current wiki. It uses the "language" icon.
  • "Suggested edits" will link to the newcomer homepage's suggested edits . It uses the "lightbulb" icon.
  • "Upload media" links to the Upload Wizard on Commons. It uses the "upload" icon.
  • "New page" links to Special:WantedPages in the current wiki. It uses the "article" icon.

Layout and styling details are described below:

sx-entry-persistent-dimensions.png (768×1 px, 127 KB)

Messages:

Translations
Translate one section or a whole article. Make more contents available in more languages.

[Start a translation]

Suggested edits
Make small and easy changes (e.g., add a link or copyedit) to improve existing articles.
[View suggested edits]

Upload media
Share educational images, videos, and other media files with a free license.

[Upload a file]

New page
Start a new article for a topic that has been requested.

[View missing pages]

Technical detail

Based on input from Language team engineers, it makes sense to support this in two parts:

  • The general entry point would be part of Mobile Frontend. This will provide the navigation menu option, reorganize the Contributions page in two tabs and provide some initial list of general options to start a contribution that can be expanded.
  • Extensions such as Content Translation will provide options to contribute by extending the previous list.

Gradual deployment

The changes described above (even when organized in two parts: general and translation-specific) will be deployed only to the wikis where Section Translation is available. In this way we make sure that users start experiencing the new entry point with a complete list of options (including the option to translate on mobile) and we learn gradually about the change in a limited context (i.e., not exposing a limited lit everywhere). this will require a configuration variable.

Currently Section Translation is available is Bengali Wikipedia, but soon the list may get expanded to more wikis (T285842).

Further improvements

Guidance captured in a separate ticket (T287569) will help users find the persistent entry point after they discovered the tool with another entry point. This will help in situations where the user gets an opportunistic invite (e.g., an article missing in a language) and is not sure how to get back to the tool.

QA / Acceptance criteria

  • A new page Special:Contribute will be added. It will have two tabs, which will be selected if they refer to the current page
  • A hook will allow the addition of cards to the page.
  • If I go to Special:Contribute the first tab will be selected

Tracked in separate tickets

  1. T319240 - The Special:Contributions will not show tabs by default (until the feature is completed)
  2. T319327 - When a feature flag is enabled on the beta cluster, the Special:Contributions page will show tabs to allow navigation to Special:Contribute

Sign off steps

  • Add task for enabling and removing the feature flag - T319362

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedJdlrobson
ResolvedTgr
DuplicateNone
Resolvedovasileva
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedNone
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedAmmarpad
Resolvedovasileva
Resolved Mabualruz
Resolvedovasileva
Resolvedovasileva
ResolvedKartikMistry

Event Timeline

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

Question for @Pginer-WMF could we have the URLs for the pages in the screenshots that we are hoping to link to? That would be super useful!

The options to contribute are expected to be provided by each extension. Based on previous conversations these are expected (using English Wikipedia mobile web as an example domain):

  • For Campaigns there was interest from the Campaigns team but I'm not sure about the specific url they will have to join and whether they will be providing two separate options (join and organize campaign) or a single one.
  • Regarding the more generic options (Upload media and New page) there were some questions on whether to provide them or not. They were originally added as simple options pointing to wanted pages and commons' upload wizard. However, Rita had good points (T286466#7934390) on guidance providing on these tools not being ideal. So we can consider having no defaults and just list what the different extensions provide (considering what to show when the list is empty)
Jdlrobson lowered the priority of this task from High to Medium.Aug 31 2022, 9:13 PM

Change 813927 abandoned by Jdlrobson:

[mediawiki/skins/MinervaNeue@master] [POC] Demonstrate sub pages functionality

Reason:

(Throwaway demo which has served its purpose)

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

Technical design and progress update:

P0: Add a new Special Page - Done
P0: Used hook to replace contribution page link to the new - Done
P0: Printing static HTML structure of the new page – ongoing
P0: Submit a patch for demo - Pending
P1: Add PHP classes for creating/managing cards - Pending
P1: Move html to templates - Pending
P2: Add hook and structure to manage cards - Pending
P3: Submit a patch for review - Pending
P3: Add contribution list tab content from old contribution with new design - Pending

Change 832744 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] Persistent contribution entry point on the mobile navigation menu

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

Change 832745 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/MinervaNeue@master] Persistent contribution entry point on the mobile navigation menu

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

@Mabualruz any updates on the patches? Please drop something into my calendar if you want to chat through anything here,.

@Mabualruz any updates on the patches? Please drop something into my calendar if you want to chat through anything here,.

Code is still in a broken state I am working on templating the html, once it is back on track I will do the styling and then look into the tab actions

ovasileva raised the priority of this task from Medium to High.Sep 22 2022, 5:28 PM

Change 832745 abandoned by Mabualruz:

[mediawiki/skins/MinervaNeue@master] Persistent contribution entry point on the mobile navigation menu

Reason:

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

Change 832744 merged by jenkins-bot:

[mediawiki/core@master] Persistent contribution entry point on the mobile navigation menu

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

To remaining issues:

  1. The tab should be bolded on Special:Contribute
  2. Add the tabs to Special:Contributions when feature flag is enabled. Default to false.

Change 836868 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] SpecialContribute: Frontend modifications

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

Change 836869 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] SpecialContribute: Enable icons on all skins

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

Change 836937 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] SpecialContribute Follow up

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

Change 836868 abandoned by Jdlrobson:

[mediawiki/core@master] SpecialContribute: Frontend modifications

Reason:

Merged into https://gerrit.wikimedia.org/r/c/mediawiki/core/+/836937

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

Change 836869 abandoned by Jdlrobson:

[mediawiki/core@master] SpecialContribute: Enable icons on all skins

Reason:

Merged into https://gerrit.wikimedia.org/r/c/mediawiki/core/+/836937

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

Change 836942 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] SpecialContribute Follow up

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

Change 836943 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] SpecialContribute Follow up

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

Change 836943 abandoned by Mabualruz:

[mediawiki/core@master] SpecialContribute Follow up

Reason:

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

Change 836942 abandoned by Mabualruz:

[mediawiki/core@master] SpecialContribute Follow up

Reason:

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

Change 836937 merged by jenkins-bot:

[mediawiki/core@master] SpecialContribute Follow up

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

When a feature flag is enabled on the beta cluster, the Special:Contributions page will show tabs to allow navigation to Special:Contribute

This is the last piece of the puzzle we need.

@santhosh @Pginer-WMF sorry we're running a bit late on this one. The bulk of the work is done.
The Special:Contribute page now exists: https://en.wikipedia.beta.wmflabs.org/wiki/Special:Contribute/Jdlrobson
and you can add to the cards via hook using the following code:

$wgHooks['ContributeCards'][] = function ( array &$cards ) {
	$cards[] = ( new MediaWiki\Specials\Contribute\Card\ContributeCard(
		'Translation',
		'Translate one section or a whole article. Make more content available in more languages.',
		'language',
		new MediaWiki\Specials\Contribute\Card\ContributeCardActionLink(
			SpecialPage::getTitleFor( 'ContentTranslation' )->getLocalUrl(),
			'Start a translation'
		)
	) )->toArray();
	$cards[] = ( new MediaWiki\Specials\Contribute\Card\ContributeCard(
		'Suggested edits',
		'Contribute to MediaWiki',
		'lightbulb',
		new MediaWiki\Specials\Contribute\Card\ContributeCardActionLink(
			SpecialPage::getTitleFor( 'Homepage' )->getLocalUrl( [ 'namespace' => -1 ] ) . '#/homepage/suggested-edits',
			'View suggested edits'
		)
	) )->toArray();
	$cards[] = ( new MediaWiki\Specials\Contribute\Card\ContributeCard(
		'Upload media',
		'Share educational images, videos, and other media files with a free license.',
		'upload',
		new MediaWiki\Specials\Contribute\Card\ContributeCardActionLink(
			SpecialPage::getTitleFor( 'UploadWizard' )->getLocalUrl(),
			'Upload a file'
		)
	) )->toArray();
};

The only thing we still need to do is handle the tab on Special:Contributions. That's taking a little longer given we don't want to surface this page just yet to users.

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

[mediawiki/extensions/ContentTranslation@master] Add Translation entrypoint in Special:Contribute

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

@Jdlrobson Thanks, this looks great.
I just submitted a patch to add Translations card. Screenshot below:
The ordering of cards looks arbitrary now. Should there be a way to specify the order? For example, what if we want to have 'New page' at top and then 'Translations' after that?

image.png (529×650 px, 30 KB)

Jdlrobson claimed this task.

After talking about this in standup, I'm going to create a new ticket with the remaining work.

The ordering of cards looks arbitrary now. Should there be a way to specify the order? For example, what if we want to have 'New page' at top and then 'Translations' after that?

$cards is passed by reference so you don't need to insert at the end of list. You can use wfArrayInsertAfter for example or sort it as needed. This is how we do it for other menus. e.g. https://gerrit.wikimedia.org/g/mediawiki/extensions/BetaFeatures/+/86fbc29db8b03e7f08691aa7fd34a0ed652a0a52/includes/Hooks.php#388

I've captured the remaining work into T319240. @Pginer-WMF @santhosh I presume that will leave you unblocked on us? Is there anything else you are expecting from us?

Yes, we are unblocked on this. Thanks.
Is there a ticket to add "Contribute" item in sidebar menu that takes the user to Special:Contribute?

Is there a ticket to add "Contribute" item in sidebar menu that takes the user to Special:Contribute?

Small clarification: theres is already a Contributions menu. The proposed adjustments would be to show it as "Contribute" (with pencil icon) when there are options to contribute, and include a second line of text surfacing some of those options.
These changes are more to facilitate discovery, so they can be introduced at a later stage if needed. They may be included in T319240 or have a separate ticket as it is more convenient.

@Pginer-WMF I've created T319327 for updating the link. We can coordinate around exactly when we do that - as I presume you don't want to surface this page until you are ready your side.

Jdlrobson updated the task description. (Show Details)

Closing out this one in favour of the more explicit tickets. Feel free to create new tasks for anything that's still not outstanding and not covered! Thanks for the collaboration here!

I've opened T319362 for handling the actual enabling of the feature.

Thanks a lot for the great work building this @Jdlrobson and @Mabualruz!!
I've also created a follow-up ticket for next steps on the Language side: T319306: Adjust visibility for the option to translate in the Persistent Contribution entry point

Change 837634 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Add Translation entrypoint in Special:Contribute

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

When I try to navigate to Special:Contribute from desktop Vector I get the Chrome ERR_TOO_MANY_REDIRECTS error. Is that known/expected?

When I try to navigate to Special:Contribute from desktop Vector I get the Chrome ERR_TOO_MANY_REDIRECTS error. Is that known/expected?

I just encountered this myself, and filed T320804: [S] Infinite redirect on Special:Contribute (mediawiki.org).

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

https://patchdemo.wmflabs.org/wikis/6cc022d180/w/