Page MenuHomePhabricator

Settings cog should use modal used for anonymous users
Open, LowPublic

Description

From T192710: [Feedback] Personal observations about the page previews feature usability

Proposal: treatment will be exactly same as it is for anonymous users.

However rather than saving to localStorage we will use the api to update the related user preference

developer notes

  • we will need to pass the preferences key to the client. mw.user.options can be used for the rest
  • we will need to deal with the asynchronous nature of the save. When hitting done what should happen? Should we show a spinner or should we just show a toast when the action has been completed? What if there is an error while saving?

Replication steps

  • Login to page previews
  • Hover over a preview
  • Click settings cog

Expected: I can disable page previews within a modal without leaving the page
Actual: I am unexpectedly navigated to Special:Preferences to disable the settings, losing my context in the article.

Event Timeline

@alexhollender ping. Anything to do here?

@Jdlrobson I think it would make sense to use the modal we've implemented for logged out users as a shortcut here for logged in users. So if I'm logged in and I hit the gear icon on a page preview I should get this modal:

Screen Shot 2018-07-30 at 9.03.05 AM.png (661×1 px, 257 KB)

In this case you wouldn't be shown were the "master" version of the setting is located in your preferences, but I'm not sure that's an actual problem? We could also add a link at the bottom of the modal (for logged in users only) that's like "Go to preferences" and land them at the #mw-prefsection-rendering-reading section

Jdlrobson renamed this task from Settings cog should link to #mw-prefsection-rendering-reading to Settings cog should use modal used for anonymous users.Jul 31 2018, 7:32 AM
Jdlrobson updated the task description. (Show Details)

@alexhollender we will need some mocks to deal with the async behaviour. What happens when save is hit and the save fails? What about when the save is slow?

ovasileva moved this task from Needs Analysis to Hovercards Pt2 on the Page-Previews board.

@Jdlrobson could you check if you can still reproduce this? Perhaps it somehow resolved itself... I just clicked the gear icon as an anonymous user and was shown the preferences modal:
https://s3.amazonaws.com/img0.recordit.co/PBS3egOsQN.mp4?AWSAccessKeyId=AKIAINSRFOQXTN4DT46A&Expires=1537898860&Signature=f%2BhtueezPrCw6kD4ioQwVf8LYeg%3D

^ I can replicate it. I suspect you were confused by the task so I added some replication steps.