Doc: update some of the popups / preview terminology

Bug: T165036
Change-Id: Id75543d4d886e4cca8278baaf4f4a21c8e4389b7
This commit is contained in:
Stephen Niedzielski 2018-03-20 15:20:43 -05:00 committed by joakin
parent c4b50b04ac
commit 4dd9df12eb
9 changed files with 36 additions and 26 deletions

View file

@ -48,3 +48,13 @@ Popups works with a local copy of the [Mobile Content Service] too:
$wgPopupsRestGatewayEndpoint = 'http://localhost:6927/en.wikipedia.org/v1/page/summary/';
[Mobile Content Service]: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/mobileapps/+/master
## Terminology
- Hovercard - Deprecated term for popup.
- Link preview - A similar user feature in the Android native app.
- Navpop / nav pop - A popup-like UI from the NavigationPopups gadget.
- Popup - Generic term for a dialog that appears to float above a link that is
being hovered over by a cursor.
- Page preview - A specific type of popup that shows a page summary.
- Preview - A synonym for popup.

View file

@ -5,8 +5,8 @@ allows you to subscribe to updates to the state tree. These updates are
delivered every time an action is dispatched to the store, which may or may not
result in a change of state.
In the Page Previews codebase, a **change listener** is a function that is only
called when the state tree has changed. As such, change listeners are
In the Extension:Popups codebase, a **change listener** is a function that is
only called when the state tree has changed. As such, change listeners are
predominantly responsible for updating the UI so that it matches the state in
the store.

View file

@ -1,15 +1,15 @@
# Instrumentation
Page Previews is thoroughly instrumented. Currently, there's one [Event Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema that captures all of the data that we record about a user's interactions with the Page Previews extension, the [Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is also a statsv instrumentation, which is visualized as a [Grafana dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews). The primary purpose of the statsv instrumentation is to monitor the performance of PagePreviews in production.
The Extension:Popups extension and the Page Previews feature are thoroughly instrumented. Currently, there's one [Event Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema that captures all of the data that we record about a user's interactions with the Popups extension, the [Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is also a statsv instrumentation, which is visualized as a [Grafana dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews). The primary purpose of the statsv instrumentation is to monitor the performance of Popups in production.
Tilman Bayer captured the high level state and user action's that should trigger an event to be logged via EL [here](https://www.mediawiki.org/wiki/File:State_diagram_for_Schema-Popups_(Hovercards_instrumentation).svg) indeed, this diagram was a catalyst for rewriting the Page Previews application as a large finite state machine.
Tilman Bayer captured the high level state and user action's that should trigger an event to be logged via EL [here](https://www.mediawiki.org/wiki/File:State_diagram_for_Schema-Popups_(Hovercards_instrumentation).svg) indeed, this diagram was a catalyst for rewriting the Extension:Popups extension as a large finite state machine.
## Implementation
### EventLogging
Events need to be queued and dequeued in response to [actions](http://redux.js.org/docs/basics/Actions.html) dispatched to the store. This could be implemented in either a [Redux middleware](http://redux.js.org/docs/advanced/Middleware.html) or as a [reducer](http://redux.js.org/docs/basics/Reducers.html), an [action](http://redux.js.org/docs/basics/Actions.html), and a [change listener](./change_listener.md). Both approaches satisfy the general requirement that instrumentation should be transparent to the rest of the codebase but the latter is the approach we're taking for the rest of the application and instrumentation isn't a special case. Moreover, given the amount of time it took to get the original instrumentation under test, we can leverage the constraint the [reducers](http://redux.js.org/docs/basics/Reducers.html) must be pure to test the majority of the instrumentation logic in isolation.
Since the event data varies with the value of the `action` property, events are represented by a blob of `action`-specific data and a blob of data that's shared between all events. Very nearly all of the latter can and should be initialized when the Page Previews application boots.
Since the event data varies with the value of the `action` property, events are represented by a blob of `action`-specific data and a blob of data that's shared between all events. Very nearly all of the latter can and should be initialized when Extension:Popups boots.
#### Data Flow

View file

@ -11,27 +11,27 @@
},
"popups-message": "Name shown in user preference for this extension",
"popups-desc": "{{desc|name=Popups|url=https://www.mediawiki.org/wiki/Extension:Popups}}",
"popups-redirects": "Unused at this time.\n\nMessage shown when the hovercard is showing a redirected page.\n\nParameters:\n* $1 - Redirect target page",
"popups-redirects": "Unused at this time.\n\nMessage shown when the popup is showing a redirected page.\n\nParameters:\n* $1 - Redirect target page",
"popups-settings-title": "Title used for the setting's dialog",
"popups-settings-option-simple": "Title for the reader hovercard option\n{{Identical|Enable}}",
"popups-settings-option-simple-description": "Description for the reader hovercard option",
"popups-settings-option-advanced": "Title for the editor or navigation popups option\n{{Identical|Advanced}}",
"popups-settings-option-advanced-description": "Description for the editor or navigation popups option",
"popups-settings-option-off": "Title to turn off hovercards option.\n\nSee also:\n* {{msg-mw|Popups-settings-enable}}\n{{Identical|Disable}}",
"popups-settings-save": "Save buttton for the setting's dialoag\n{{Identical|Save}}",
"popups-settings-help-ok": "Confirmation button after showing how to re-enable hovercards.\n{{Identical|Done}}",
"popups-settings-option-simple": "Title for the reader popup option\n{{Identical|Enable}}",
"popups-settings-option-simple-description": "Description for the reader popup option",
"popups-settings-option-advanced": "Title for the editor or Navigation Popups gadget option\n{{Identical|Advanced}}",
"popups-settings-option-advanced-description": "Description for the editor or Navigation Popups gadget option",
"popups-settings-option-off": "Title to turn off popups option.\n\nSee also:\n* {{msg-mw|Popups-settings-enable}}\n{{Identical|Disable}}",
"popups-settings-save": "Save button for the setting's dialog\n{{Identical|Save}}",
"popups-settings-help-ok": "Confirmation button after showing how to re-enable page previews.\n{{Identical|Done}}",
"popups-settings-cancel": "Cancel button for the setting's dialog\n{{Identical|Cancel}}",
"popups-settings-help": "Help text explaining how to re-enable previews",
"popups-settings-enable": "Link on the footer to enable hovercards if its disabled.\n\nSee also:\n* {{msg-mw|Popups-settings-option-off}}",
"popups-send-feedback": "Tooltip for the send feedback icon on the hovercard. Should mention that its an external link.\n{{Identical|Send feedback}}",
"popups-settings-help": "Help text explaining how to re-enable popups",
"popups-settings-enable": "Link on the footer to enable popups if its disabled.\n\nSee also:\n* {{msg-mw|Popups-settings-option-off}}",
"popups-send-feedback": "Tooltip for the send feedback icon on the popup. Should mention that its an external link.\n{{Identical|Send feedback}}",
"popups-preview-no-preview": "The message shown to the user when a preview can't be generated.",
"popups-preview-footer-read": "The link shown to the user when a preview can't be generated.",
"popups-preview-disambiguation": "The description shown on a preview for a disambiguation page",
"popups-preview-disambiguation-link": "The link shown on a preview for a disambiguation page",
"prefs-reading": "Title for 'Reading preferences' section on preferences page",
"popups-prefs-optin-title": "Title for Page Previews option\n\n<em>Description for Page previews option</em>",
"popups-prefs-optin-title": "Title for Page Previews option\n\n<em>Description for Page Previews option</em>",
"popups-prefs-optin-enabled-label": "Label for Page Previews opt in\n{{Identical|Enable}}",
"popups-prefs-optin-disabled-label": "Label for Page previews opt out\n{{Identical|Disable}}",
"popups-prefs-disable-nav-gadgets-info": "Help message telling to disable Navigation Popups gadget in order to enable Page Previews.\n\nParameters:\n* $1 Link to the Gadgets tab of Preferences",
"popups-prefs-optin-disabled-label": "Label for Page Previews opt out\n{{Identical|Disable}}",
"popups-prefs-disable-nav-gadgets-info": "Help message telling to disable Navigation Popups gadget in order to enable page previews.\n\nParameters:\n* $1 Link to the Gadgets tab of Preferences",
"popups-prefs-conflicting-gadgets-info": "Help message informing about possible conflicts with other gadgets/customizations"
}

View file

@ -71,8 +71,8 @@ class PopupsGadgetsIntegration {
}
/**
* Check if Page Previews conflicts with Nav Popups Gadget
* If user enabled Nav Popups PagePreviews are not available
* Check if Popups conflicts with Nav Popups Gadget
* If user enabled Nav Popups, Popups is unavailable
*
* @param \User $user User whose gadget settings are checked
* @return bool

Binary file not shown.

View file

@ -66,7 +66,7 @@ export function isValid( title, contentNamespaces ) {
}
/**
* Return a mw.Title from a HTMLElement if valid for hovercards. Convenience
* Return a mw.Title from a HTMLElement if valid for page previews. Convenience
* method
*
* @param {Element} el

View file

@ -22,7 +22,7 @@ use Popups\PopupsContext;
use Popups\PopupsHooks;
/**
* Integration tests for Page Preview hooks
* Integration tests for popups hooks
*
* @group Popups
* @coversDefaultClass \Popups\PopupsHooks
@ -136,7 +136,7 @@ class PopupsHooksTest extends MediaWikiTestCase {
$this->assertEquals( 'notEmpty', $prefs[ 'someNotEmptyValue'] );
$this->assertArrayHasKey( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME, $prefs );
$this->assertEquals( 1, array_search( \Popups\PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME,
array_keys( $prefs ) ), ' PagePreviews preferences should be injected after Skin select' );
array_keys( $prefs ) ), ' Previews preferences should be injected after Skin select' );
}
/**
@ -165,7 +165,7 @@ class PopupsHooksTest extends MediaWikiTestCase {
$this->assertCount( 3, $prefs );
$this->assertArrayHasKey( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME, $prefs );
$this->assertEquals( 2, array_search( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME,
array_keys( $prefs ) ), ' PagePreviews should be injected at end of array' );
array_keys( $prefs ) ), ' Previews should be injected at end of array' );
}
/**

View file

@ -38,7 +38,7 @@ class PopupsPage extends Page {
}
ready() {
this.resourceLoaderModuleStatus( POPUPS_MODULE_NAME, 'ready', 'Page previews did not load' );
this.resourceLoaderModuleStatus( POPUPS_MODULE_NAME, 'ready', 'Popups did not load' );
}
abandonLink() {