Page MenuHomePhabricator

Inconsistent anchor link behavior
Closed, ResolvedPublic3 Estimated Story Points

Description

Expected behavior

Navigating to an anchor link takes you to that heading

Observed behavior

On refresh, anchor links go to a position sightly below the correct anchor position, disregarding the header

Steps to reproduce

Go to https://api.wikimedia.org/wiki/API_reference/Core/Search/Search_content#Examples, and see that the "Examples" heading is hidden by the header. Same with https://api.wikimedia.org/wiki/API_reference/Core/Search/Search_content#Parameters and the "Parameters" heading

Event Timeline

apaskulin triaged this task as Medium priority.Sep 28 2020, 8:03 PM
apaskulin updated the task description. (Show Details)
Helga_sf raised the priority of this task from Medium to High.Oct 19 2020, 3:48 PM
Art.tsymbar set the point value for this task to 3.Oct 21 2020, 5:05 PM
apaskulin updated the task description. (Show Details)

Change 640699 had a related patch set uploaded (by Vlad.shapik; owner: Vlad.shapik):
[mediawiki/skins/WikimediaApiPortal@master] ScrollAdjust: Inconsistent anchor link behavior

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

Change 640699 merged by jenkins-bot:
[mediawiki/skins/WikimediaApiPortal@master] ScrollAdjust: Inconsistent anchor link behavior

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

@Vlad.shapik I tested this on beta, but I'm seeing not seeing the same behavior that I see locally. In the screenshot below, beta is on the left; my local copy is on the right. Both screenshots show the result of navigating to "Heading 2", but on beta, the heading is not aligned with the top of the screen the way it is locally.

Link on beta: https://api.wikimedia.beta.wmflabs.org/wiki/Test_page#Heading_2_2

Screen Shot 2020-11-16 at 8.47.51 AM.png (700×2 px, 439 KB)

Hi, @apaskulin! Thank you for comment.
As I understand we can test it on beta when code is merged. Am I right?
Anyway, I will start researching regarding it tomorrow.

@Vlad.shapik, that's correct. Usually, we wait a few hours after merging for the changes to be applied to the beta cluster, then I verify that the fix works on beta as expected and close the task. Based on when this patch was merged, we can assume that the change is live on beta.

I re-tested this on beta and found that it works perfectly. My apologies for the confusion, @Vlad.shapik, there must be have been something wrong in my earlier test.