Page MenuHomePhabricator

[L] [Page Tools] Set default for pinnable state
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

We would like to set different defaults for the page tools menu

Acceptance criteria

  • Logged out users will not have the ability to pin the page tools open (Pinnable header should be hidden)
  • Logged out users will see the page tools menu as default dropdown
  • Logged-in users will see the page tools menu as default pinned
  • Make pinning/unpinning behavior persistent for logged-in users
  • Cumulative layout shift and last visual change metrics should not be affected by this change (e.g. we should not rely on JS to render the page tools into the correct position on page load)

QA

Pinned/Unpinned state persists while logged-in

  1. Login and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. Verify that page tools is visible in the right sidebar
  3. Click the "hide" button in page tools
  4. Verify that the page tools moves to the page toolbar
  5. Refresh the page
  6. Verify that the page tools remains in the page toolbar
  7. Toggle the page tools to make the menu visible and click the "move to sidebar" button
  8. Verify that the page tools moves to the right sidebar
  9. Refresh the page
  10. Verify that page tools remains in the right sidebar

Page tools is in the page toolbar when anonymous and is not pinnable

  1. Logout and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. Verify that page tools is visible in the page toolbar
  3. Toggle the page tools to make the menu visible and verify that the "move to sidebar" button is not visible

QA Results - Beta

QA Results - Prod

Event Timeline

Jdlrobson set the point value for this task to 1.Oct 31 2022, 5:40 PM
LGoto removed the point value for this task.
Jdlrobson set the point value for this task to 1.Oct 31 2022, 5:41 PM

Change 856718 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@master] POC: Set default pinnable state for page tools

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

Change 856718 abandoned by Nray:

[mediawiki/skins/Vector@master] POC: Set default pinnable state for page tools

Reason:

POC only

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

Change 856718 restored by Nray:

[mediawiki/skins/Vector@master] POC: Set default pinnable state for page tools

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

Change 856718 abandoned by Nray:

[mediawiki/skins/Vector@master] POC: Set default pinnable state for page tools

Reason:

POC Only

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

LGoto renamed this task from [Page Tools] Set default for pinnable state to [L] [Page Tools] Set default for pinnable state.Nov 15 2022, 6:20 PM
LGoto updated the task description. (Show Details)

Change 856718 restored by Nray:

[mediawiki/skins/Vector@master] POC: Set default pinnable state for page tools

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

I wanted to provide an update on this as I am OOO all of next week (starting Nov 21):

I have a work in progress patch that leverages our feature manager to handle the persistent pinning behavior of the page tools. It needs cleanup and tests, but is working. When I return, I plan to split it up into smaller patches and clean it up!

I've moved this to code review to get some early feedback on the approach (please see comments on the patch) before I spend time splitting up the patch and adding tests.

Change 863029 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@master] Convert LimitedWidthRequirement to UserPreferenceRequirement

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

Change 863029 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Convert LimitedWidthRequirement to UserPreferenceRequirement

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

Change 865786 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@master] Move limitedWidthToggle.js and features.js to skins.vector.es6 module

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

Change 865786 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Move limitedWidthToggle.js and features.js to skins.vector.es6 module

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

Change 856718 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Set default pinnable state for page tools

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

nray updated the task description. (Show Details)
nray updated the task description. (Show Details)

@ovasileva One question that came out of code review is whether we are planning to also add pinning persistence for the table of contents? Now that we have the infrastructure in place it could be relatively simple to do this. Do we have a ticket for this or are there plans to make one in the future?

@ovasileva One question that came out of code review is whether we are planning to also add pinning persistence for the table of contents? Now that we have the infrastructure in place it could be relatively simple to do this. Do we have a ticket for this or are there plans to make one in the future?

No current plans, but I agree that it would make sense as a clear next step. @alexhollender_WMF - would you have any concerns with persistence for the ToC?

@ovasileva One question that came out of code review is whether we are planning to also add pinning persistence for the table of contents? Now that we have the infrastructure in place it could be relatively simple to do this. Do we have a ticket for this or are there plans to make one in the future?

No current plans, but I agree that it would make sense as a clear next step. @alexhollender_WMF - would you have any concerns with persistence for the ToC?

are you referring to this T316060: [anon prefs] TOC pinned / unpinned status should persist across page views for anonymous users? If so, yes we should offer this feature.

@alexhollender_WMF Yes, that ticket captures the issue. The solution used for this ticket could also work for table of contents if all we want is logged-in persistence (which was the case for this ticket). The anon scenario requires more thought and work because it would probably rely on local storage + moving elements around in the DOM before they render.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Pinned/Unpinned state persists while logged-in

  1. Login and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. ✅ AC1: Verify that page tools is visible in the right sidebar

Screenshot 2022-12-18 at 1.40.47 PM.png (1×1 px, 590 KB)

  1. Click the "hide" button in page tools
  2. ✅ AC2: Verify that the page tools moves to the page toolbar

Screen Recording 2022-12-18 at 1.41.27 PM.mov.gif (758×1 px, 737 KB)

  1. Refresh the page
  2. ✅ AC3: Verify that the page tools remains in the page toolbar

Screen Recording 2022-12-18 at 1.42.39 PM.mov.gif (834×1 px, 1 MB)

  1. Toggle the page tools to make the menu visible and click the "move to sidebar" button
  2. ✅ AC4: Verify that the page tools moves to the right sidebar

Screen Recording 2022-12-18 at 1.44.37 PM.mov.gif (834×1 px, 604 KB)

  1. Refresh the page
  2. ✅ AC5: Verify that page tools remains in the right sidebar

Screen Recording 2022-12-18 at 1.45.10 PM.mov.gif (834×1 px, 853 KB)

Page tools is in the page toolbar when anonymous and is not pinnable

  1. Logout and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. ✅ AC6: Verify that page tools is visible in the page toolbar

Screenshot 2022-12-18 at 1.47.07 PM.png (783×1 px, 339 KB)

  1. ✅ AC7: Toggle the page tools to make the menu visible and verify that the "move to sidebar" button is not visible

See AC6 above

Edtadros subscribed.

Test Result - Prod

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

Test Artifact(s):

QA Steps

Pinned/Unpinned state persists while logged-in

  1. Login and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. ✅ AC1: Verify that page tools is visible in the right sidebar
  3. Click the "hide" button in page tools
  4. ✅ AC2: Verify that the page tools moves to the page toolbar
  5. Refresh the page
  6. ✅ AC3: Verify that the page tools remains in the page toolbar
  7. Toggle the page tools to make the menu visible and click the "move to sidebar" button
  8. ✅ AC4: Verify that the page tools moves to the right sidebar
  9. Refresh the page
  10. ✅ AC5: Verify that page tools remains in the right sidebar

Screen Recording 2022-12-18 at 1.49.44 PM.mov.gif (696×1 px, 737 KB)

Page tools is in the page toolbar when anonymous and is not pinnable

  1. Logout and visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog?vectorpagetools=1
  2. ✅ AC6: Verify that page tools is visible in the page toolbar

Screenshot 2022-12-18 at 1.51.49 PM.png (589×1 px, 264 KB)

  1. ✅ AC7: Toggle the page tools to make the menu visible and verify that the "move to sidebar" button is not visible

See AC6 above

Looks good! Resolving