Render the language portlet's SkinAfterPortlet content (Wikibase Edit/Add links)#487
Merged
Merged
Conversation
ba470e9 to
70086f4
Compare
NavbarHorizontal\LangLinks rendered only the language_urls list and
discarded the SkinAfterPortlet hook output for the `lang` portlet, so the
Wikibase Client "Edit links" / "Add links" repository link (and anything
else contributing to that portlet) never appeared in the language menu.
The contribution is also present when the page has no language links of
its own, which the early return dropped entirely.
Surface getAfterPortlet('lang') in the component, and style the
contributed link as a dropdown item to match the language entries. The
link markup is left untouched so Wikibase's link-item JS, which binds to
.wb-langlinks-link > a, keeps working.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70086f4 to
b87c827
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In most skins, Wikibase Client adds an "Edit links" / "Add links" entry to the
"In other languages" menu, linking to the connected repository item so editors
can add or edit interlanguage links. In Chameleon this link never appears.
For #316.
Cause
NavbarHorizontal\LangLinksbuilds the language menu purely from thelanguage_urlstemplate data and never callsSkin::getAfterPortlet( 'lang' ),so the output of the
SkinAfterPortlethook is discarded. That hook is whereWikibase contributes its link (and where any extension may add to the language
portlet). The contribution is also present when the page has no language links
of its own (the "Add links" case), which the component dropped completely by
returning early.
Change
getAfterPortlet( 'lang' )inLangLinks, including when the pagehas no language links, while still emitting nothing when there is neither a
list nor a contribution.
items in a
div, while aSkinAfterPortletcontribution arrives in aspan,so the styling rule matches both.
This is generic
SkinAfterPortletsupport for the language portlet, notWikibase-specific: the contributed HTML is passed through untouched, so
Wikibase's own link-item JS still enhances the "Add links" link.
Verification
no language links of its own.
shows the language list followed by "Edit links"; an unconnected page shows
"Add links".
UI (Playwright), connected page "Berlin":
