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
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: