Skip to content

Conversation

@mickael-menu
Copy link
Member

@mickael-menu mickael-menu commented Nov 24, 2021

Added

Navigator

  • The new Navigator.Listener.onJumpToLocator() API is called every time the navigator jumps to an explicit location, which might break the linear reading progression.
    • For example, it is called when clicking on internal links or programmatically calling Navigator.go(), but not when turning pages.
    • You can use this callback to implement a navigation history by differentiating between continuous and discontinuous moves.

Note: This is a quickfix for the shortcomings of the current Navigator API which can't be used to build a navigation history. In the future navigator I think we should emit more information about a navigation event, such as the source (link clicked, go() call, page turned, skip forward, etc.).

@mickael-menu mickael-menu requested a review from qnga November 24, 2021 10:05
Copy link
Member

@qnga qnga left a comment

Choose a reason for hiding this comment

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

Maybe you should be more explicit about the callback: it is called if the move is intended to be discontinuous, though it could turn out to be continuous or no move.

@mickael-menu
Copy link
Member Author

Maybe you should be more explicit about the callback: it is called if the move is intended to be discontinuous, though it could turn out to be continuous or no move.

It doesn't really matter, the idea is that the user triggered an action that breaks the continuous flow of progression, but it could end up in the same page or go to the next one.

Do you have any alternative for the API name that could better represent that?

@qnga
Copy link
Member

qnga commented Nov 25, 2021

Oh no, I was thinking only about documentation, since I wondered about that and had to look at the code to get the answer.

@mickael-menu
Copy link
Member Author

I see, I will try to clarify it tomorrow 👍

@mickael-menu
Copy link
Member Author

@qnga Is it clearer?

@qnga
Copy link
Member

qnga commented Nov 26, 2021

Yes!

@mickael-menu mickael-menu merged commit 1176cc9 into develop Nov 26, 2021
@mickael-menu mickael-menu deleted the feature/on-jump-to-locator branch November 26, 2021 14:59
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 this pull request may close these issues.

3 participants