Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Use different distance thresholds for axis X and Y #12434

Merged
merged 1 commit into from
Dec 29, 2017
Merged

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Dec 28, 2017

fix #9615

Auditors: @bsclifton

Test Plan:

  1. Adjust swipe navigation sesitivity setting in
    about:preferences#advanced
  2. And swipe to navigate by different settings

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

fix #9615

Auditors: @bsclifton

Test Plan:
1. Adjust swipe navigation sesitivity setting in
about:preferences#advanced
2. And swipe to navigate by different settings
@darkdh darkdh added this to the 0.20.x (Beta Channel) milestone Dec 28, 2017
@darkdh darkdh self-assigned this Dec 28, 2017
@@ -252,12 +252,13 @@ class Main extends React.Component {
}, { passive: true })

ipc.on('scroll-touch-end', () => {
const distanceThreshold = getSetting(settings.SWIPE_NAV_DISTANCE)
const distanceThresholdX = getSetting(settings.SWIPE_NAV_DISTANCE)
const distanceThresholdY = 101
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this 101 value come from? It might be a good idea to make it a constant, since here it appears to be a magic number

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is the default value of SWIPE_NAV_DISTANCE, are you suggesting make it into settings constant? We don't allow users to config it so why bother?
https://github.com/brave/browser-laptop/pull/12434/files#diff-de5d4f1b019deecc5b1926970450546cR257 here doesn't appear to be magic number to you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok- good to know that it's the default value 😄 👍

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@bsclifton bsclifton merged commit 470ae67 into master Dec 29, 2017
@bsclifton bsclifton deleted the issue-9615 branch December 29, 2017 20:02
bsclifton added a commit that referenced this pull request Dec 29, 2017
Use different distance thresholds for axis X and Y
bsclifton added a commit that referenced this pull request Dec 29, 2017
Use different distance thresholds for axis X and Y
@bsclifton
Copy link
Member

master 470ae67
0.21.x fef1a4a
0.20.x 3af4972

@codecov-io
Copy link

Codecov Report

Merging #12434 into master will increase coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #12434      +/-   ##
==========================================
+ Coverage   55.86%   55.95%   +0.08%     
==========================================
  Files         278      278              
  Lines       26936    27460     +524     
  Branches     4355     4572     +217     
==========================================
+ Hits        15048    15365     +317     
- Misses      11888    12095     +207
Flag Coverage Δ
#unittest 55.95% <ø> (+0.08%) ⬆️
Impacted Files Coverage Δ
js/actions/windowActions.js 4.85% <0%> (-0.06%) ⬇️
js/constants/windowConstants.js 100% <0%> (ø) ⬆️
js/actions/appActions.js 20.25% <0%> (+0.92%) ⬆️
app/browser/reducers/autoplayReducer.js 99.03% <0%> (+1.47%) ⬆️
js/stores/windowStore.js 30.33% <0%> (+2.93%) ⬆️
app/sessionStore.js 89.77% <0%> (+3%) ⬆️
app/browser/tabs.js 29.45% <0%> (+4.14%) ⬆️
app/renderer/reducers/frameReducer.js 62.71% <0%> (+4.59%) ⬆️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swipe Navigation Sensitivity Setting
3 participants