Sync timeline state across devices
API seems mostly done. Client integration mostly isn't.
This feature ("markers") will sync your reading position across clients.
In other words:
- scroll through the timeline on one device (which supports markers)
- switch to a different device (whose client also that supports markers)
- you'll be at the same position as you were on the first device, rather than at the top (or somewhere random)
This is a lot like Tweet Marker back in the day.
We need to either implement this in ListViewController, or do it separately in both TimelineViewController (for the home timeline) and NotificationListViewController (for… you know).
No implementation for notifications at this point. I'm not sure that's an important use case.
For the home timeline, the basics are there: it can jump to another point when something else (you, on a different device/app) set the marker, and it can save a new point as the new marker. I also wrote down some design thoughts at https://github.com/chucker/Mastonaut/blob/main/designs/timeline-sync.md. We don't quite have that behavior yet. I think I should change it:
- [x] While the timeline is key (frontmost), periodically set the marker.
- [ ] When it resigns key, immediately set the marker.
- [ ] When it isn't, do nothing.
- [ ] When it becomes key again, read the marker. If needed, fetch additional toots. Jump to the toot from the marker.
Beyond that, there's the problem of how other clients behave, since the API doesn't actually prescribe this. Critically, the default web client has a behavior that is IMHO wrong. As soon as you open it, it sets the marker to the newest toot, which means as soon as you switch back to Mastonaut, it, too, will jump to the top of the timeline.