Page MenuHomePhabricator

[Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport
Open, MediumPublic3 Estimated Story PointsBUG REPORT

Description

Steps to reproduce

  1. Login and visit https://en.wikipedia.org/w/index.php?title=Dog&diff=prev&oldid=1136163079
  2. Scroll halfway down the page

Expected results

  • The TOC has 30px of space between its top and the top of the viewport

Actual results

  • The TOC has ~93px of space between its top and the top of the viewport

2023-02-10_14-48-26.png (2×3 px, 1 MB)

Check any additional observations

Developer Notes

The cause of this is also the cause of T300612 (which remains unresolved) and will also affect the sticky page tools when logged-in T318169. In each issue, we have JS that prevents showing the sticky header on certain pages/actions, but the vector-sticky-header-enabled CSS class responsible for adding extra space to account for the height of a sticky header remains on the html element.

The easiest solution is to make the JS remove the vector-sticky-header-enabled class if the namespace or action doesn't allow a sticky header. But this would result in a possible layout shift of the sticky elements (TOC, page tools, etc).

Therefore, the best solution in terms of user experience and performance is to move the client-side logic responsible for determining whether the sticky header should show to the back-end. If the page doesn't allow the sticky header, the vector-sticky-header-enabled class should not be added to the html element.

Event Timeline

nray renamed this task from [Bug] Certain logged-in pages have too much space between the TOC and top of the viewport when logged-in to [Bug] Certain logged-in pages have too much space between the TOC, Page Tools and top of the viewport when logged-in.Feb 10 2023, 10:05 PM
nray renamed this task from [Bug] Certain logged-in pages have too much space between the TOC, Page Tools and top of the viewport when logged-in to [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport when logged-in.
nray updated the task description. (Show Details)
nray renamed this task from [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport when logged-in to [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport.Feb 10 2023, 10:08 PM
nray updated the task description. (Show Details)
nray renamed this task from [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport to [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport when logged-in.Feb 10 2023, 10:11 PM
nray updated the task description. (Show Details)
nray updated the task description. (Show Details)
nray updated the task description. (Show Details)
nray renamed this task from [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport when logged-in to [Bug] Certain logged-in pages have too much space between the top of TOC, Page Tools and top of the viewport.Feb 10 2023, 10:15 PM
nray updated the task description. (Show Details)

Is this a case where we want to keep and use the sticky header feature flag (https://phabricator.wikimedia.org/T332728)? The vector-sticky-header-enabled class is currently manually added in PHP based off the flag, and unlike the other feature classes is located on the body element instead of the html. Could we move the namespaces logic to a feature flag requirement and clean up our PHP?

Discussed in estimation, suggestion is to fix this by moving the logic for the sticky header to serverside rather than clientside. Specifically moving logic in makeStickyHeaderFunctional and https://github.com/wikimedia/mediawiki-skins-Vector/blob/be0476b17fd39218b90dcfcedbe7e5468bc9b16a/resources/skins.vector.es6/stickyHeader.js#L514-L538 to the feature management. Related comment here: https://phabricator.wikimedia.org/T332728#8746525

Jdrewniak set the point value for this task to 3.Thu, May 18, 6:07 PM