Page MenuHomePhabricator

Show notification when users type a link to a disambiguation page
Closed, ResolvedPublic5 Estimated Story Points

Description

Background:

Research at T289534#7309057 suggests most links to disambiguation pages occur with wikitext editing. The user probably isn't aware that they are adding such links, as there is no feedback on what the link is, even in preview. They would need to browse to the page itself before discovering that it's not the page they intended to link to.

Solution:

When a user types a link to a disambiguation page, we show a warning in the form of a toast notification indicating that it is probably not the page they intended to link to.

There is a proof of concept user script that can be tried out at T288589. It offers suggestions for what the user may have wanted to link to, but we won't be doing this because a simple prefix search doesn't always deliver the right pages (see comment at T145622#2689937).

Visual reference

Figma link: https://www.figma.com/file/09EVzraA3dAb0MXeHXe4SU/Wikipedia-Disambiguation?node-id=186%3A348

Link Selector.png (1Γ—2 px, 370 KB)

NOTE: We won't be including the alert icon or the expanded width for now. The notification should instead match the same width as all other notifications (i.e. such as the notification shown after you watchlist an article).

Acceptance Criteria:

  • Show a notification after a user types a link to a disambiguation page, similar to the mockup.
  • The "Review link" when clicked, should highlight the relevant wikitext (the link to the disambig page)
    • In the event the user changes the wikitext after the notification is shown, "Review link" should open the disambiguation page in a new tab
  • All other links should open in a new tab
  • The "disambiguation page" link should link to centralized documentation on mediawiki.org (to be written)
    • Local communities will be able to override the message so that it points to local documentation, if desired.
  • This should be behind a feature flag so we can control the rollout and allow third party installations to disable this feature entirely.
  • CodeMirror and the 2017 wikitext editor are not supported (yet). That can be addressed with separate tasks, given the complexity it adds.

Note: This is only limited to behavior in response to typing in a link (does NOT include copy and pasting in a link)

Related Tickets:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

When using the Wikieditor toolbar, the link search windows gives a hint if linking disambig page, possible this exists for Visual Editor as well.

Avoiding the save of the edit like needed for captcha/antispam could lossing many work, because people closing the tab after pressing save or such. Some onwiki policy may allow disambig pages, because a link is better than no link

VISUAL REFERENCE

Proposed solution: See a warning before publishing if I have introduced a disambiguation link in my article.
We are proposing displaying this yellow warning toast notification when wikitext users add a link:

WE_Toast.png (1Γ—2 px, 376 KB)

MusikAnimal renamed this task from Disambiguation pages: Warn users when linking to disambiguation pages to Disambiguation pages: Show notification when users link to disambiguation pages.Aug 25 2021, 7:13 PM
MusikAnimal updated the task description. (Show Details)
MusikAnimal renamed this task from Disambiguation pages: Show notification when users link to disambiguation pages to Show notification when users type a link to a disambiguation page.Aug 25 2021, 7:19 PM

VISUAL REFERENCE

Proposed solution: See a warning before publishing if I have introduced a disambiguation link in my article.
We are proposing displaying this yellow warning toast notification when wikitext users add a link:
F34600933

This looks great! However there are a few concerns:

  • Showing the wikitext markup in the message might be confusing or too verbose. The intention I believe is to show them what wikitext needs to be replaced. The [[New York]] is very simple, but imagine it is for instance [[New York|the largest city in the United States and the second largest in North America]]. I think that is too much for a popup notification.
  • The copy "…is not an article" implies they are trying to link to an article, but this is not necessarily true. At least at Wikimedia, "article" usually refers to mainspace pages, especially on Wikipedias. However disambiguation pages can exist in other namespaces, too. Say for instance I wanted to link to [[Wikipedia:New York]] and let's pretend that is a disambig page. That is obviously not an article, and in this case I didn't intend for it to be, either. The word "article" may also not make sense on some projects, such as Wikisource, where the mainspace is referred to as "works". For this I recommend either:
    • Changing the copy to something that doesn't imply article, i.e. "You linked to page New York which is a disambiguation page. You instead probably meant to link to one of the pages listed on it." (that's pretty bad copy, but you get the idea)
    • Alternatively we can change the requirements to only show a notification when linking to a mainspace disambiguation page. If we do that, we'll still want to change "article" to "content page" so that it makes sense on non-Wikipedias. Individual communities can always override the messaging, and English Wikipedia surely will (i.e. they'll want the "disambiguation page" link to point to local documentation).
  • I can't promise we can add the alert icon in the popup, since the notification system uses mw.notify() which doesn't provide a way to add a CSS class. But I will try and see if there's something we can do.

A few notes, based on feedback from Leon, and feedback on the talk page.
How about we change the copy as follows

Replace "You linked to [x page name that is potentially long] page is not article, it groups all articles by the same term." by instead "This page is not a content page, the page lists topics with similar names." Rationale: The dab is more of a list than a group, and not all of its entries are articles, and content page covers our bases, while the term "this" is context based enough since they just typed the link for it.

Lmk how that sounds and hope we can add a CSS class!

How about we change the copy as follows

Replace "You linked to [x page name that is potentially long] page is not article, it groups all articles by the same term." by instead "This page is not a content page, the page lists topics with similar names." Rationale: The dab is more of a list than a group, and not all of its entries are articles, and content page covers our bases, while the term "this" is context based enough since they just typed the link for it.

That sounds good! Though I wouldn't be too worried about mentioning the page title in the copy (just not the wikitext). The watchlist notification popup for instance gives the full title, along with a dropdown, so it is roughly of similar size. "New York is not a content page, but a page that list topics with similar names" shouldn't be problematic, methinks.

hope we can add a CSS class!

I just realized that (I think) we can add whatever HTML we want to the popup, so we can just insert the image itself and we don't need a CSS class on the whole popup. But even if we can't, we could create our own popup from scratch just like we did for watchlist expiry.

Change 716439 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/Disambiguator@master] Show notification when users type a link to a disambiguation page

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

@nayoub Did we decide on a final copy for the notification? I believe the patch is otherwise ready for review.

Also, to confirm the behaviour: clicking on "Review link" is supposed to highlight the relevant wikitext? That's what I have it doing now, based on our conversation the other day. Please also confirm the acceptance criteria above is correct, and add a figma link if you have one as that screenshot I believe is outdated. Cc @NRodriguez. Thanks!

Hey @MusikAnimal, I've updated the ticket description with the latest mock and Figma link.
Regarding the behavior, you're right -- that's the one we decided on in our last RTL. The acceptance criteria look perfect to me, but I'll let @NRodriguez confirm :)
Thanks!

great work on the copy and thanks for updating figma @nayoub

@nayoub A heads up that the toast notification is of a fixed width. I imagine we could widen if we really wanted to, but that would make this the only notification that's of a different size. It would probably be hacky to do this since as mentioned at T285508#7310133 we can't add a CSS class to the popup itself. So for now, I've got it with the default width, without the alert icon. I assume if we have to use the shorter width we'd rather not have the alert icon since it consumes so much real estate. Let me know if any of this is an issue! At any rate we can iterate on it, so I'm going to go ahead and put https://gerrit.wikimedia.org/r/716439 up for review.

So for now, I've got it with the default width, without the alert icon.

Per our meeting, this is the route we will go for now. So no alert icon, default width.

Change 716439 merged by jenkins-bot:

[mediawiki/extensions/Disambiguator@master] Show notification when users type a link to a disambiguation page

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

I'm not sure where this task should be placed on the workboard. I think there's no code left to write, except for enabling the config option. Should that happen in a subtask?

I think a separate task sounds right. (Although, this task would be a subtask of that one, I think? Not that we usually model task dependencies all that much.)

Although, this task would be a subtask of that one, I think?

My interpretation is that this task cannot move forward until the feature flag is turned on, hence the new task should be a subtask. But yeah, sometimes the relationship is quite unclear and deciding the correct order feels kind of bikeshedding.

Change 721368 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/Disambiguator@master] [DO NOT MERGE] Enable DisambiguatorNotifications by default

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

Test wiki created on Patch Demo by MusikAnimal using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/9191a8d0c5/w/

Yes, let's create new tasks about enabling this on beta/production. For now following a229dbf0f3 we can use Patch Demo for QA purposes.

QA notes:

  • You can use the test wiki created at https://patchdemo.wmflabs.org/wikis/9191a8d0c5/wiki/Main_Page
    • There's a big heading at the bottom of every page that says "Navigation menu". I don't know what that is but ignore it; it's unrelated.
  • For now, there is only one disambig page: New York. You can create more if you'd like by placing the __DISAMBIG__ magic word in the wikitext (on its own line)
  • Acceptance criteria in the description is up-to-date, but the mocks are slightly outdated. We are using standard widths for the notification, and aren't showing an alert icon.

Let me know if you have any questions!

@nayoub Pinging you in case you want to do a sign-off on the design.

I left some QA notes at T285508#7356355. For now we can test this on Patch Demo, but we'll get it enabled on Beta as well. I've created T291303: Enable disambiguation notifications on Beta for that and scheduled the deployment for Monday at 6 PM UTC.

@imaigwilo This is now deployed to the Beta cluster, if you'd prefer to test there. Sorry for the wait!

Verified feature works as expected in Beta:
Popup warning shows ONLY when user types a disambiguation link.
Pop up window links, opens to relevant Beta url links about disambiguation.
Tested functionality on supported browsers: Chrome, Firefox, Edge, IE 11, and Opera
See screen shot below: https://en.wikipedia.beta.wmflabs.org/wiki/Conflict-title-0.380662174610652-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n?action=edit

Screen Shot 2021-09-27 at 12.06.26 PM.png (1Γ—2 px, 386 KB)

Change 721368 abandoned by MusikAnimal:

[mediawiki/extensions/Disambiguator@master] [DO NOT MERGE] Enable DisambiguatorNotifications by default

Reason:

no longer needed

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

The deploy ticket is separate so resolving as agreed

This is the wrong place to ask (sorry, sorry), but was there a Visual Editor component to this I'm missing, or were there no Visual Editor changes in scope for this?

Test wiki on Patch Demo by MusikAnimal using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/9191a8d0c5/w/

Is there a user preference to turn this thing off?