From 1879a4d59e645b1c2e3ea37eda2ef14b9744fe89 Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Fri, 5 Apr 2019 12:31:54 +0200 Subject: [PATCH] Show referencePreviews on click Introducing the REFERENCE_CLICK action that will fetch and show the preview for the clicked reference right away without any delay. The main goal of the new chain of events introduced with the reference click is showing the reference preview right away. The actions triggered by the dwelling include delays in multiple parts of the process. If there's a dwell action-chain in progress when the click action is executed, the related promise ( that might still include steps with delays ) and the reference preview is retrieved and shown right away re-using the token. In the case where there's no dwell action running ( e.g. when the click was triggered via touch ) we create a new token and start from scratch. In either case we want to avoid, that multiple clicks trigger multiple actions and abort early when there's already a click action in progress. Bug: T218765 Change-Id: I073a93be2d17a21178aebe12267765f60a2811b9 --- package.json | 2 +- resources/dist/index.js | Bin 41714 -> 42438 bytes resources/dist/index.js.map.json | Bin 201063 -> 203910 bytes src/actionTypes.js | 1 + src/actions.js | 53 ++++++++++ src/index.js | 20 +++- src/reducers/preview.js | 14 ++- tests/node-qunit/actions.test.js | 113 ++++++++++++++++++++++ tests/node-qunit/reducers/preview.test.js | 26 ++++- webpack.config.js | 4 +- 10 files changed, 223 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f282d0159..dd618cfcc 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "bundlesize": [ { "path": "resources/dist/index.js", - "maxSize": "13.5KB" + "maxSize": "13.6KB" } ] } diff --git a/resources/dist/index.js b/resources/dist/index.js index a6a9d24715e9a6f99f1c8cd307383fcf772fa261..4c393c9621bc19a0801f2868247fbfa15aef76d5 100644 GIT binary patch delta 5533 zcma(#X>1$UnRxP%#5tN+vL#EgO;NHvV?B*7%S|bdWtpNbQPByxrt z4oT6HDkt%gIJOh{i&N)t?4nH<=r(N%_D7qx+08Bz1SxjcZL`=UXm`^s_Q1A_O%J1I z+J0|%$`Xo#!0^2{@4N5$`I{wgeW&ErFWcew_Iuzp`!>=8@7e`24IkTggS+M)XsFp< z*~Jz`s!2h?p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6hMvXCT}RFAy8Tn w{oA=T!YOYXATM diff --git a/resources/dist/index.js.map.json b/resources/dist/index.js.map.json index 06884227bad592823aae3ab24e99d1253dde33a6..7795f532e83864a6d05f2820836bcf07feed7d62 100644 GIT binary patch delta 27571 zcmbWAdvL4iS=i?&5Ozbdo6Tl-Pj~lhd^UTHwXx*8lWfTMz4|Q6vMkH8EX&Czk!4wy ztea)ovP~0h2nppcLNm}IOli4H=}@LE!wi1_nREvF zd!F}`tmAVw1SXTC{l541ywCl4-sk=Nr$7AKkN(@&ern;qM=Ry-TBm$cE%!Fg+U3W? zkC*HGQ))H$sulk;&pr2K_;I={c8Zlox!I-Z3I5+McI?A`@yOJRM@KKc?Y`f;_R^#G z|MaW;-+J(&m;Um>Kl$31{^z3)f6YsG-Tc3=x_jMQ^wzyqE6c**>160exhwbndIeeuUxNhv<}M6!NXdo)uZ%(qJ7#lvbXa(vnYVjO@-DtgZzq}7UFcqN;iBWU-Kb7hOfWpY8%{dg zM&~Gc;hgC#bzOn+?$nX?O2qviT6yC6b60kD9+Rd-LT1k$O1s$&7aS+zo*HTCxIICT ziPJez(RrF~$Ng9;`VA4CEibd|TU?d|OAb@=laCtUaFPlodrdNNL$Q+(=$)wFPCa#P z*1t$iyEP+|)Xag>BC8NB$|TF6%yAZU!k#;;7(aDo{JhM5?9NHkmNVtQZuR=LGykd8 zH~05FUU^HA7;`Shqtd}koypL})o^M6pEv2!gLhMIIO8NT`*CSYSK=)0)!c~~Z=I~H zG>O`}|qtSxH$nKsoeD`d|-U~-*Q)nj5O&cYz(K(_9r6!he2Je&hHtU`x! zeUT^c#8j0{>~JU5TJ&F&zWHp^;$k@*H=8p`ij-2qfkzUK>ADb=Ng(D%I=$DF)qtCS zope>F2lMPGrT?bcK^z{D7mD49Mcr<=XPkUp5t^M;sCxpiP}DA|GiAXMOL^1&-D@|B z=SH@kn^gD?%!)K65iG&ik-khqdiFjMo0Z4>x^k<|)Phf#e8$3A7o?cg1B;tl43Nx9 zHRgZI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0%SPpPGG+j&?X!Yz z#*pH4xSneErJ@KNmd|r7Q$Vm5#deUq#9nx1*1cQuoG(d2lTe2w^9fa^!S>D06HBLi ziHoFwv9M%Or*&Waa?M;Kn!-23`O;i&^F)DuE~de+7HOE@U(ngPc-`Qy|Hcrx3QbC3 zEe7lns;wdE?Jr7|C~HBbov8*)F$W56)R#M;Q0M`vP)$r}hF%gNs_wYG*-~%E#0V+Q z+tE2CiGPu$P>igO+xOH?yq3Xbe;Hui*A`NoU^UiLC`z?9{D;Q&L+iT}iuSSx8J`W{ z8%*j`dB{sHCl zxXmPm`S{vfUB3?w~_2Ej!2S;?%^bLK-E?v;2~raSVDWYT z=|+zV1hTKP;X7#8P(d}RP~igk61j|z_|!+0QFg0*xJ^w{UI8TX#aNlL%1c&84@%4c z=c4~qNx1?s5#{D?uekjb+9?*g^QJw|LsA~_10qlaXCm)(!7Et|QoF`lr0jz2N6k_X zk#kv}1>siacIJ;lsz(qB<6&DfWs{nQj#&oBVcPT#LC!>bunhOyhP?#FYNmpguc*+- zeuv#Y|FD#qCh(|I4T*r#agKV4bw7Xs_R94Y=PATg(sG0ctp$k-ixZqP^~ zwL*X0i^Y)yRfq6IX6bw3uSnjvNI1Qu|G#BLuJ9p=jZh?Gd@X@=hLh+ zW1`2mu&i{y>J)w z*Eadao=Kx3PPo3xorIDxZrR^Dyzm>0fBuD=={Nt+7jORJJ#U`>&dnEZzJBrtHy?QYOJBPA_?!RZ_ip~x h%dbCr&pqAO|J~Q!^XTipzk1`{Z$AIddp`F5{|`-(bn^fJ diff --git a/src/actionTypes.js b/src/actionTypes.js index d76f6e3cd..52990469f 100644 --- a/src/actionTypes.js +++ b/src/actionTypes.js @@ -8,6 +8,7 @@ export default { ABANDON_START: 'ABANDON_START', ABANDON_END: 'ABANDON_END', LINK_CLICK: 'LINK_CLICK', + REFERENCE_CLICK: 'REFERENCE_CLICK', /** Precedes a fetch. */ FETCH_START: 'FETCH_START', /** Follows a successful fetch. */ diff --git a/src/actions.js b/src/actions.js index e794189f1..bf84b8451 100644 --- a/src/actions.js +++ b/src/actions.js @@ -308,6 +308,59 @@ export function linkClick( el ) { } ); } +/** + * Represents the user clicking on a reference preview link with their mouse, keyboard, or an + * assistive device. + * + * @param {mw.Title} title + * @param {Element} el + * @param {Gateway} gateway + * @param {Function} generateToken + * @return {Redux.Thunk} + */ +export function referenceClick( title, el, gateway, generateToken ) { + return ( dispatch, getState ) => { + const { + activeLink, + activeToken: dwellToken, + promise: dwellPromise, + wasClicked + } = getState().preview; + + if ( wasClicked ) { + return $.Deferred().resolve().promise(); + } + + const xhr = gateway.fetchPreviewForTitle( title, el ); + + function clickFollowsDwellEvent() { + return activeLink === el && dwellToken !== ''; + } + + let token = dwellToken; + if ( !clickFollowsDwellEvent() ) { + token = generateToken(); + } else { + dwellPromise.abort(); + } + + dispatch( timedAction( { + type: types.REFERENCE_CLICK, + el, + token + } ) ); + + return xhr.then( ( result ) => { + dispatch( { + type: types.FETCH_COMPLETE, + el, + result, + token + } ); + } ); + }; +} + /** * Represents the user dwelling on a preview with their mouse. * diff --git a/src/index.js b/src/index.js index 8cd1f3bf8..1426fb9dc 100644 --- a/src/index.js +++ b/src/index.js @@ -263,11 +263,25 @@ function registerChangeListeners( boundActions.abandon(); } } ) - .on( 'click', validLinkSelector, function () { + .on( 'click', validLinkSelector, function ( event ) { const mwTitle = titleFromElement( this, mw.config ); - if ( mwTitle ) { - boundActions.linkClick( this ); + const type = getPreviewType( this, mw.config, mwTitle ); + + switch ( type ) { + case previewTypes.TYPE_PAGE: + boundActions.linkClick( this ); + break; + case previewTypes.TYPE_REFERENCE: + event.preventDefault(); + boundActions.referenceClick( + mwTitle, + this, + referenceGateway, + generateToken + ); + break; + } } } ); }() ); diff --git a/src/reducers/preview.js b/src/reducers/preview.js index 6c58d0f5a..37420e469 100644 --- a/src/reducers/preview.js +++ b/src/reducers/preview.js @@ -17,7 +17,8 @@ export default function preview( state, action ) { activeEvent: undefined, activeToken: '', shouldShow: false, - isUserDwelling: false + isUserDwelling: false, + wasClicked: false }; } @@ -56,6 +57,14 @@ export default function preview( state, action ) { isUserDwelling: true } ); + case actionTypes.REFERENCE_CLICK: + return nextState( state, { + activeLink: action.el, + activeToken: action.token, + isUserDwelling: true, + wasClicked: true + } ); + case actionTypes.ABANDON_END: if ( action.token === state.activeToken && !state.isUserDwelling ) { return nextState( state, { @@ -75,7 +84,8 @@ export default function preview( state, action ) { case actionTypes.ABANDON_START: return nextState( state, { - isUserDwelling: false + isUserDwelling: false, + wasClicked: false } ); case actionTypes.FETCH_START: diff --git a/tests/node-qunit/actions.test.js b/tests/node-qunit/actions.test.js index 24a604e2b..df394d66b 100644 --- a/tests/node-qunit/actions.test.js +++ b/tests/node-qunit/actions.test.js @@ -613,3 +613,116 @@ QUnit.test( 'PREVIEW_SEEN action not called if preview type not page', function ); } ); } ); + +QUnit.module( 'ext.popups/actions#referenceClick @integration', { + beforeEach() { + this.state = { + preview: {} + }; + this.getState = () => this.state; + + this.gatewayDeferred = $.Deferred(); + this.gateway = { + fetchPreviewForTitle: this.sandbox.stub().returns( + this.gatewayDeferred.resolve( {} ).promise() + ) + }; + + // lets just set this to always return 0 + mw.now = () => 0; + + setupEl( this ); + } +} ); + +QUnit.test( '#referenceClick', function ( assert ) { + const dispatch = this.sandbox.spy(); + + this.sandbox.stub( mw, 'now' ).returns( new Date() ); + + const referenceClicked = actions.referenceClick( + this.title, this.el, this.gateway, generateToken + )( + dispatch, + this.getState + ); + + assert.propEqual( + dispatch.getCall( 0 ).args[ 0 ], { + type: actionTypes.REFERENCE_CLICK, + el: this.el, + token: 'ABC', + timestamp: mw.now() + }, + 'The dispatcher was called with the correct REFERENCE_CLICK arguments.' + ); + + return referenceClicked.then( () => { + assert.propEqual( + dispatch.getCall( 1 ).args[ 0 ], { + type: actionTypes.FETCH_COMPLETE, + el: this.el, + result: {}, + token: 'ABC' + }, + 'The dispatcher was called with the correct FETCH_COMPLETE arguments.' + ); + } ); +} ); + +QUnit.test( '#referenceClick doesn\'t continue when clicked several times', function ( assert ) { + const dispatch = this.sandbox.spy(); + + this.state.preview = { + wasClicked: true + }; + + const referenceClicked = actions.referenceClick( + this.title, this.el, this.gateway, generateToken + )( + dispatch, + this.getState + ); + + return referenceClicked.then( () => { + assert.ok( + dispatch.notCalled, + 'The dispatcher was never called.' + ); + } ); +} ); + +QUnit.test( '#referenceClick re-uses the linkDwell token if present', function ( assert ) { + const dispatch = this.sandbox.spy(), + oldDeferred = $.Deferred().promise( { abort() {} } ); + + this.state.preview = { + activeLink: this.el, + activeToken: 'OLD_TOKEN', + promise: oldDeferred + }; + + const referenceClicked = actions.referenceClick( + this.title, this.el, this.gateway, generateToken + )( + dispatch, + this.getState + ); + + assert.propEqual( + dispatch.getCall( 0 ).args[ 0 ], { + type: actionTypes.REFERENCE_CLICK, + el: this.el, + token: 'OLD_TOKEN', + timestamp: mw.now() + }, + 'The dispatcher was called with the correct REFERENCE_CLICK arguments.' + ); + + return referenceClicked.then( () => { + assert.ok( + dispatch.calledTwice, + 'The dispatcher was called twice.' + ); + } ); +} ); diff --git a/tests/node-qunit/reducers/preview.test.js b/tests/node-qunit/reducers/preview.test.js index ed4f72703..fe8ee387d 100644 --- a/tests/node-qunit/reducers/preview.test.js +++ b/tests/node-qunit/reducers/preview.test.js @@ -21,7 +21,8 @@ QUnit.test( '@@INIT', ( assert ) => { activeEvent: undefined, activeToken: '', shouldShow: false, - isUserDwelling: false + isUserDwelling: false, + wasClicked: false }, 'The initial state is correct.' ); @@ -196,6 +197,7 @@ QUnit.test( 'FETCH_COMPLETE', ( assert ) => { { activeToken: token, isUserDwelling: false, // Set when ABANDON_START is reduced. + wasClicked: false, fetchResponse: action.result, shouldShow: false @@ -286,8 +288,28 @@ QUnit.test( 'ABANDON_START', ( assert ) => { assert.deepEqual( preview( {}, action ), { - isUserDwelling: false + isUserDwelling: false, + wasClicked: false }, 'ABANDON_START should mark the preview having been abandoned.' ); } ); + +QUnit.test( 'REFERENCE_CLICK updates the state for a click', function ( assert ) { + const action = { + type: actionTypes.REFERENCE_CLICK, + el: this.el, + token: '1234567890' + }; + + assert.deepEqual( + preview( {}, action ), + { + activeLink: action.el, + activeToken: action.token, + isUserDwelling: true, + wasClicked: true + }, + 'It should set active link and token as well as dwelling and click status.' + ); +} ); diff --git a/webpack.config.js b/webpack.config.js index fdb8cb509..99ce50606 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -110,8 +110,8 @@ module.exports = ( env, argv ) => ( { // Minified uncompressed size limits for chunks / assets and entrypoints. Keep these numbers // up-to-date and rounded to the nearest 10th of a kibibyte so that code sizing costs are // well understood. Related to bundlesize minified, gzipped compressed file size tests. - maxAssetSize: 41 * 1024, - maxEntrypointSize: 41 * 1024, + maxAssetSize: 41.5 * 1024, + maxEntrypointSize: 41.5 * 1024, // The default filter excludes map files but we rename ours. assetFilter: ( filename ) => !filename.endsWith( srcMapExt )