Page MenuHomePhabricator

Let users disable notifications about leaving local Wikibase in Federated Properties MVP
Closed, ResolvedPublic8 Estimated Story Points

Description

In the MVP of federated properties, there will be several scenarios in which users will have to leave their local Wikibase in order to access information about properties on the source Wiki (in this case, Wikidata.org). When clicking on a link that redirects to Wikidata (with the exception of the Special:List of Properties page), users will see a notification.

We want logged in users to be able to choose to disable these notifications permanently. It would also be beneficial to allow anonymous users to disable the notifications.

Note: there is similar code for wikibase (entity view), and termbox (license agreement related) that allows cookie-based for anonymous users and user preferences for logged in users.

BDD (initially selecting to disable notifications -- logged in users)
Given I am logged into the Wikibase and the popup displays notifying me that the link I clicked points to a remote source Wiki
WhenI check "Don't show me this message again"
And select "Continue to the source Wiki"
Then my choice to disable notifications is added to my user preferences
And the property page on the source Wiki (e.g. Wikidata) opens according to my default browser behavior

BDD (initially selecting to disable notifications -- anonymous users)
Given I am not logged into the Wikibase and the popup displays notifying me that the link I clicked points to a remote source Wiki
WhenI check "Don't show me this message again"
And select "Continue to the source Wiki"
Then my choice to disable notifications is tracked via cookie
And the property page on the source Wiki (e.g. Wikidata) opens according to my default browser behavior

BDD (clicking link to remote property after disabling notifications)
Given I am on a Wikibase with federation enabled and have previously disabled notifications
WhenI select a link that points to a remote property on the item or revision history page
Then the property page on the source wiki (e.g. Wikidata) opens according to my default browser behavior

Mock
Refer to T246125 for mock.

Event Timeline

From our breakdown session

Proposed breakdown

  • UI change & cookie setting ability
  • Storing as a preference for logged in users

Tech Notes
An example cookie that can be copied / looked at in wikibase code is wikidatawikiwikibase.acknowledgedcopyrightversion for the dismissing of the cc0 edit warning.
This same popup also saves this setting as a user preference when displayed to logged in users
We can likely find lots of the things we need by looking at that code.
https://codesearch.wmcloud.org/search/?q=acknowledgedcopyrightversion&i=nope&files=&repos=
https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/9b837c08f6ab1d05bf7e4f838737ad425b75b19a/repo/resources/wikibase.ui.entityViewInit.js

For testing purposes:

The api option can be cleared by running this javascript in the console:

					var api = new mw.Api();
					api.saveOption( 'wb-dismissleavingsitenotice', null );

The cookie can be cleared by running or just clearing it in the browser.

					mw.cookie.set('wikibase.dismissleavingsitenotice', null)