Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double tap on Narrow narrows twice. #2682

Open
roberthoenig opened this issue Jun 14, 2018 · 1 comment
Open

Double tap on Narrow narrows twice. #2682

roberthoenig opened this issue Jun 14, 2018 · 1 comment

Comments

@roberthoenig
Copy link
Contributor

roberthoenig commented Jun 14, 2018

Issue

ezgif com-video-to-gif
It's not visible, but I rapidly tapped twice on the same topic.
This was recorded on an iOS device. I experience the same behavior in an Android emulator.
There is a issue for this: react-navigation/rfcs#16
The developers seem unsure whether this is a bug or a feature, but they point to some ways to resolve this manually.

Possible solution

File: src/nav/navReducers.js
39: const switchNarrow = (state: NavigationState, action: SwitchNarrowAction): NavigationState => {
40:   if (state.isTransitioning === false) {
41:     return AppNavigator.router.getStateForAction(navigateToChat(action.narrow), state) || state;
42:   }
43:   return state;
44: }

This drops any transitions dispatched while the app is transitioning. This does its job, but I think an ideal solution would avoid narrowing to a view the app is already in alltogether.
Such a solution would require smt like this:

File: src/nav/navActions.js
11: export const navigateToChat = (narrow: Narrow): NavigateAction =>
12:     NavigationActions.navigate({ key: narrow, routeName: 'chat', params: { narrow } }); 

This makes the app throw when navigating to a chat narrow that has the same key as the narrow the app is in. (Currently, it just navigates twice.) We might want to do this for every narrow, and/or implement a check somewhere to not execute a narrow to the same view. I'm not sure what the philosophical right way to do this is.

@roberthoenig
Copy link
Contributor Author

Stepping back, I think there are two questions here:

  • What do we want to do when a narrow action is dispatched while another narrow is going on?

  • What do we want to do when a narrow action is dispatched that narrows to the same narrow we are currently in?

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jun 21, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 5, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 7, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 22, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 23, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 24, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 25, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Jul 30, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Aug 24, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Aug 24, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Sep 11, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Sep 20, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Sep 20, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 14, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 21, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 21, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 21, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 24, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 31, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Oct 31, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 1, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 2, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 20, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 20, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 21, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 23, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue Nov 26, 2018
Upgrade to React Navigation 2 and do the minimal changes that make
our code compatible.

Navigating behavior has changed, and pushing a route with the
same key does not result in duplicated entry in the history.
Fixes zulip#2682

The code to wire RN navigator to Redux have changed. The newer
approach is simpler, just using `reduxifyNavigator` helper does
most of the work.

Since `pop` was removed from `NavigationActions` use the
`pop` action from `StackActions` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants