Page MenuHomePhabricator

Minerva namespace tabs does not use standard markup and does not work with gadgets
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Enable gadget that is using mw.util.addPortletLink.
  • Open mobile page.
  • No tab present.

What happens?:

This returns null:

...
var id = 'ca-example';
var nextEditUrl = '#example';
var parentId = 'p-namespaces';
var item = mw.util.addPortletLink( parentId, nextEditUrl, ">ᵉ", id, 'Edytuj następną', 'd', '#ca-nstab-page' );

See real code: https://pl.wikisource.org/wiki/MediaWiki:Gadget-EditNext.js

What should have happened instead?:

Add a portlet link with proper structure.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

The tab on desktop:

obraz.png (1,350×266 px, 30 KB)

QA

in beta cluster on mobile, make sure you are logged in and run

var id = 'ca-example';
var nextEditUrl = '#example';
var parentId = 'p-associated-pages';
var item = mw.util.addPortletLink( parentId, nextEditUrl, ">ᵉ", id, 'Edytuj następną', 'd', '#ca-nstab-page' );

and confirm a tab gets added

QA in production

QA Results - Beta

ACStatusDetails
1✅T340728#9434004

QA Results - Prod

ACStatusDetails
1✅T340728#9448710
1✅T340728#9448710

Event Timeline

Jdlrobson subscribed.

This is a bug in Minerva. This API exists, so this gadget should just work.

Minerva's tabs should have the id p-associated-pages

I think this can be fixed by replacing the following:

{{#data-minerva-tabs}}
					<div class="minerva__tab-container">
						{{#items}}
							<a href="{{href}}" rel="{{rel}}" class="minerva__tab {{class}}" data-event-name="tabs.{{context}}">{{text}}</a>
						{{/items}}
					</div>
				{{/data-minerva-tabs}}

with:

{{#data-minerva-tabs}}
					{{#data-portlets.data-associated-pages}}
					<div class="minerva__tab-container" id="{{id}}">
						{{#items}}
							<a href="{{href}}" rel="{{rel}}" class="minerva__tab {{class}}" data-event-name="tabs.{{context}}">{{text}}</a>
						{{/items}}
					</div>
					{{/data-portlets.data-associated-pages}}
				{{/data-minerva-tabs}}
Jdlrobson renamed this task from Portlet or other api to add tabs to minerva (mobile) to Minerva namespace tabs does not use standard markup and does not work with gadgets.Jul 19 2023, 4:56 PM
Jdlrobson moved this task from Backlog to TODO on the MinervaNeue board.
bwang triaged this task as Medium priority.Jul 20 2023, 5:35 PM
bwang raised the priority of this task from Medium to Needs Triage.
bwang moved this task from Incoming to Current Fiscal Year on the Web-Team-Backlog-Archived board.
Jdlrobson triaged this task as Medium priority.Jul 20 2023, 5:35 PM

Change 983960 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/MinervaNeue@master] Rework tabs to use unordered list

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

Works perfectly! Nice job @SToyofuku-WMF ! If you could open a new patch to remove the FIXME and mark it as WIP or -2 it we can merge that once the change gets deployed in January. Since it's December, otherwise I worry we might forget!

Jdlrobson added a subscriber: Edtadros.

Oops! I forgot we haven't completely done this yet so moving back to doing :)

Change 983960 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Rework tabs to use unordered list

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

Change 984646 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/MinervaNeue@master] Remove old styles for unnested tabs

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

Change 984649 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/MinervaNeue@master] [WIP] Use data-associated-pages for tab rendering, and fix portlet links

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

Change 984649 abandoned by Stoyofuku-wmf:

[mediawiki/skins/MinervaNeue@master] [WIP] Use data-associated-pages for tab rendering, and fix portlet links

Reason:

Talked with Jon and going to avoid changing quite so much for now - will revisit the associated pages changes when I understand things a little bit better

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

Change 984992 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/MinervaNeue@master] Allow addPortletLink to target tabs/associated pages

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

Change 984992 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Allow addPortletLink to target tabs/associated pages

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

Jdlrobson updated the task description. (Show Details)

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: in beta cluster on mobile, make sure you are logged in and run the code and confirm a tab gets added

{F41649986}

Test Result - Prod

Status: ✅ PASS
Environment: cawiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Go to https://ca.wikipedia.org/wiki/Especial:Prefer%C3%A8ncies#mw-prefsection-gadgets and enable DocTabs
✅ AC1: Visit https://ca.wikipedia.org/wiki/Plantilla:Infobox and check a tab adds on desktop

screenshot 394.png (940×602 px, 96 KB)

✅ AC2: Switch to mobile and confirm the same tab is added.

screenshot 395.png (946×751 px, 124 KB)

Change 984646 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Remove old styles for unnested tabs

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