Page MenuHomePhabricator

Make toasts tappable links when redirecting a user away from a page
Open, NormalPublic3 Story Points

Description

Problem

As a user when I am automatically redirected away from a page, I see a toast but there is no way to return to the page I was redirected from.

Suggested solution

Primarily to service T146596: Make redirect into a toast message, toast messages can also carry actions. Pass url and label as 2 additional parameters to the Toast.show function.

Acceptance criteria

Redirected from \"$1\"

but it should be accompanied by the action

Show redirect

Design

Other toast designs for reference

Default toast without action
https://zpl.io/1CDO7m

Short toast with one action
https://zpl.io/2kTf7Y

Loong toast with long action
https://zpl.io/rQqXy

Two line with action
https://zpl.io/CroBW

Developer notes

We want to make this a generic capability so future features can also make use of it

  • When a toast has an associated action a 'show' label appears on the right hand side of the toast
  • When clicking the toast action the user is navigated to that link ?action=edit&redirect=no

QA steps

Test with https://readingwebstaging.wmflabs.org/w/index.php?title=Spain_redirect

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
bmansurov triaged this task as High priority.Nov 7 2016, 6:14 PM
bmansurov moved this task from Incoming to Upcoming on the Readers-Web-Backlog board.

So if I understand correctly this would be a parameter for a toast that when the entire thing is clicked the user is taken somewhere?
Why is this high @ovasileva and @bmansurov ? It's not obvious why - it doesn't seem high - please can you explain in task if this is true.
What are the use cases?

ovasileva lowered the priority of this task from High to Normal.Nov 23 2016, 4:38 PM

I agree with @Jdlrobson, changing to normal.

I remember a redirect use case - it would be good to capture this in the task as right now this task lacks a "why". Moving back to needs analysis until someone can provide this.

Don't toast messages, by definition, not require an input from the user?

@Nirzar what do you think?

@Nirzar - should we style the article name as a link then?


we can simply treat link as underline. first i tried a separate action on the toast that says "view" or go to that page but we want to have the functionality to go to redirect page and not encourage it for readers as that page has almost no reader value.

Nirzar updated the task description. (Show Details)Dec 14 2016, 11:15 PM
Jdlrobson assigned this task to Nirzar.Apr 13 2017, 7:14 PM

T95305 looks like a good use case?
@Nirzar how does this relate to T155835 ?

@Nirzar how does this relate to T155835 ?

no flood gates please, let's have structured way to toast. adding "single action" to toast messages should be an upstream task.

T95305 looks like a good use case?

Yes, similar use case. single action

Jdlrobson removed Nirzar as the assignee of this task.Apr 19 2017, 6:50 PM
Jdlrobson added a project: patch-welcome.
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Apr 19 2017, 6:54 PM

@Nirzar hope the current description makes sense. To get the underlined link we'd need to allow HTML in toast messages.. this opens up the door for multiple links to be put in there (but we can make sure we don't do that). To avoid flood gates, I've suggested we handle any HTML with multiple links by only allowing the first link to work. Does that make sense?

Alternatively we could throw an error to the developer and not show the toast at all in that situation. What would you prefer?

Jdlrobson assigned this task to Nirzar.May 1 2017, 6:36 PM

Awaiting your thoughts. If good to go, please move to triaged but future and remove yourself as assignee.

Nirzar added a comment.May 2 2017, 3:39 PM

i was thinking of more like _toast action_ instead of hyperlink. the underline is just for affordance. we don't actually have to have an <a>nchor tag inside. but if you put it on toast config level, it can be only 1 action.

Nirzar updated the task description. (Show Details)May 2 2017, 10:49 PM
Jdlrobson renamed this task from Make toasts tappable links to Make toasts tappable links when redirecting a user away from a page.May 2 2017, 11:43 PM
Jdlrobson updated the task description. (Show Details)

I talked with @Nirzar about this.
@Nirzar once you've updated the screenshot and added the zeplin link please remove yourself as assignee and move to triaged but future.

Nirzar updated the task description. (Show Details)May 3 2017, 11:45 PM
Jdlrobson updated the task description. (Show Details)May 3 2017, 11:49 PM
Jdlrobson lowered the priority of this task from Normal to Low.May 3 2017, 11:56 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed Nirzar as the assignee of this task.Jun 20 2017, 10:37 PM
Jdlrobson raised the priority of this task from Low to Normal.Feb 6 2018, 5:48 PM

Could this be useful in the settings page @Nirzar ?

alexhollender updated the task description. (Show Details)Jun 4 2019, 3:28 PM
alexhollender added a subscriber: alexhollender.

@Jdlrobson it looks like the design work for this task is complete. I've updated the description to include the mock.

pmiazga added a subscriber: pmiazga.Jun 6 2019, 3:22 PM

I'm concerned, if we start showing the "action" that allows users to go back, they will see pretty ugly page:

https://en.m.wikipedia.beta.wmflabs.org/wiki/Obama?redirect=no

Do we have a plan where to use this functionality? Maybe some AMC feature? I cannot find a valid reason why regular user wants to go back to the redirect page.
/cc @ovasileva

I'm concerned, if we start showing the "action" that allows users to go back, they will see pretty ugly page:

I'm not sure if ugly is the right word.. it's functional. Maybe rather than "show redirect", we should make the call to action "edit redirect" - since most people will want to edit the page.

This recently got surfaced on Wikivoyage by a rightly frustrated editor: https://en.wikivoyage.org/wiki/Wikivoyage:Travellers%27_pub?markasread=288124&markasreadwiki=enwikivoyage#Can%E2%80%99t_block_users_on_iPhone

Jdlrobson raised the priority of this task from Normal to High.Jul 1 2019, 9:05 PM

Bumping for visibility so we can talk about the community discussion and potentially estimate.

Jdlrobson updated the task description. (Show Details)Jul 16 2019, 4:19 PM
ovasileva lowered the priority of this task from High to Normal.Jul 16 2019, 4:27 PM
ovasileva set the point value for this task to 3.
Jdlrobson raised the priority of this task from Normal to High.Jul 16 2019, 4:27 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed the point value for this task.
Jdlrobson updated the task description. (Show Details)
ovasileva lowered the priority of this task from High to Normal.Jul 16 2019, 4:34 PM
ovasileva set the point value for this task to 3.

Change 526800 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Provide access to original redirect page on toasts

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

@Jdlrobson it works as expected. Would it be possible to follow the design suggestion here T150189#2874594?

Ah yes there was a little confusion on the mocks. I've revised this and put it on staging. Please take another look. Note before for some reason all links inside toast were progressive or red. That seems wrong (blue/red on black background) so I've fixed that to always be white.

Niedzielski removed Niedzielski as the assignee of this task.Tue, Aug 20, 6:56 PM
Niedzielski assigned this task to Edtadros.
Niedzielski added a subscriber: Niedzielski.

Change 526800 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Provide access to original redirect page on toasts

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

Niedzielski reassigned this task from Edtadros to ovasileva.Wed, Aug 21, 5:10 PM
Niedzielski added a subscriber: Edtadros.