Page MenuHomePhabricator

Improve repositioning of "Terms of Use" in footer links
Closed, ResolvedPublic

Description

Dedicated ticket for the issue I raised in https://phabricator.wikimedia.org/T60137#10414764 onwards.

Use case

  • When using MobileFronted, the whole footer is trimmed down. A "Terms of Use" link is removed, but since it is important, it is added back to the remaining footer links.

Problem

  • Some CSS is applied to move this link to the first position. That CSS is a float:left, which I itched on.

First attempt at solving

Next attempts
I suggested two alternatives here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/1105978/comments/bc634123_2dd654dc

Alternative 1:
Use the following, arguably cleaner, CSS:

#footer-place {
    display: flex;
}
#footer-places-terms-use {
    order: -1;
}

References:

Alternative 2:
Considering that these footer links are probably seldom used, just don't tweak the order, and make it do with "Terms of Use" coming after "Privacy policy".

  • @Jdlrobson stated he does want the "Terms of Use" link to be displayed first. This rules out alternative 2.
  • He suggested to consider augmenting the relevant hook, to let tweak the order of the elements (refs message). I'm not sure it would be worth the hassle, and the code complexification (refs message). But for sure, I'm not planning to look into it…
  • The remaining solution would be my alternative 1, which makes use of flex's order property.

Event Timeline

Firstly thanks for creating the ticket!

Perhaps the eight way to solve this is to put the link in the footer unconditionally and then tie it to the code thst simplifies the copyright message (thus removing said link).

The reason the link appears here is that mobile displays a shortened license.

Change #1105978 had a related patch set uploaded (by Jdlrobson; author: Anne Haunime):

[mediawiki/extensions/MobileFrontend@master] Remove hack to display "Terms of Use" first in footer links

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

Change #1105977 had a related patch set uploaded (by Jdlrobson; author: Anne Haunime):

[mediawiki/core@master] Ensure the "Terms of Use" footer link added by MobileFrontend is iterated first

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

I don't think we should complicate the hook or any other PHP-related parts. I have already looked into this and suspected such a change would be complicated to implement. It wouldn't be justified for that single use case.

I suggest we improve the CSS as suggested and call it a day.


About the implementation: instead of #footer-places, an optimal selector could be:

:where( .mw-footer ) .footer-places
/* or: */
:where( .minerva-footer ) .footer-places
  • Avoid using such a specific selector as an ID. For instance, users may want to apply a display: none to this element to streamline the page interface. On frwiki, I have already encountered many issues due to styles added by MobileFrontend that have too much specificity.
  • The .mw-footer acts as a safeguard, to ensure we target the MediaWiki interface, and not an unrelated element happening to have a class with the same name footer-places.
  • Use :where() to stay at a specificity of 010.
  • The rightmost selector is a simple one, this is for performance reasons.

Change #1105978 abandoned by Jdlrobson:

[mediawiki/extensions/MobileFrontend@master] Remove hack to display "Terms of Use" first in footer links

Reason:

Hack being removed in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/1118586

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

Change #1105977 abandoned by Jdlrobson:

[mediawiki/core@master] Ensure the "Terms of Use" footer link added by MobileFrontend is iterated first

Reason:

We are going ahead with 1118586 instead.

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

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

[mediawiki/extensions/MobileFrontend@master] Footer: drop hacks for hiding items in the footer

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

Change #1118586 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Footer: drop hacks for hiding items in the footer

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

Jdlrobson-WMF claimed this task.

Refs T387143, which solved the issue at hand.