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

Provide navigation options when opening web version from URL #96

Closed
zecakeh opened this issue Jan 11, 2021 · 5 comments · Fixed by #122
Closed

Provide navigation options when opening web version from URL #96

zecakeh opened this issue Jan 11, 2021 · 5 comments · Fixed by #122

Comments

@zecakeh
Copy link
Contributor

zecakeh commented Jan 11, 2021

When opening a url that is not /notes, the user can never navigate "back" (i.e. to Home), because there is nowhere to go back to in the navigation stack.

Possible solutions:

  • Load an initial state in the navigator, making the back button appear.
  • Implement a custom go back button that navigates to what would have been the previous screen (or Home by default).
  • Show the menu button to open the drawer.

We have to consider the different options looking at how it works with the back/forward buttons of the browser.

@tasn
Copy link
Member

tasn commented Jan 11, 2021

I think the internal state thing you mentioned is a good hack. I wonder if there's an official way of doing it.

@zecakeh
Copy link
Contributor Author

zecakeh commented Jan 12, 2021

I mentioned it because there is the initialState prop on the Navigation Container but I just saw in the docs that they say not to use it on web…

And actually I found this in the issues on GitHub:

It's possible technically, but from UX perspective, it's not great to do different things depending on which back button the user clicks imo, since it can mess up expectations of user regarding what's going to happen. I randomly click browser back button and in-app back button all the time, I'd expect both of them to do the same thing.

So I'm guessing the better option is to show the menu button if the user can't go back

@tasn
Copy link
Member

tasn commented Jan 12, 2021

It feels so icky though to show or not to show the back button depending on where you came from... I guess it's fine though, let's do it. Only show the menu if we can go back.

@zecakeh
Copy link
Contributor Author

zecakeh commented Jan 12, 2021

Actually in a web app, I would expect to always have the menu present, and the back button to be consistent if I navigate from a url or from within the app.

Maybe we should work on something like that?

The issue is having the menu button. back button, title and right action menu button present in the header on a small screen.

@tasn
Copy link
Member

tasn commented Jan 12, 2021

That's very easy to do, and you are right, that's probably the best idea. So just override it only for the web to always be the menu. That's a great solution!

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

Successfully merging a pull request may close this issue.

2 participants