Mobile: navigation history from note to note

I'm trying to fix Mobile navigation experience with note links

More specifically: When you click on a Joplin note link in note 1 to navigate to note 2, you can click the hardware "back" button to go back to note 1. Currently, it always goes back to the notebook view.

I'm stuck at joplin/Note.tsx at dev · laurent22/joplin · GitHub . Look like the Note view does not allow hot-swapping the content. So the current hack is to first navigate back to the notebook view and navigate to note 2. My questions are:

  1. What prevents the Note view to reload another note? Is it easy to fix?
  2. There seems to be a lot of workarounds to avoid refactoring the note navigation history(see joplin/root.tsx at dev · laurent22/joplin · GitHub) Have someone though about how to refactor it? I don't want to add more hacks on top of it to support the note-to-note navigation.
1 Like

I've tried to make some progress on this as well.

A demo of what I'm trying to achieve can be seen in this thread.

The implementation of the history feature is basically this:

  • Enable hot-reload for CodeMirror
  • When the Note component's props update to a different note id, reload the note
  • To track note navigation history, hand NOTE_SELECT and FOLDER_SELECT actions to the shared reducer when handling NAV_GO actions in the app reducer

So far, this doesn't change the behavior of the back button, because it manges its own history.