FIX: Scale down swipe in detection to 20px from edge of the screen

approved
cherry-pick-2-2

#1

FIX: Scale down swipe in detection to 20px from edge of the screen

…and slightly increase velocity required for menu actions

diff --git a/app/assets/javascripts/discourse/components/site-header.js.es6 b/app/assets/javascripts/discourse/components/site-header.js.es6
index 8d126c2..28627bf 100644
--- a/app/assets/javascripts/discourse/components/site-header.js.es6
+++ b/app/assets/javascripts/discourse/components/site-header.js.es6
@@ -15,7 +15,7 @@ function addFlagProperty(prop) {
 const PANEL_BODY_MARGIN = 30;
 
 //android supports pulling in from the screen edges
-const SCREEN_EDGE_MARGIN = 30;
+const SCREEN_EDGE_MARGIN = 20;
 const SCREEN_OFFSET = 300;
 
 const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
diff --git a/app/assets/javascripts/discourse/mixins/pan-events.js.es6 b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
index 840a6aa..423fb1c 100644
--- a/app/assets/javascripts/discourse/mixins/pan-events.js.es6
+++ b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
@@ -4,7 +4,8 @@
  **/
 export const SWIPE_VELOCITY = 40;
 export const SWIPE_DISTANCE_THRESHOLD = 50;
-export const SWIPE_VELOCITY_THRESHOLD = 0.1;
+export const SWIPE_VELOCITY_THRESHOLD = 0.12;
+export const MINIMUM_SWIPE_DISTANCE = 5;
 export default Ember.Mixin.create({
   //velocity is pixels per ms
 
@@ -120,7 +121,7 @@ export default Ember.Mixin.create({
     }
     const previousState = this.get("_panState");
     const newState = this._calculateNewPanState(previousState, e);
-    if (previousState.start && newState.distance < 5) {
+    if (previousState.start && newState.distance < MINIMUM_SWIPE_DISTANCE) {
       return;
     }
     this.set("_panState", newState);

GitHub sha: d997b01a


#2

This commit has been mentioned on Discourse Meta. There might be relevant details there:


Approved #3