amp-story: Allow a viewer to request a page change from the story runtime
Describe the new feature or change to an existing feature you'd like to see
Allow the viewer to request the amp story to go to the next or previous page using a new message type selectPage, based on the existing selectDocument type. Result of the message should be the same as if a user tapped on the story. Example API would be messaging.sendRequest('selectPage', { next: true }, false); to go to the next page and messaging.sendRequest('selectPage', { previous: true }, false); to go to the previous page.
Describe alternatives you've considered
No alternatives, this is not possible currently.
Additional context
Our proposed solution is to name this message selectPage, similar to the selectDocument message. Is this an appropriate name? Are there any concerns with it overlapping any other existing names or extensions?
@gmajoulet
We've been trying to find viewer messaging names that aren't prefixed with story so they can be re-used for regular AMP pages. However, selectPage might introduce confusion with the amp-next-page extension.
Do you all think selectPage is fine, or should we we prefix it selectStoryPage?
Additionally, we'd like to introduce the inverse messaging, that sends a message from the runtime to the viewer on page navigation. What would be a good name for this one? selectedStoryPage?
cc @erwinmombay @choumx for amp-next-page
cc @ericfs
From the viewer perspective, I don't see any issue with the name selectPage. If there is chance of conflict with amp-next-page then selectStoryPage sounds good. I don't see a problem with including story. selectedStoryPage also SGTM.
selectPage sounds fine to me.
/cc @wassgha @jeffjose
If we were to implement this for amp-next-page I think a more appropriate name would be scrollToPage so I think selectPage should be fine for amp-story but it doesn't hurt to prefix with story if there's no reason not to.