Page MenuHomePhabricator

[Sticky header] Restrict sticky header experience to logged in users on desktop with JavaScript enabled.
Closed, ResolvedPublic2 Estimated Story Points

Description

Currently, the sticky header feature flag enables the sticky header for everyone.

To begin with we are going to limit the sticky header to logged-in users on desktop resolutions. This will reduce the amount of work we need to build the feature. It is also not clear whether we should invest in making this a mobile experience, given most of our users on mobile devices are using Minerva.

Acceptance criteria / QA steps

  • The sticky header should never show if I am not logged in (note: the second version of the sticky header will include a version for anons)
  • If I disable JavaScript the sticky header should never show
  • The sticky header should be hidden below the device-tablet-desktop threshold. e.g. If I resize my browser (e.g. to 720px) it should disappear.

QA Results - Beta

ACStatusDetails
1T289714#7376494
2T289714#7376494
3T289714#7376494

QA Results - Prod

ACStatusDetails
1T289714#7376524
2T289714#7376524
3T289714#7376524

Event Timeline

Jdlrobson renamed this task from [Sticky header] Restrict sticky header experience to logged in users on desktop to [Sticky header] Restrict sticky header experience to logged in users on desktop with JavaScript enabled..Aug 25 2021, 6:20 PM
Jdlrobson updated the task description. (Show Details)

Currently, the sticky header feature flag enables the sticky header for everyone.

Is this true? It looks like feature is already equipped to do this and toggling the logged_out flag in my LocalSettings seems to work?

The sticky header should be hidden below the device-tablet-desktop threshold. e.g. If I resize my browser (e.g. to 800px) it should disappear.

The feature requirements listed in the epic might need to be updated if this is the case:

From T283505:

The header must be adaptable at lower screen resolutions (down to 500px)

Is this true? It looks like feature is already equipped to do this and toggling the logged_out flag in my LocalSettings seems to work?

Sounds like less work for the implementer then :) We might want to add an additional guard e.g. throw a runtime exception when logged out is enabled as we're not planning to support that for now.

The feature requirements listed in the epic might need to be updated if this is the case:

For context, we have decided to scope the feature to desktop only for the time being as we build out version 1. We plan to add this later based on time and feedback. So the epic is correct, and we should consider that future need while building. Does that make sense? I'm making a goal card which will hopefully clear this up.

of note.. if you add a sticky header, your anchor (section links) will anchor to behind ur header... which can be rather confusing.. might want to think about that as well when implementing this..

of note.. if you add a sticky header, your anchor (section links) will anchor to behind ur header... which can be rather confusing.. might want to think about that as well when implementing this..

Thanks @TheDJ, that's a great point. I wonder if this would be a good use case for using scroll-padding. I recorded a gif of what that might look like with the sticky header (please ignore the title on the sticky header, that's a bug):

2021-08-25 15.08.16.gif (1×2 px, 1 MB)

Edit: Turns out scroll-padding doesn't currently work with Safari and jump links 🤦: https://caniuse.com/?search=scroll-padding

For context, we have decided to scope the feature to desktop only for the time being as we build out version 1. We plan to add this later based on time and feedback. So the epic is correct, and we should consider that future need while building. Does that make sense? I'm making a goal card which will hopefully clear this up.

Thanks @Jdlrobson, that makes sense

ovasileva set the point value for this task to 2.

Change 717481 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Restrict sticky heaader visibility

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

cjming removed cjming as the assignee of this task.Sep 3 2021, 5:44 PM
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming subscribed.
cjming updated the task description. (Show Details)
cjming moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

@nray i was thinking that maybe its acceptable to auto hide the header upon navigating to an anchor after a couple ms. Then whenever you scroll it would unhide ? might be worth an experiment.

Change 717481 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Restrict sticky heaader visibility

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

@nray I had a similar issue with an earlier ToC prototype. Not sure whether or not this is a good practice but what I did was create an empty <span> element that's absolutely positioned 55px above the anchor link. When the browser scrolls the anchor link into view the span element acts as a spacer/padding sort of thing. In this case it's applied to the mini toc in the corner of the page, but I imagine the same approach could be used in the case of the <h2> elements.

https://di-toc-supplementary.web.app/Sushi

Test Result - Beta

Status: ✅ PASS
Environment: patchdemo
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: The sticky header should never show if I am not logged in (note: the second version of the sticky header will include a version for anons)

ezgif.com-gif-maker.gif (882×1 px, 2 MB)

ezgif.com-gif-maker (1).gif (882×1 px, 3 MB)

✅ AC2: If I disable JavaScript the sticky header should never show

Screen Recording 2021-09-24 at 6.56.22 AM.mov.gif (560×1 px, 1 MB)

✅ AC3: The sticky header should be hidden below the device-tablet-desktop threshold. e.g. If I resize my browser (e.g. to 720px) it should disappear.

Screen Recording 2021-09-24 at 6.58.44 AM.mov.gif (560×762 px, 1 MB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: The sticky header should never show if I am not logged in (note: the second version of the sticky header will include a version for anons)

Screen Recording 2021-09-24 at 7.03.56 AM.mov.gif (478×1 px, 2 MB)

Screen Recording 2021-09-24 at 7.12.44 AM.mov.gif (478×1 px, 2 MB)

✅ AC2: If I disable JavaScript the sticky header should never show

Screen Recording 2021-09-24 at 7.10.09 AM.mov.gif (478×1 px, 2 MB)

✅ AC3: The sticky header should be hidden below the device-tablet-desktop threshold. e.g. If I resize my browser (e.g. to 720px) it should disappear.

Screen Recording 2021-09-24 at 7.11.50 AM.mov.gif (478×736 px, 898 KB)