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

Navigation - 'Back' button should always bring you to 'Home' #3503

Open
borisyankov opened this issue May 29, 2019 · 8 comments
Open

Navigation - 'Back' button should always bring you to 'Home' #3503

borisyankov opened this issue May 29, 2019 · 8 comments

Comments

@borisyankov
Copy link
Contributor

The intended behavior of the 'Back' button in the navbar intends to return the user always to the 'Home' screen (MainScreenWithTabs), even if the user have navigated from one narrow to another. We even use some custom logic for that.

This mostly works, except in few cases that may confuse our current logic. One such case:

  • go to a stream narrow
  • open the list of topics
  • navigate to a topic
  • go Back

Expected behavior - you are in 'Home'. Current behavior - you are in the TopicsScreen.

@borisyankov borisyankov self-assigned this May 29, 2019
@ishammahajan
Copy link
Collaborator

ishammahajan commented May 29, 2019

Why is this the intended behaviour? The user when pressing the back button expects to go back one navigation level, i.e. where they arrived on the current screen from. In iOS, swiping right from the left of the screen acts as the gesture for navigation, and it always takes you back one navigation level. Having a separate behaviour for android doesn't seem like a good option.

Infact I thought there might have been a bug where clicking back from the topic screen doesn't take me back to the stream where it came from, which is why I filed #3455. There has been a discussion (well, sort of) on this too.

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 29, 2019
Fixes zulip#3503

The popToTop action takes you back to the first screen in the stack:
https://reactnavigation.org/docs/en/stack-actions.html#poptotop

Instead of using the written by us `getSameRoutesCount` and the
standard `StackActions.pop` use the new 'StackActions.popToTop'.
@borisyankov
Copy link
Contributor Author

That is a good point. We used to have this behavior in the past. I actually thought this to be the default sensical behavior.

Sometimes though you might go several levels deep but apparently people still want to go back to the Home/Root screen so they navigate elsewhere. Enough users complained about it.

At least currently this is the intended behavior (likely to not change soon without a redesign of the UI, which itself is not a priority) I did file the issue because I already had the commit that fixes it.

@gnprice
Copy link
Member

gnprice commented May 29, 2019

I basically agree with @ishammahajan -- to the extent that the code currently does successfully have this behavior, I usually find it annoying and not what I wanted.

Good to have this issue to discuss it on! And thanks @ishammahajan for the links to previous discussions. I just went looking to see if we have an older issue thread on this subject; I didn't find one.

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 30, 2019
Fixes zulip#3503

The popToTop action takes you back to the first screen in the stack:
https://reactnavigation.org/docs/en/stack-actions.html#poptotop

Instead of using the written by us `getSameRoutesCount` and the
standard `StackActions.pop` use the new 'StackActions.popToTop'.
@ishammahajan
Copy link
Collaborator

Enough users complained about it.

I haven't really thought this through, but if there are enough users on both sides of the argument we could have a setting which changes the behaviour dynamically. I've seen some apps that do this (albeit IIRC, they were Reddit apps). Just a thought.

@borisyankov
Copy link
Contributor Author

could have a setting which changes the behaviour dynamically

Death by a thousand app settings?

@borisyankov
Copy link
Contributor Author

The decision was made a long time ago but people used to complain and now they don't. @timabbott might have thoughts on this (or not, has been a while).
Switching to the granular back behavior is straight-forward so this is not a technical problem.

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 30, 2019
Fixes zulip#3503

The popToTop action takes you back to the first screen in the stack:
https://reactnavigation.org/docs/en/stack-actions.html#poptotop

Instead of using the written by us `getSameRoutesCount` and the
standard `StackActions.pop` use the new 'StackActions.popToTop'.
borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 30, 2019
Fixes zulip#3503

The popToTop action takes you back to the first screen in the stack:
https://reactnavigation.org/docs/en/stack-actions.html#poptotop

Instead of using the written by us `getSameRoutesCount` and the
standard `StackActions.pop` use the new 'StackActions.popToTop'.
gnprice pushed a commit to borisyankov/zulip-mobile that referenced this issue Aug 9, 2019
Fixes zulip#3503

The popToTop action takes you back to the first screen in the stack:
https://reactnavigation.org/docs/en/stack-actions.html#poptotop

Instead of using the written by us `getSameRoutesCount` and the
standard `StackActions.pop` use the new 'StackActions.popToTop'.
@rk-for-zulip
Copy link
Contributor

As an additional data point: the current behavior (and additional behavior suggested by this thread) seems to be in contradiction to Google's Android navigation guidelines.

@chrisbobbe
Copy link
Contributor

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

5 participants